37 # define reg_char char
42 #if HAVE_BP_SYM_H || defined _LIBC
45 # define BP_SYM(sym) sym
54 # define __memchr memchr
66 typedef unsigned long int longword;
68 const unsigned char *char_ptr;
69 const longword *longword_ptr;
70 longword repeated_one;
74 c = (
unsigned char)
c_in;
78 for (char_ptr = (
const unsigned char *) s;
79 n > 0 && (
size_t) char_ptr %
sizeof (longword) != 0;
82 return (
void *) char_ptr;
84 longword_ptr = (
const longword *) char_ptr;
92 repeated_one = 0x01010101;
93 repeated_c = c | (c << 8);
94 repeated_c |= repeated_c << 16;
95 if (0xffffffffU < (longword) -1)
97 repeated_one |= repeated_one << 31 << 1;
98 repeated_c |= repeated_c << 31 << 1;
99 if (8 <
sizeof (longword))
103 for (i = 64; i <
sizeof (longword) * 8; i *= 2)
105 repeated_one |= repeated_one << i;
106 repeated_c |= repeated_c << i;
142 while (n >=
sizeof (longword))
144 longword longword1 = *longword_ptr ^ repeated_c;
146 if ((((longword1 - repeated_one) & ~longword1)
147 & (repeated_one << 7)) != 0)
150 n -=
sizeof (longword);
153 char_ptr = (
const unsigned char *) longword_ptr;
162 for (; n > 0; --n, ++char_ptr)
165 return (
void *) char_ptr;
#define reg_char
Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2014 Free Software Foundation,...