1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- .set noreorder
- .set noat
- .align 4
- .globl strchr
- .ent strchr
- strchr:
- .frame sp, 0, ra
- .prologue 0
- ldq_u t0, 0(a0)
- and a1, 0xff, t3
- insbl a1, 1, t5
- insbl a1, 7, a2
- insbl t3, 6, a3
- or t5, t3, a1
- andnot a0, 7, v0
- lda t4, -1
- mskqh t4, a0, t4
- or a2, a3, a2
- inswl a1, 2, t5
- inswl a1, 4, a3
- or a1, a2, a1
- or a3, t5, t5
- cmpbge zero, t0, t2
- cmpbge zero, t4, t4
-
- or t5, a1, a1
- xor t0, a1, t1
- cmpbge zero, t1, t3
- or t2, t3, t0
- andnot t0, t4, t0
- cttz t0, a2
- nop
- bne t0, $found
-
- $loop: ldq t0, 8(v0)
- addq v0, 8, v0
- xor t0, a1, t1
- cmpbge zero, t0, t2
- cmpbge zero, t1, t3
- or t2, t3, t0
- cttz t3, a2
- beq t0, $loop
- $found: negq t0, t1
- and t0, t1, t0
- and t0, t3, t1
- addq v0, a2, v0
- cmoveq t1, $31, v0
- nop
- nop
- ret
- .end strchr
- EXPORT_SYMBOL(strchr)
|