Commit d472d3fa authored by Dave Cheney's avatar Dave Cheney

bytes: add assembly version of Equal for ARM

BenchmarkEqual32                       662          159  -75.98%
BenchmarkEqual4K                     76545        13719  -82.08%
BenchmarkEqual4M                  90136700     23588870  -73.83%
BenchmarkEqual64M               2147483647   1419616000  -42.63%

BenchmarkEqual32                     48.32       201.15    4.16x
BenchmarkEqual4K                     53.51       298.56    5.58x
BenchmarkEqual4M                     46.53       177.81    3.82x
BenchmarkEqual64M                    27.12        47.27    1.74x

R=golang-dev, qyzhai, minux.ma, rsc, iant, nigeltao
CC=golang-dev
https://golang.org/cl/6118049
parent 82e30c68
......@@ -27,4 +27,30 @@ _notfound:
RET
TEXT ·Equal(SB),7,$0
B ·equalPortable(SB)
MOVW alen+4(FP), R1
MOVW blen+16(FP), R3
CMP R1, R3 // unequal lengths are not equal
B.NE _notequal
MOVW aptr+0(FP), R0
MOVW bptr+12(FP), R2
ADD R0, R1 // end
_next:
CMP R0, R1
B.EQ _equal // reached the end
MOVBU.P 1(R0), R4
MOVBU.P 1(R2), R5
CMP R4, R5
B.EQ _next
_notequal:
MOVW $0, R0
MOVW R0, equal+24(FP)
RET
_equal:
MOVW $1, R0
MOVW R0, equal+24(FP)
RET
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment