aboutsummaryrefslogtreecommitdiff
path: root/src/internal/bytealg
diff options
context:
space:
mode:
authorbill_ofarrell <billo@ca.ibm.com>2018-06-28 18:39:37 -0400
committerBrad Fitzpatrick <bradfitz@golang.org>2018-06-29 20:48:07 +0000
commita5f8128e39d081c972e7bf3182122bac79bb6f8c (patch)
treeb40d8ece5b6cc51274683cbe95607254340e0e4c /src/internal/bytealg
parentd4d8237a5bfee5965382ee43da9e70417e9516af (diff)
downloadgo-a5f8128e39d081c972e7bf3182122bac79bb6f8c.tar.xz
bytes, strings: fix comparison of long byte slices on s390x
The existing implementation of bytes.Compare on s390x doesn't work properly for slices longer than 256 elements. This change fixes that. Added tests for long strings and slices of bytes. Fixes #26114 Change-Id: If6d8b68ee6dbcf99a24f867a1d3438b1f208954f Reviewed-on: https://go-review.googlesource.com/121495 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/internal/bytealg')
-rw-r--r--src/internal/bytealg/compare_s390x.s2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/internal/bytealg/compare_s390x.s b/src/internal/bytealg/compare_s390x.s
index 7f27b08c0e..d0d76166aa 100644
--- a/src/internal/bytealg/compare_s390x.s
+++ b/src/internal/bytealg/compare_s390x.s
@@ -49,6 +49,8 @@ loop:
BGT gt
BLT lt
SUB $256, R8
+ MOVD $256(R3), R3
+ MOVD $256(R5), R5
CMP R8, $256
BGT loop
tail: