aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_arm.s
diff options
context:
space:
mode:
authorKeith Randall <khr@google.com>2018-03-01 16:38:41 -0800
committerKeith Randall <khr@golang.org>2018-03-02 22:46:15 +0000
commit403ab0f2214f583db84a2dae275389be92072a35 (patch)
tree9ff2fc82235a27acd95595f2152f03eec83fa71e /src/runtime/asm_arm.s
parentdcedcaa5fb15748cc2e5cb9461fc6b4f4fc942cb (diff)
downloadgo-403ab0f2214f583db84a2dae275389be92072a35.tar.gz
go-403ab0f2214f583db84a2dae275389be92072a35.zip
internal/bytealg: move IndexByte asssembly to the new bytealg package
Move the IndexByte function from the runtime to a new bytealg package. The new package will eventually hold all the optimized assembly for groveling through byte slices and strings. It seems a better home for this code than randomly keeping it in runtime. Once this is in, the next step is to move the other functions (Compare, Equal, ...). Update #19792 This change seems complicated enough that we might just declare "not worth it" and abandon. Opinions welcome. The core assembly is all unchanged, except minor modifications where the code reads cpu feature bits. The wrapper functions have been cleaned up as they are now actually checked by vet. Change-Id: I9fa75bee5d85db3a65b3fd3b7997e60367523796 Reviewed-on: https://go-review.googlesource.com/98016 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.s48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s
index 0b429705e8..d672bc26a2 100644
--- a/src/runtime/asm_arm.s
+++ b/src/runtime/asm_arm.s
@@ -925,54 +925,6 @@ equal:
MOVBU R0, ret+24(FP)
RET
-TEXT bytes·IndexByte(SB),NOSPLIT,$0-20
- MOVW s+0(FP), R0
- MOVW s_len+4(FP), R1
- MOVBU c+12(FP), R2 // byte to find
- MOVW R0, R4 // store base for later
- ADD R0, R1 // end
-
-_loop:
- CMP R0, R1
- B.EQ _notfound
- MOVBU.P 1(R0), R3
- CMP R2, R3
- B.NE _loop
-
- SUB $1, R0 // R0 will be one beyond the position we want
- SUB R4, R0 // remove base
- MOVW R0, ret+16(FP)
- RET
-
-_notfound:
- MOVW $-1, R0
- MOVW R0, ret+16(FP)
- RET
-
-TEXT strings·IndexByte(SB),NOSPLIT,$0-16
- MOVW s+0(FP), R0
- MOVW s_len+4(FP), R1
- MOVBU c+8(FP), R2 // byte to find
- MOVW R0, R4 // store base for later
- ADD R0, R1 // end
-
-_sib_loop:
- CMP R0, R1
- B.EQ _sib_notfound
- MOVBU.P 1(R0), R3
- CMP R2, R3
- B.NE _sib_loop
-
- SUB $1, R0 // R0 will be one beyond the position we want
- SUB R4, R0 // remove base
- MOVW R0, ret+12(FP)
- RET
-
-_sib_notfound:
- MOVW $-1, R0
- MOVW R0, ret+12(FP)
- RET
-
TEXT runtime·return0(SB),NOSPLIT,$0
MOVW $0, R0
RET