aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_arm.s
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2018-03-03 14:24:54 -0800
committerKeith Randall <khr@golang.org>2018-03-04 17:49:39 +0000
commitf6332bb84ad87e958290ae23b29a2b13a41ee2a2 (patch)
treef09ef9174bee3ae86920a113318f4a322a1a98ad /src/runtime/asm_arm.s
parent45964e4f9c950863adcaeb62fbe49f3fa913f27d (diff)
downloadgo-f6332bb84ad87e958290ae23b29a2b13a41ee2a2.tar.xz
internal/bytealg: move compare functions to bytealg
Move bytes.Compare and runtime·cmpstring to bytealg. Update #19792 Change-Id: I139e6d7c59686bef7a3017e3dec99eba5fd10447 Reviewed-on: https://go-review.googlesource.com/98515 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/asm_arm.s')
-rw-r--r--src/runtime/asm_arm.s53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s
index 423e1b9abb..d54dc62ba4 100644
--- a/src/runtime/asm_arm.s
+++ b/src/runtime/asm_arm.s
@@ -801,59 +801,6 @@ TEXT runtime·aeshashstr(SB),NOSPLIT|NOFRAME,$0-0
MOVW $0, R0
MOVW (R0), R1
-TEXT runtime·cmpstring(SB),NOSPLIT|NOFRAME,$0-20
- MOVW s1_base+0(FP), R2
- MOVW s1_len+4(FP), R0
- MOVW s2_base+8(FP), R3
- MOVW s2_len+12(FP), R1
- ADD $20, R13, R7
- B runtime·cmpbody(SB)
-
-TEXT bytes·Compare(SB),NOSPLIT|NOFRAME,$0-28
- MOVW s1+0(FP), R2
- MOVW s1+4(FP), R0
- MOVW s2+12(FP), R3
- MOVW s2+16(FP), R1
- ADD $28, R13, R7
- B runtime·cmpbody(SB)
-
-// On entry:
-// R0 is the length of s1
-// R1 is the length of s2
-// R2 points to the start of s1
-// R3 points to the start of s2
-// R7 points to return value (-1/0/1 will be written here)
-//
-// On exit:
-// R4, R5, and R6 are clobbered
-TEXT runtime·cmpbody(SB),NOSPLIT|NOFRAME,$0-0
- CMP R2, R3
- BEQ samebytes
- CMP R0, R1
- MOVW R0, R6
- MOVW.LT R1, R6 // R6 is min(R0, R1)
-
- ADD R2, R6 // R2 is current byte in s1, R6 is last byte in s1 to compare
-loop:
- CMP R2, R6
- BEQ samebytes // all compared bytes were the same; compare lengths
- MOVBU.P 1(R2), R4
- MOVBU.P 1(R3), R5
- CMP R4, R5
- BEQ loop
- // bytes differed
- MOVW.LT $1, R0
- MOVW.GT $-1, R0
- MOVW R0, (R7)
- RET
-samebytes:
- CMP R0, R1
- MOVW.LT $1, R0
- MOVW.GT $-1, R0
- MOVW.EQ $0, R0
- MOVW R0, (R7)
- RET
-
TEXT runtime·return0(SB),NOSPLIT,$0
MOVW $0, R0
RET