[dev.typeparams] internal/bytealg: call memeqbody directly in memequal_varlen on ARM64

Currently, memequal_varlen opens up a frame and call memequal,
which then tail-calls memeqbody. This CL changes memequal_varlen
tail-calls memeqbody directly.

This makes it simpler to switch to the register ABI in the next
CL.

Change-Id: Ia1367c0abb7f4755fe736c404411793fb9e5c04f
Reviewed-on: https://go-review.googlesource.com/c/go/+/324399
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Cherry Mui 2021-06-02 18:00:12 -04:00
parent 165d39a1d4
commit 5a008a92e8

View file

@ -20,20 +20,15 @@ equal:
RET RET
// memequal_varlen(a, b unsafe.Pointer) bool // memequal_varlen(a, b unsafe.Pointer) bool
TEXT runtime·memequal_varlen(SB),NOSPLIT,$40-17 TEXT runtime·memequal_varlen(SB),NOSPLIT,$0-17
MOVD a+0(FP), R3 MOVD a+0(FP), R0
MOVD b+8(FP), R4 MOVD b+8(FP), R2
CMP R3, R4 CMP R0, R2
BEQ eq BEQ eq
MOVD 8(R26), R5 // compiler stores size at offset 8 in the closure MOVD 8(R26), R1 // compiler stores size at offset 8 in the closure
CBZ R5, eq CBZ R1, eq
MOVD R3, 8(RSP) MOVD $ret+16(FP), R8
MOVD R4, 16(RSP) B memeqbody<>(SB)
MOVD R5, 24(RSP)
BL runtime·memequal(SB)
MOVBU 32(RSP), R3
MOVB R3, ret+16(FP)
RET
eq: eq:
MOVD $1, R3 MOVD $1, R3
MOVB R3, ret+16(FP) MOVB R3, ret+16(FP)