github.com/primecitizens/pcz/std@v0.2.1/core/bytealg/indexbyte_386.s (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  // 
     4  // Copyright 2018 The Go Authors. All rights reserved.
     5  // Use of this source code is governed by a BSD-style
     6  // license that can be found in the LICENSE file.
     7  
     8  //go:build pcz && 386
     9  
    10  #include "textflag.h"
    11  
    12  TEXT ·IndexSliceByte(SB),NOSPLIT,$0-20
    13  	MOVL b_base+0(FP), SI
    14  	MOVL b_len+4(FP), CX
    15  	MOVB c+12(FP), AL
    16  	MOVL SI, DI
    17  	CLD; REPN; SCASB
    18  	JZ 3(PC)
    19  	MOVL $-1, ret+16(FP)
    20  	RET
    21  	SUBL SI, DI
    22  	SUBL $1, DI
    23  	MOVL DI, ret+16(FP)
    24  	RET
    25  
    26  TEXT ·IndexByte(SB),NOSPLIT,$0-16
    27  	MOVL s_base+0(FP), SI
    28  	MOVL s_len+4(FP), CX
    29  	MOVB c+8(FP), AL
    30  	MOVL SI, DI
    31  	CLD; REPN; SCASB
    32  	JZ 3(PC)
    33  	MOVL $-1, ret+12(FP)
    34  	RET
    35  	SUBL SI, DI
    36  	SUBL $1, DI
    37  	MOVL DI, ret+12(FP)
    38  	RET