From: Heisenberg Date: Thu, 11 Jun 2020 02:16:33 +0000 (+0800) Subject: internal/bytealg: use CBZ instructions X-Git-Tag: go1.16beta1~1309 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=99d6e3eec2cad4387b28759322273d774cc94fe5;p=gostls13.git internal/bytealg: use CBZ instructions Use CBZ to replace the comparison and jump to the zero instruction in the arm64 assembly file. Change-Id: Ie16fb52e27b4d327343e119ebc0f0ca756437bc4 Reviewed-on: https://go-review.googlesource.com/c/go/+/237477 Reviewed-by: Keith Randall Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot --- diff --git a/src/internal/bytealg/compare_arm64.s b/src/internal/bytealg/compare_arm64.s index 32e2ba200d..56d56f241e 100644 --- a/src/internal/bytealg/compare_arm64.s +++ b/src/internal/bytealg/compare_arm64.s @@ -36,8 +36,7 @@ TEXT cmpbody<>(SB),NOSPLIT|NOFRAME,$0-0 CMP R0, R1 CSEL LT, R1, R0, R6 // R6 is min(R0, R1) - CMP $0, R6 - BEQ samebytes + CBZ R6, samebytes BIC $0xf, R6, R10 CBZ R10, small // length < 16 ADD R2, R10 // end of chunk16