1 /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
4 Copyright (C) 1996-2015 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, see
28 <http://www.gnu.org/licenses/>. */
44 sethi %hi(0x80808080), %o4
53 or %o4, %lo(0x80808080), %o3
62 sethi %hi(0x01010101), %o5
74 10: sethi %hi(0x80808080), %o4
75 or %o4, %lo(0x80808080), %o3
76 4: sethi %hi(0x01010101), %o5
78 7: andcc %o2, 0xfffffffc, %o2
80 or %o5, %lo(0x01010101), %g6
110 /* Check every byte. */
141 weak_alias (__memchr, memchr)
142 libc_hidden_builtin_def (memchr)