]> Cypherpunks repositories - gostls13.git/commitdiff
internal/bytealg: use CBZ instructions
authorHeisenberg <lziqiang1@gmail.com>
Thu, 11 Jun 2020 02:16:33 +0000 (10:16 +0800)
committerKeith Randall <khr@golang.org>
Mon, 17 Aug 2020 21:02:28 +0000 (21:02 +0000)
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 <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/internal/bytealg/compare_arm64.s

index 32e2ba200dacc3988f80a48d25f67256a6a75342..56d56f241eb8696d2a22c6133148ce7f8625c933 100644 (file)
@@ -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