Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(640)

Delta Between Two Patch Sets: src/pkg/bytes/asm_arm.s

Issue 6106044: code review 6106044: bytes: add assembly version of IndexByte for ARM (Closed)
Left Patch Set: diff -r 2d97f35f53e1 https://code.google.com/p/go Created 11 years, 11 months ago
Right Patch Set: diff -r 29665c4bae69 https://go.googlecode.com/hg/ Created 11 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 TEXT ·IndexByte(SB),7,$0 5 TEXT ·IndexByte(SB),7,$0
6 » MOVW» 0(FP), R0» // start 6 » MOVW» base+0(FP), R0
7 » MOVW» R0, R4» » // store offset for later 7 » MOVW» len+4(FP), R1
8 » MOVW» 4(FP), R1» // len 8 » MOVBU» c+12(FP), R2» // byte to find
9 » ADD» R0, R1, R1» // end· 9 » MOVW» R0, R4» » // store base for later
10 » MOVBU 12(FP), R2» // needle 10 » ADD» R0, R1» » // end·
11 11
12 _loop: 12 _loop:
13 CMP R0, R1 13 CMP R0, R1
14 B.EQ _notfound 14 B.EQ _notfound
15 MOVBU.P 1(R0), R3 15 MOVBU.P 1(R0), R3
16 CMP R2, R3 16 CMP R2, R3
17 B.NE _loop 17 B.NE _loop
18 18
19 » SUB» $1, R0, R0 » // R0 will be one beyond the position we want 19 » SUB» $1, R0» » // R0 will be one beyond the position we want
20 » SUB» R4, R0, R0» // remove offset 20 » SUB» R4, R0» » // remove base
21 » MOVW R0, 16(FP)· 21 » MOVW R0, index+16(FP)·
22 RET 22 RET
23 23
24 _notfound: 24 _notfound:
25 MOVW $-1, R0 25 MOVW $-1, R0
26 » MOVW» R0, 16(FP) 26 » MOVW» R0, index+16(FP)
27 RET 27 RET
28 28
29 // no memcmp implementation on arm yet
30 TEXT ·Equal(SB),7,$0 29 TEXT ·Equal(SB),7,$0
31 B ·equalPortable(SB) 30 B ·equalPortable(SB)
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b