aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_netbsd_arm.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-07-30 10:54:53 -0400
committerRuss Cox <rsc@golang.org>2015-07-30 15:48:29 +0000
commitc9d2c7f0d26a9619069a3cb2291333174b6db63f (patch)
treeb7f8960efe1ef2cccb7c5e495f5558ffc5be24cb /src/runtime/sys_netbsd_arm.s
parenta1e422071cd8122b4b93bbdeb02d0ea646519955 (diff)
downloadgo-c9d2c7f0d26a9619069a3cb2291333174b6db63f.tar.gz
go-c9d2c7f0d26a9619069a3cb2291333174b6db63f.zip
runtime: replace divide with multiply in runtime.usleep on arm
We want to adjust the DIV calling convention to use m, and usleep can be called without an m, so switch to a multiplication by the reciprocal (and test). Step toward a fix for #6699 and #10486. Change-Id: Iccf76a18432d835e48ec64a2fa34a0e4d6d4b955 Reviewed-on: https://go-review.googlesource.com/12898 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/sys_netbsd_arm.s')
-rw-r--r--src/runtime/sys_netbsd_arm.s7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/runtime/sys_netbsd_arm.s b/src/runtime/sys_netbsd_arm.s
index 24c32a6158..ae669ce76b 100644
--- a/src/runtime/sys_netbsd_arm.s
+++ b/src/runtime/sys_netbsd_arm.s
@@ -104,15 +104,12 @@ TEXT runtime·lwp_tramp(SB),NOSPLIT,$0
TEXT runtime·usleep(SB),NOSPLIT,$16
MOVW usec+0(FP), R0
- MOVW R0, R2
- MOVW $1000000, R1
- DIV R1, R0
+ CALL runtime·usplitR0(SB)
// 0(R13) is the saved LR, don't use it
MOVW R0, 4(R13) // tv_sec.low
MOVW $0, R0
MOVW R0, 8(R13) // tv_sec.high
- MOD R1, R2
- MOVW $1000, R1
+ MOVW $1000, R2
MUL R1, R2
MOVW R2, 12(R13) // tv_nsec