diff options
Diffstat (limited to 'sysdeps/powerpc/powerpc32/strchr.S')
-rw-r--r-- | sysdeps/powerpc/powerpc32/strchr.S | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/sysdeps/powerpc/powerpc32/strchr.S b/sysdeps/powerpc/powerpc32/strchr.S index f2e0d26c9d..c9952eeccf 100644 --- a/sysdeps/powerpc/powerpc32/strchr.S +++ b/sysdeps/powerpc/powerpc32/strchr.S @@ -17,26 +17,18 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> -#include <bp-sym.h> -#include <bp-asm.h> /* See strlen.s for comments on how this works. */ /* char * [r3] strchr (const char *s [r3] , int c [r4] ) */ -ENTRY (BP_SYM (strchr)) +ENTRY (strchr) #define rTMP1 r0 #define rRTN r3 /* outgoing result */ -#if __BOUNDED_POINTERS__ -# define rSTR r4 -# define rCHR r5 /* byte we're looking for, spread over the whole word */ -# define rWORD r8 /* the current word */ -#else -# define rSTR r8 /* current word pointer */ -# define rCHR r4 /* byte we're looking for, spread over the whole word */ -# define rWORD r5 /* the current word */ -#endif +#define rSTR r8 /* current word pointer */ +#define rCHR r4 /* byte we're looking for, spread over the whole word */ +#define rWORD r5 /* the current word */ #define rCLZB rCHR /* leading zero byte count */ #define rFEFE r6 /* constant 0xfefefeff (-0x01010101) */ #define r7F7F r7 /* constant 0x7f7f7f7f */ @@ -45,8 +37,6 @@ ENTRY (BP_SYM (strchr)) #define rMASK r11 /* mask with the bits to ignore set to 0 */ #define rTMP3 r12 - CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2) - STORE_RETURN_BOUNDS (rTMP1, rTMP2) rlwimi rCHR, rCHR, 8, 16, 23 li rMASK, -1 @@ -90,7 +80,6 @@ L(loopentry): L(missed): and. rTMP1, rTMP1, rTMP2 li rRTN, 0 - STORE_RETURN_VALUE (rSTR) beqlr /* It did happen. Decide which one was first... I'm not sure if this is actually faster than a sequence of @@ -108,8 +97,6 @@ L(missed): cntlzw rCLZB, rTMP2 srwi rCLZB, rCLZB, 3 add rRTN, rSTR, rCLZB - CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge) - STORE_RETURN_VALUE (rSTR) blr L(foundit): @@ -121,10 +108,8 @@ L(foundit): subi rSTR, rSTR, 4 srwi rCLZB, rCLZB, 3 add rRTN, rSTR, rCLZB - CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge) - STORE_RETURN_VALUE (rSTR) blr -END (BP_SYM (strchr)) +END (strchr) -weak_alias (BP_SYM (strchr), BP_SYM (index)) +weak_alias (strchr, index) libc_hidden_builtin_def (strchr) |