From: Archana R Date: Tue, 19 Oct 2021 09:11:46 +0000 (-0500) Subject: internal/bytealg: fix Separator length check for Index/ppc64le X-Git-Tag: go1.18beta1~812 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6ec9a1da2d48fdc94093feb0ea3465129e11fc24;p=gostls13.git internal/bytealg: fix Separator length check for Index/ppc64le 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 TryBot-Result: Go Bot Reviewed-by: Lynn Boger Trust: Keith Randall --- diff --git a/src/internal/bytealg/index_ppc64x.s b/src/internal/bytealg/index_ppc64x.s index f587a8ae25..ab47495427 100644 --- a/src/internal/bytealg/index_ppc64x.s +++ b/src/internal/bytealg/index_ppc64x.s @@ -85,7 +85,7 @@ TEXT ·IndexString(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