mirror of
https://github.com/golang/go
synced 2024-11-20 01:14:40 -07:00
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
This commit is contained in:
parent
82e30c681c
commit
d472d3faf1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user