From cfd016df1fba2a2a104f4cca705aa4357777986b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 3 Nov 2021 18:19:04 +0100 Subject: runtime: on windows, read nanotime with one instruction or issue barrier On 64-bit, this is more efficient, and on ARM64, this prevents the time from moving backwards due to the weaker memory model. On ARM32 due to the weaker memory model, we issue a memory barrier. Updates #48072. Change-Id: If4695716c3039d8af14e14808af217f5c99fc93a Reviewed-on: https://go-review.googlesource.com/c/go/+/361057 Trust: Jason A. Donenfeld Run-TryBot: Jason A. Donenfeld TryBot-Result: Go Bot Reviewed-by: Austin Clements --- src/runtime/sys_windows_arm64.s | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/runtime/sys_windows_arm64.s') diff --git a/src/runtime/sys_windows_arm64.s b/src/runtime/sys_windows_arm64.s index 44145c53fb..87f8f0d218 100644 --- a/src/runtime/sys_windows_arm64.s +++ b/src/runtime/sys_windows_arm64.s @@ -415,15 +415,7 @@ TEXT runtime·nanotime1(SB),NOSPLIT|NOFRAME,$0-8 CMP $0, R0 BNE useQPC MOVD $_INTERRUPT_TIME, R3 -loop: - MOVWU time_hi1(R3), R1 - MOVWU time_lo(R3), R0 - MOVWU time_hi2(R3), R2 - CMP R1, R2 - BNE loop - - // wintime = R1:R0, multiply by 100 - ORR R1<<32, R0 + MOVD time_lo(R3), R0 MOVD $100, R1 MUL R1, R0 MOVD R0, ret+0(FP) -- cgit v1.3