aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/sparc/sparc64/memchr.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-05-18 10:00:20 +0000
committerUlrich Drepper <drepper@redhat.com>1999-05-18 10:00:20 +0000
commit407d26b7053a659c5997cb44e85824647139b884 (patch)
tree7f442602b80281f7479a20364340cef058575c1e /sysdeps/sparc/sparc64/memchr.S
parent1acf7665c7b5f1d65b322de82065c4eaec623afe (diff)
downloadglibc-407d26b7053a659c5997cb44e85824647139b884.tar
glibc-407d26b7053a659c5997cb44e85824647139b884.tar.gz
glibc-407d26b7053a659c5997cb44e85824647139b884.tar.bz2
glibc-407d26b7053a659c5997cb44e85824647139b884.zip
Update.
1999-05-18 Jakub Jelinek <jj@ultra.linux.cz> * sysdeps/sparc/sparc64/rawmemchr.S: New file. * sysdeps/sparc/sparc32/sparcv9/rawmemchr.S: New file. * sysdeps/sparc/sparc64/memchr.S: Fix if the second argument contains garbage in bits 8-63. * sysdeps/sparc/sparc64/memset.S: Ditto. * sysdeps/sparc/sparc64/strchr.S: Ditto.
Diffstat (limited to 'sysdeps/sparc/sparc64/memchr.S')
-rw-r--r--sysdeps/sparc/sparc64/memchr.S35
1 files changed, 18 insertions, 17 deletions
diff --git a/sysdeps/sparc/sparc64/memchr.S b/sysdeps/sparc/sparc64/memchr.S
index 9adf33ffc6..87e9022779 100644
--- a/sysdeps/sparc/sparc64/memchr.S
+++ b/sysdeps/sparc/sparc64/memchr.S
@@ -56,37 +56,37 @@
.text
.align 32
ENTRY(memchr)
- sll %o1, 8, %g3 /* IEU0 Group */
+ and %o1, 0xff, %o1 /* IEU0 Group */
#ifdef USE_BPR
brz,pn %o2, 12f /* CTI+IEU1 */
#else
tst %o2 /* IEU1 */
be,pn %XCC, 12f /* CTI */
- srl %o1, 0, %o1 /* IEU0 */
#endif
- add %o0, %o2, %o2 /* IEU0 Group */
- sethi %hi(0x01010101), %g1 /* IEU1 */
+ sll %o1, 8, %g3 /* IEU0 Group */
+ add %o0, %o2, %o2 /* IEU1 */
- or %g3, %o1, %g3 /* IEU0 Group */
+ sethi %hi(0x01010101), %g1 /* IEU0 Group */
+ or %g3, %o1, %g3 /* IEU1 */
ldub [%o0], %o3 /* Load */
sllx %g3, 16, %g5 /* IEU0 Group */
- or %g1, %lo(0x01010101), %g1 /* IEU1 */
+ or %g1, %lo(0x01010101), %g1 /* IEU1 */
sllx %g1, 32, %g2 /* IEU0 Group */
or %g3, %g5, %g3 /* IEU1 */
sllx %g3, 32, %g5 /* IEU0 Group */
- cmp %o3, %o1 /* IEU1 */
+ cmp %o3, %o1 /* IEU1 */
be,pn %xcc, 13f /* CTI */
or %g1, %g2, %g1 /* IEU0 Group */
andcc %o0, 7, %g0 /* IEU1 */
- bne,a,pn %icc, 21f /* CTI */
+ bne,a,pn %icc, 21f /* CTI */
add %o0, 1, %o0 /* IEU0 Group */
ldx [%o0], %o3 /* Load Group */
sllx %g1, 7, %g2 /* IEU0 */
- or %g3, %g5, %g3 /* IEU1 */
+ or %g3, %g5, %g3 /* IEU1 */
1: add %o0, 8, %o0 /* IEU0 Group */
xor %o3, %g3, %o4 /* IEU1 */
/* %g1 = 0101010101010101 *
@@ -95,49 +95,50 @@ ENTRY(memchr)
* %o3 = value *
* %o4 = value XOR c */
2: cmp %o0, %o2 /* IEU1 Group */
- bg,pn %XCC, 11f /* CTI */
+ bg,pn %XCC, 11f /* CTI */
ldxa [%o0] ASI_PNF, %o3 /* Load */
sub %o4, %g1, %o5 /* IEU0 Group */
add %o0, 8, %o0 /* IEU1 */
#ifdef EIGHTBIT_NOT_RARE
andn %o5, %o4, %o5 /* IEU0 Group */
#endif
- andcc %o5, %g2, %g0 /* IEU1 Group */
+ andcc %o5, %g2, %g0 /* IEU1 Group */
be,a,pt %xcc, 2b /* CTI */
xor %o3, %g3, %o4 /* IEU0 */
srlx %o4, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
+ andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 3f /* CTI */
srlx %o4, 48, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
+ be,pn %icc, 4f /* CTI */
srlx %o4, 40, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 5f /* CTI */
- srlx %o4, 32, %g5 /* IEU0 */
+ srlx %o4, 32, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 6f /* CTI */
srlx %o4, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
+ andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 7f /* CTI */
srlx %o4, 16, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 8f /* CTI */
+ be,pn %icc, 8f /* CTI */
srlx %o4, 8, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 9f /* CTI */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
+ andcc %o4, 0xff, %g0 /* IEU1 Group */
bne,pt %icc, 2b /* CTI */
xor %o3, %g3, %o4 /* IEU0 */
retl /* CTI+IEU1 Group */
+
add %o0, -9, %o0 /* IEU0 */
.align 16