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_arm.s | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/runtime/sys_windows_arm.s') diff --git a/src/runtime/sys_windows_arm.s b/src/runtime/sys_windows_arm.s index c9e96cb652..e5b1b7e9f3 100644 --- a/src/runtime/sys_windows_arm.s +++ b/src/runtime/sys_windows_arm.s @@ -350,7 +350,9 @@ TEXT runtime·nanotime1(SB),NOSPLIT|NOFRAME,$0-8 MOVW $_INTERRUPT_TIME, R3 loop: MOVW time_hi1(R3), R1 + DMB MB_ISH MOVW time_lo(R3), R0 + DMB MB_ISH MOVW time_hi2(R3), R2 CMP R1, R2 BNE loop -- cgit v1.3