1 /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
4 Copyright (C) 1996, 1999, 2000, 2003 Free Software Foundation, Inc.
5 This file is part of the GNU C Library.
6 Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
7 David S. Miller <davem@caip.rutgers.edu>.
8 This version is developed using the same algorithm as the fast C
9 version which carries the following introduction:
10 Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
11 with help from Dan Sahlin (dan@sics.se) and
12 commentary by Jim Blandy (jimb@ai.mit.edu);
13 adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
14 and implemented by Roland McGrath (roland@ai.mit.edu).
16 The GNU C Library is free software; you can redistribute it and/or
17 modify it under the terms of the GNU Lesser General Public
18 License as published by the Free Software Foundation; either
19 version 2.1 of the License, or (at your option) any later version.
21 The GNU C Library is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 Lesser General Public License for more details.
26 You should have received a copy of the GNU Lesser General Public
27 License along with the GNU C Library; if not, write to the Free
28 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
45 sethi %hi(0x80808080), %o4
54 or %o4, %lo(0x80808080), %o3
63 sethi %hi(0x01010101), %o5
75 10: sethi %hi(0x80808080), %o4
76 or %o4, %lo(0x80808080), %o3
77 4: sethi %hi(0x01010101), %o5
79 7: andcc %o2, 0xfffffffc, %o2
81 or %o5, %lo(0x01010101), %g6
111 /* Check every byte. */
142 weak_alias (__memchr, memchr)
143 #if !__BOUNDED_POINTERS__
144 weak_alias (__memchr, __ubp_memchr)
146 libc_hidden_builtin_def (memchr)