github.com/SandwichDev/go-internals@v0.0.0-20210605002614-12311ac6b2c5/bytealg/indexbyte_386.s (about) 1 // Copyright 2018 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 #include "go_asm.h" 6 #include "textflag.h" 7 8 TEXT ·IndexByte(SB),NOSPLIT,$0-20 9 MOVL b_base+0(FP), SI 10 MOVL b_len+4(FP), CX 11 MOVB c+12(FP), AL 12 MOVL SI, DI 13 CLD; REPN; SCASB 14 JZ 3(PC) 15 MOVL $-1, ret+16(FP) 16 RET 17 SUBL SI, DI 18 SUBL $1, DI 19 MOVL DI, ret+16(FP) 20 RET 21 22 TEXT ·IndexByteString(SB),NOSPLIT,$0-16 23 MOVL s_base+0(FP), SI 24 MOVL s_len+4(FP), CX 25 MOVB c+8(FP), AL 26 MOVL SI, DI 27 CLD; REPN; SCASB 28 JZ 3(PC) 29 MOVL $-1, ret+12(FP) 30 RET 31 SUBL SI, DI 32 SUBL $1, DI 33 MOVL DI, ret+12(FP) 34 RET