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

Unified Diff: src/pkg/runtime/asm_386.s

Issue 12483043: code review 12483043: strings: use runtime assembly for IndexByte (Closed)
Patch Set: diff -r e285a7b170aa https://go.googlecode.com/hg/ Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pkg/runtime/asm_amd64.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/runtime/asm_386.s
===================================================================
--- a/src/pkg/runtime/asm_386.s
+++ b/src/pkg/runtime/asm_386.s
@@ -504,7 +504,7 @@
// so actually
// void atomicload64(uint64 *res, uint64 volatile *addr);
TEXT runtime·atomicload64(SB), 7, $0-8
- MOVL 4(SP), BX
+ MOVL 4(SP), BX
MOVL 8(SP), AX
// MOVQ (%EAX), %MM0
BYTE $0x0f; BYTE $0x6f; BYTE $0x00
@@ -1220,6 +1220,20 @@
MOVL DI, ret+16(FP)
RET
+TEXT strings·IndexByte(SB),7,$0
+ MOVL s+0(FP), SI
+ MOVL s_len+4(FP), CX
+ MOVB c+8(FP), AL
+ MOVL SI, DI
+ CLD; REPN; SCASB
+ JZ 3(PC)
+ MOVL $-1, ret+12(FP)
+ RET
+ SUBL SI, DI
+ SUBL $1, DI
+ MOVL DI, ret+12(FP)
+ RET
+
// input:
// SI = a
// DI = b
« no previous file with comments | « no previous file | src/pkg/runtime/asm_amd64.s » ('j') | no next file with comments »

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