strings: use runtime assembly for IndexByte

Fixes #3751

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/12483043
diff --git a/src/pkg/runtime/asm_386.s b/src/pkg/runtime/asm_386.s
index f6204ac..863bcc3 100644
--- 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