]> Cypherpunks repositories - gostls13.git/commitdiff
internal/bytealg: fix Separator length check for Index/ppc64le
authorArchana R <aravind5@in.ibm.com>
Tue, 19 Oct 2021 09:11:46 +0000 (04:11 -0500)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 21 Oct 2021 15:45:05 +0000 (15:45 +0000)
Modified condition in the ASM implementation of indexbody to
determine if separator length crosses 16 bytes to BGT from BGE
to avoid incorrectly crossing a page.

Also fixed IndexString to invoke indexbodyp9 when on the POWER9
platform

Change-Id: I0602a797cc75287990eea1972e9e473744f6f5a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/356849
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Trust: Keith Randall <khr@golang.org>

src/internal/bytealg/index_ppc64x.s

index f587a8ae25ce7ac79c1e2be5065cde06d0105248..ab47495427dbae9ab3fcd44ea49bbf66b93e7114 100644 (file)
@@ -85,7 +85,7 @@ TEXT ·IndexString<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-40
        MOVBZ internal∕cpu·PPC64+const_offsetPPC64HasPOWER9(SB), R7
        CMP   R7, $1
        BNE   power8
-       BR    indexbody<>(SB)
+       BR    indexbodyp9<>(SB)
 
 #endif
 power8:
@@ -152,7 +152,7 @@ loadge16:
        ANDCC $15, R5, R9 // Find byte offset of sep
        ADD   R9, R6, R10 // Add sep len
        CMP   R10, $16    // Check if sep len+offset > 16
-       BGE   sepcross16  // Sep crosses 16 byte boundary
+       BGT   sepcross16  // Sep crosses 16 byte boundary
 
        RLDICR $0, R5, $59, R8 // Adjust addr to 16 byte container
        VLOADSWAP(R8, R0, V0, V0_)// Load 16 bytes @R8 into V0
@@ -490,7 +490,7 @@ loadge16:
        ANDCC $15, R5, R9 // Find byte offset of sep
        ADD   R9, R6, R10 // Add sep len
        CMP   R10, $16    // Check if sep len+offset > 16
-       BGE   sepcross16  // Sep crosses 16 byte boundary
+       BGT   sepcross16  // Sep crosses 16 byte boundary
 
        RLDICR  $0, R5, $59, R8 // Adjust addr to 16 byte container
        LXVB16X (R8)(R0), V0_   // Load 16 bytes @R8 into V0