diff --git a/src/runtime/race_arm64.s b/src/runtime/race_arm64.s index 5b1a1cb89a1..6bc389f69f4 100644 --- a/src/runtime/race_arm64.s +++ b/src/runtime/race_arm64.s @@ -38,8 +38,7 @@ MRS_TPIDR_R0 \ TP_ALIGN \ MOVD runtime·tls_g(SB), R11 \ - ADD R11, R0 \ - MOVD 0(R0), g + MOVD (R0)(R11), g // func runtime·raceread(addr uintptr) // Called from instrumented code. diff --git a/src/runtime/tls_arm64.s b/src/runtime/tls_arm64.s index 701abae105d..3f02974d5b7 100644 --- a/src/runtime/tls_arm64.s +++ b/src/runtime/tls_arm64.s @@ -20,8 +20,7 @@ TEXT runtime·load_g(SB),NOSPLIT,$0 AND $0xfffffffffffffff8, R0 #endif MOVD runtime·tls_g(SB), R27 - ADD R27, R0 - MOVD 0(R0), g + MOVD (R0)(R27), g nocgo: RET @@ -38,8 +37,7 @@ TEXT runtime·save_g(SB),NOSPLIT,$0 AND $0xfffffffffffffff8, R0 #endif MOVD runtime·tls_g(SB), R27 - ADD R27, R0 - MOVD g, 0(R0) + MOVD g, (R0)(R27) nocgo: RET