diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2006-11-23 00:19:56 +0300 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2006-11-23 00:19:56 +0300 |
commit | 9bc5b6181bcaf823ff1bce61e2ca984920915afb (patch) | |
tree | 5d805d16b301ba8f9a2e2fead05aa8f99092fd56 /newlib/libc/machine/spu/strrchr.c | |
parent | d22713e25db2660fa35444f572673624804b6586 (diff) |
2006-11-22 Luca Barbato <lu_zero@gentoo.org>
* libc/machine/spu/memcpy.c: Use spu_splats, explicit cast.
* libc/machine/spu/memmove.c: Use spu_splats, explicit cast.
* libc/machine/spu/memset.c: Use spu_splats, remove apple-cast.
* libc/machine/spu/strchr.c: Use spu_splats, remove apple-cast.
* libc/machine/spu/strncat.c: Explicit cast.
* libc/machine/spu/strncmp.c: Use spu_splats.
* libc/machine/spu/strncpy.c: Explicit cast.
* libc/machine/spu/strrchr.c: Use spu_splats.
* libc/machine/spu/strspn.c: Use spu_splats.
Diffstat (limited to 'newlib/libc/machine/spu/strrchr.c')
-rw-r--r-- | newlib/libc/machine/spu/strrchr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/newlib/libc/machine/spu/strrchr.c b/newlib/libc/machine/spu/strrchr.c index ec80841c2..c96d0f546 100644 --- a/newlib/libc/machine/spu/strrchr.c +++ b/newlib/libc/machine/spu/strrchr.c @@ -45,14 +45,14 @@ char * strrchr(const char *s, int c) vec_uint4 cmp_c, cmp_0, cmp; vec_uint4 res_ptr, res_cmp; vec_uint4 mask, result; - + vec_uint4 one = spu_splats((unsigned int)-1); /* Scan memory array a quadword at a time. Skip leading * mis-aligned bytes. */ ptr = (vec_uchar16 *)s; nskip = -((unsigned int)(ptr) & 15); - mask = spu_rlmask((vec_uint4)(0xFFFF), nskip); + mask = spu_rlmask(one, nskip); vc = spu_splats((unsigned char)(c)); @@ -62,8 +62,8 @@ char * strrchr(const char *s, int c) cmp_c = spu_and(spu_gather(spu_cmpeq(data, vc)), mask); cmp_0 = spu_and(spu_gather(spu_cmpeq(data, 0)), mask); - res_ptr = VEC_SPLAT_U32(0); - res_cmp = VEC_SPLAT_U32(0); + res_ptr = spu_splats(0); + res_cmp = spu_splats(0); while (spu_extract(cmp_0, 0) == 0) { cmp = spu_cmpeq(cmp_c, 0); @@ -84,7 +84,7 @@ char * strrchr(const char *s, int c) * * First mask off compare results following the first termination character. */ - mask = spu_sl(VEC_SPLAT_U32(-1), 31 - spu_extract(spu_cntlz(cmp_0), 0)); + mask = spu_sl(one, 31 - spu_extract(spu_cntlz(cmp_0), 0)); cmp_c = spu_and(cmp_c, mask); /* Conditionally update res_ptr and res_cmd if a match was found in the last |