From: Cherry Mui Date: Wed, 2 Jun 2021 22:00:12 +0000 (-0400) Subject: [dev.typeparams] internal/bytealg: call memeqbody directly in memequal_varlen on... X-Git-Tag: go1.18beta1~1818^2^2~435 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5a008a92e8;p=gostls13.git [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 Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Michael Knyszek --- diff --git a/src/internal/bytealg/equal_arm64.s b/src/internal/bytealg/equal_arm64.s index 01aa7b7b7a..944edd8768 100644 --- a/src/internal/bytealg/equal_arm64.s +++ b/src/internal/bytealg/equal_arm64.s @@ -20,20 +20,15 @@ equal: RET // memequal_varlen(a, b unsafe.Pointer) bool -TEXT runtime·memequal_varlen(SB),NOSPLIT,$40-17 - MOVD a+0(FP), R3 - MOVD b+8(FP), R4 - CMP R3, R4 +TEXT runtime·memequal_varlen(SB),NOSPLIT,$0-17 + MOVD a+0(FP), R0 + MOVD b+8(FP), R2 + CMP R0, R2 BEQ eq - MOVD 8(R26), R5 // compiler stores size at offset 8 in the closure - CBZ R5, eq - MOVD R3, 8(RSP) - MOVD R4, 16(RSP) - MOVD R5, 24(RSP) - BL runtime·memequal(SB) - MOVBU 32(RSP), R3 - MOVB R3, ret+16(FP) - RET + MOVD 8(R26), R1 // compiler stores size at offset 8 in the closure + CBZ R1, eq + MOVD $ret+16(FP), R8 + B memeqbody<>(SB) eq: MOVD $1, R3 MOVB R3, ret+16(FP)