aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sparc/sparc32/strchr.S')
-rw-r--r--sysdeps/sparc/sparc32/strchr.S33
1 files changed, 17 insertions, 16 deletions
diff --git a/sysdeps/sparc/sparc32/strchr.S b/sysdeps/sparc/sparc32/strchr.S
index 6120ecd6a3..7c397171f5 100644
--- a/sysdeps/sparc/sparc32/strchr.S
+++ b/sysdeps/sparc/sparc32/strchr.S
@@ -39,9 +39,20 @@
.text
.align 4
-10: ldub [%o0], %g4
+ENTRY(strchr)
+ andcc %o1, 0xff, %o1
+ be 12f
+ sll %o1, 8, %o2
+ andcc %o0, 3, %g0
+ or %o1, %o2, %o2
+ sethi %hi(0x80808080), %o4
+ sll %o2, 16, %o3
+ be 13f
+ or %o3, %o2, %g2
+
+ ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
@@ -50,7 +61,7 @@
or %o4, %lo(0x80808080), %o3
ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
@@ -59,27 +70,17 @@
sethi %hi(0x01010101), %o5
ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
or %o5, %lo(0x01010101), %o2
b 6f
ld [%o0], %g4
-1: retl
+11: retl
sub %o0, 1, %o0
-ENTRY(strchr)
- andcc %o1, 0xff, %o1
- be 12f
- sll %o1, 8, %o2
- andcc %o0, 3, %g0
- or %o1, %o2, %o2
- sethi %hi(0x80808080), %o4
- sll %o2, 16, %o3
- bne 10b
- or %o3, %o2, %g2
- or %o4, %lo(0x80808080), %o3
+13: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o5
5: or %o5, %lo(0x01010101), %o2
7: ld [%o0], %g4