12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- .set noreorder
- .set noat
- .align 3
- .ent strrchr
- .globl strrchr
- strrchr:
- .frame sp, 0, ra
- .prologue 0
- zapnot a1, 1, a1
- mov zero, t6
- sll a1, 8, t5
- mov zero, t8
- or t5, a1, a1
- ldq_u t0, 0(a0)
- sll a1, 16, t5
- andnot a0, 7, v0
- or t5, a1, a1
- lda t4, -1
- sll a1, 32, t5
- cmpbge zero, t0, t1
- mskqh t4, a0, t4
- or t5, a1, a1
- xor t0, a1, t2
- cmpbge zero, t4, t4
- cmpbge zero, t2, t3
- andnot t1, t4, t1
- andnot t3, t4, t3
- bne t1, $eos
-
- $loop:
- ldq t0, 8(v0)
- cmovne t3, v0, t6
- cmovne t3, t3, t8
- addq v0, 8, v0
- xor t0, a1, t2
- cmpbge zero, t0, t1
- cmpbge zero, t2, t3
- beq t1, $loop
-
- $eos:
- negq t1, t4
- and t1, t4, t4
- subq t4, 1, t5
- or t4, t5, t4
- and t3, t4, t3
- cmovne t3, t3, t8
- cmovne t3, v0, t6
-
-
- beq t8, $retnull
- and t8, 0xf0, t2
- cmovne t2, t2, t8
- cmovne t2, 4, t2
- and t8, 0xcc, t1
- cmovne t1, t1, t8
- cmovne t1, 2, t1
- and t8, 0xaa, t0
- cmovne t0, 1, t0
- addq t2, t1, t1
- addq t6, t0, v0
- addq v0, t1, v0
- ret
- $retnull:
- mov zero, v0
- ret
- .end strrchr
- EXPORT_SYMBOL(strrchr)
|