1
0
mirror of https://github.com/golang/go synced 2024-11-26 23:01:23 -07:00

runtime: use indexed load/store in ARM64 assembly

Minor optimization. Spotted while working on that code.

Change-Id: Ia02dee10d74bce79a0bef1eaba7fac1bfc27df38
Reviewed-on: https://go-review.googlesource.com/c/go/+/266899
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: fannie zhang <Fannie.Zhang@arm.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Cherry Zhang 2020-10-31 17:21:40 -04:00
parent cb65c8d58a
commit 202aa085ab
2 changed files with 3 additions and 6 deletions

View File

@ -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.

View File

@ -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