1999-03-29 13:25:15 +00:00
|
|
|
/* Set a block of memory to some byte value.
|
|
|
|
For UltraSPARC.
|
Update.
* sysdeps/i386/fpu/ftestexcept.c: Also check SSE status word.
* include/signal.h: Use libc_hidden_proto for sigaddset and sigdelset.
* signal/sigaddset.c: Add libc_hidden_def.
* signal/sigdelset.c: Likewise.
2003-04-29 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/i486/string-inlines.c (__memcpy_g, __strchr_g): Move
to the end of the file.
* configure.in: Change __oline__ to $LINENO.
(HAVE_BUILTIN_REDIRECTION): New check.
* config.h.in (HAVE_BUILTIN_REDIRECTION): Add.
* include/libc-symbols.h (libc_hidden_builtin_proto,
libc_hidden_builtin_def, libc_hidden_builtin_weak,
libc_hidden_builtin_ver): Define.
* include/string.h (memchr, memcpy, memmove, memset, strcat, strchr,
strcmp, strcpy, strcspn, strlen, strncmp, strncpy, strpbrk, strrchr,
strspn, strstr): Add libc_hidden_builtin_proto.
* intl/plural.y: Include string.h.
* sysdeps/alpha/alphaev6/memchr.S (memchr): Add
libc_hidden_builtin_def.
* sysdeps/alpha/alphaev6/memcpy.S (memcpy): Likewise.
* sysdeps/alpha/alphaev6/memset.S (memset): Likewise.
* sysdeps/alpha/alphaev67/strcat.S (strcat): Likewise.
* sysdeps/alpha/alphaev67/strchr.S (strchr): Likewise.
* sysdeps/alpha/alphaev67/strlen.S (strlen): Likewise.
* sysdeps/alpha/alphaev67/strrchr.S (strrchr): Likewise.
* sysdeps/alpha/memchr.S (memchr): Likewise.
* sysdeps/alpha/memset.S (memset): Likewise.
* sysdeps/alpha/strcat.S (strcat): Likewise.
* sysdeps/alpha/strchr.S (strchr): Likewise.
* sysdeps/alpha/strcmp.S (strcmp): Likewise.
* sysdeps/alpha/strcpy.S (strcpy): Likewise.
* sysdeps/alpha/strlen.S (strlen): Likewise.
* sysdeps/alpha/strncmp.S (strncmp): Likewise.
* sysdeps/alpha/strncpy.S (strncpy): Likewise.
* sysdeps/alpha/strrchr.S (strrchr): Likewise.
* sysdeps/arm/memset.S (memset): Likewise.
* sysdeps/arm/strlen.S (strlen): Likewise.
* sysdeps/generic/memchr.c (memchr): Likewise.
* sysdeps/generic/memcpy.c (memcpy): Likewise.
* sysdeps/generic/memmove.c (memmove): Likewise.
* sysdeps/generic/memset.c (memset): Likewise.
* sysdeps/generic/strcat.c (strcat): Likewise.
* sysdeps/generic/strchr.c (strchr): Likewise.
* sysdeps/generic/strcmp.c (strcmp): Likewise.
* sysdeps/generic/strcpy.c (strcpy): Likewise.
* sysdeps/generic/strcspn.c (strcspn): Likewise.
* sysdeps/generic/strlen.c (strlen): Likewise.
* sysdeps/generic/strncmp.c (strncmp): Likewise.
* sysdeps/generic/strncpy.c (strncpy): Likewise.
* sysdeps/generic/strpbrk.c (strpbrk): Likewise.
* sysdeps/generic/strrchr.c (strrchr): Likewise.
* sysdeps/generic/strspn.c (strspn): Likewise.
* sysdeps/generic/strstr.c (strstr): Likewise.
* sysdeps/i386/i486/strcat.S (strcat): Likewise.
* sysdeps/i386/i486/strlen.S (strlen): Likewise.
* sysdeps/i386/i586/memcpy.S (memcpy): Likewise.
* sysdeps/i386/i586/memset.S (memset): Likewise.
* sysdeps/i386/i586/strchr.S (strchr): Likewise.
* sysdeps/i386/i586/strcpy.S (strcpy): Likewise.
* sysdeps/i386/i586/strlen.S (strlen): Likewise.
* sysdeps/i386/i686/memcpy.S (memcpy): Likewise.
* sysdeps/i386/i686/memmove.S (memmove): Likewise.
* sysdeps/i386/i686/memset.S (memset): Likewise.
* sysdeps/i386/i686/strcmp.S (strcmp): Likewise.
* sysdeps/i386/memchr.S (memchr): Likewise.
* sysdeps/i386/memset.c (memset): Likewise.
* sysdeps/i386/strchr.S (strchr): Likewise.
* sysdeps/i386/strcspn.S (strcspn): Likewise.
* sysdeps/i386/strlen.c (strlen): Likewise.
* sysdeps/i386/strpbrk.S (strpbrk): Likewise.
* sysdeps/i386/strrchr.S (strrchr): Likewise.
* sysdeps/i386/strspn.S (strspn): Likewise.
* sysdeps/ia64/memchr.S (memchr): Likewise.
* sysdeps/ia64/memcpy.S (memcpy): Likewise.
* sysdeps/ia64/memmove.S (memmove): Likewise.
* sysdeps/ia64/memset.S (memset): Likewise.
* sysdeps/ia64/strcat.S (strcat): Likewise.
* sysdeps/ia64/strchr.S (strchr): Likewise.
* sysdeps/ia64/strcmp.S (strcmp): Likewise.
* sysdeps/ia64/strcpy.S (strcpy): Likewise.
* sysdeps/ia64/strlen.S (strlen): Likewise.
* sysdeps/ia64/strncmp.S (strncmp): Likewise.
* sysdeps/ia64/strncpy.S (strncpy): Likewise.
* sysdeps/m68k/memchr.S (memchr): Likewise.
* sysdeps/m68k/strchr.S (strchr): Likewise.
* sysdeps/mips/mips64/memcpy.S (memcpy): Likewise.
* sysdeps/mips/mips64/memset.S (memset): Likewise.
* sysdeps/mips/memcpy.S (memcpy): Likewise.
* sysdeps/mips/memset.S (memset): Likewise.
* sysdeps/powerpc/powerpc32/memset.S (memset): Likewise.
* sysdeps/powerpc/powerpc32/strchr.S (strchr): Likewise.
* sysdeps/powerpc/powerpc32/strcmp.S (strcmp): Likewise.
* sysdeps/powerpc/powerpc32/strcpy.S (strcpy): Likewise.
* sysdeps/powerpc/powerpc32/strlen.S (strlen): Likewise.
* sysdeps/powerpc/powerpc64/memcpy.S (memcpy): Likewise.
* sysdeps/powerpc/powerpc64/memset.S (memset): Likewise.
* sysdeps/powerpc/powerpc64/strchr.S (strchr): Likewise.
* sysdeps/powerpc/powerpc64/strcmp.S (strcmp): Likewise.
* sysdeps/powerpc/powerpc64/strcpy.S (strcpy): Likewise.
* sysdeps/powerpc/powerpc64/strlen.S (strlen): Likewise.
* sysdeps/powerpc/strcat.c (strcat): Likewise.
* sysdeps/sparc/sparc32/memchr.S (memchr): Likewise.
* sysdeps/sparc/sparc32/memcpy.S (memcpy): Likewise.
* sysdeps/sparc/sparc32/memset.S (memset): Likewise.
* sysdeps/sparc/sparc32/strcat.S (strcat): Likewise.
* sysdeps/sparc/sparc32/strchr.S (strchr, strrchr): Likewise.
* sysdeps/sparc/sparc32/strcmp.S (strcmp): Likewise.
* sysdeps/sparc/sparc32/strcpy.S (strcpy): Likewise.
* sysdeps/sparc/sparc32/strlen.S (strlen): Likewise.
* sysdeps/sparc/sparc64/sparcv9b/memcpy.S (memcpy, memmove): Likewise.
* sysdeps/sparc/sparc64/memchr.S (memchr): Likewise.
* sysdeps/sparc/sparc64/memcpy.S (memcpy, memmove): Likewise.
* sysdeps/sparc/sparc64/memset.S (memset): Likewise.
* sysdeps/sparc/sparc64/strcat.S (strcat): Likewise.
* sysdeps/sparc/sparc64/strchr.S (strchr, strrchr): Likewise.
* sysdeps/sparc/sparc64/strcmp.S (strcmp): Likewise.
* sysdeps/sparc/sparc64/strcpy.S (strcpy): Likewise.
* sysdeps/sparc/sparc64/strcspn.S (strcspn): Likewise.
* sysdeps/sparc/sparc64/strlen.S (strlen): Likewise.
* sysdeps/sparc/sparc64/strncmp.S (strncmp): Likewise.
* sysdeps/sparc/sparc64/strncpy.S (strncpy): Likewise.
* sysdeps/sparc/sparc64/strpbrk.S (strpbrk): Likewise.
* sysdeps/sparc/sparc64/strspn.S (strspn): Likewise.
* sysdeps/sh/memcpy.S (memcpy): Likewise.
* sysdeps/sh/memset.S (memset): Likewise.
* sysdeps/sh/strlen.S (strlen): Likewise.
* sysdeps/s390/s390-32/memchr.S (memchr): Likewise.
* sysdeps/s390/s390-32/memcpy.S (memcpy): Likewise.
* sysdeps/s390/s390-32/memset.S (memset): Likewise.
* sysdeps/s390/s390-32/strcmp.S (strcmp): Likewise.
* sysdeps/s390/s390-32/strcpy.S (strcpy): Likewise.
* sysdeps/s390/s390-32/strncpy.S (strncpy): Likewise.
* sysdeps/s390/s390-64/memchr.S (memchr): Likewise.
* sysdeps/s390/s390-64/memcpy.S (memcpy): Likewise.
* sysdeps/s390/s390-64/memset.S (memset): Likewise.
* sysdeps/s390/s390-64/strcmp.S (strcmp): Likewise.
* sysdeps/s390/s390-64/strcpy.S (strcpy): Likewise.
* sysdeps/s390/s390-64/strncpy.S (strncpy): Likewise.
* sysdeps/x86_64/memcpy.S (memcpy): Likewise.
* sysdeps/x86_64/memset.S (memset): Likewise.
* sysdeps/x86_64/strcat.S (strcat): Likewise.
* sysdeps/x86_64/strchr.S (strchr): Likewise.
* sysdeps/x86_64/strcmp.S (strcmp): Likewise.
* sysdeps/x86_64/strcpy.S (strcpy): Likewise.
* sysdeps/x86_64/strcspn.S (strcspn): Likewise.
* sysdeps/x86_64/strlen.S (strlen): Likewise.
* sysdeps/x86_64/strspn.S (strspn): Likewise.
* string/string-inlines.c: Move...
* sysdeps/generic/string-inlines.c: ...here.
(__memcpy_g, __strchr_g): Remove.
(__NO_INLINE__): Define before including <string.h>,
undefine after. Include bits/string.h and bits/string2.h.
* sysdeps/i386/i486/string-inlines.c: New file.
* sysdeps/i386/string-inlines.c: New file.
* sysdeps/i386/i486/Versions: Remove.
All GLIBC_2.1.1 symbols moved...
* sysdeps/i386/Versions (libc): ...here.
2003-04-29 Ulrich Drepper <drepper@redhat.com>
2003-04-29 22:49:58 +00:00
|
|
|
Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
|
1999-03-29 13:25:15 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
Contributed by David S. Miller (davem@caip.rutgers.edu) and
|
|
|
|
Jakub Jelinek (jj@ultra.linux.cz).
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1999-03-29 13:25:15 +00:00
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1999-03-29 13:25:15 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1999-03-29 13:25:15 +00:00
|
|
|
|
|
|
|
#include <sysdep.h>
|
|
|
|
#include <asm/asi.h>
|
|
|
|
#ifndef XCC
|
|
|
|
#define XCC xcc
|
|
|
|
#define USE_BPR
|
|
|
|
#endif
|
|
|
|
#define FPRS_FEF 4
|
|
|
|
|
|
|
|
#define SET_BLOCKS(base, offset, source) \
|
|
|
|
stx source, [base - offset - 0x18]; \
|
|
|
|
stx source, [base - offset - 0x10]; \
|
|
|
|
stx source, [base - offset - 0x08]; \
|
|
|
|
stx source, [base - offset - 0x00];
|
|
|
|
|
|
|
|
/* Well, memset is a lot easier to get right than bcopy... */
|
|
|
|
.text
|
|
|
|
.align 32
|
|
|
|
ENTRY(memset)
|
1999-05-18 10:00:20 +00:00
|
|
|
andcc %o1, 0xff, %o1
|
1999-07-27 04:43:32 +00:00
|
|
|
mov %o0, %o5
|
1999-05-18 10:00:20 +00:00
|
|
|
be,a,pt %icc, 50f
|
1999-03-29 13:25:15 +00:00
|
|
|
#ifndef USE_BPR
|
|
|
|
srl %o2, 0, %o1
|
|
|
|
#else
|
|
|
|
mov %o2, %o1
|
|
|
|
#endif
|
|
|
|
cmp %o2, 7
|
|
|
|
#ifndef USE_BPR
|
|
|
|
srl %o2, 0, %o2
|
|
|
|
#endif
|
|
|
|
bleu,pn %XCC, 17f
|
|
|
|
andcc %o0, 3, %g5
|
|
|
|
be,pt %xcc, 4f
|
|
|
|
and %o1, 0xff, %o1
|
|
|
|
cmp %g5, 3
|
|
|
|
be,pn %xcc, 2f
|
|
|
|
stb %o1, [%o0 + 0x00]
|
|
|
|
cmp %g5, 2
|
|
|
|
be,pt %xcc, 2f
|
|
|
|
stb %o1, [%o0 + 0x01]
|
|
|
|
stb %o1, [%o0 + 0x02]
|
|
|
|
2: sub %g5, 4, %g5
|
|
|
|
sub %o0, %g5, %o0
|
|
|
|
add %o2, %g5, %o2
|
|
|
|
4: sllx %o1, 8, %g1
|
|
|
|
andcc %o0, 4, %g0
|
|
|
|
or %o1, %g1, %o1
|
|
|
|
sllx %o1, 16, %g1
|
|
|
|
or %o1, %g1, %o1
|
|
|
|
be,pt %xcc, 2f
|
|
|
|
sllx %o1, 32, %g1
|
|
|
|
stw %o1, [%o0]
|
|
|
|
sub %o2, 4, %o2
|
|
|
|
add %o0, 4, %o0
|
|
|
|
2: cmp %o2, 128
|
|
|
|
or %o1, %g1, %o1
|
|
|
|
blu,pn %xcc, 9f
|
|
|
|
andcc %o0, 0x38, %g5
|
|
|
|
be,pn %icc, 6f
|
1999-07-27 04:43:32 +00:00
|
|
|
mov 64, %o4
|
1999-03-29 13:25:15 +00:00
|
|
|
andcc %o0, 8, %g0
|
|
|
|
be,pn %icc, 1f
|
1999-07-27 04:43:32 +00:00
|
|
|
sub %o4, %g5, %o4
|
1999-03-29 13:25:15 +00:00
|
|
|
stx %o1, [%o0]
|
|
|
|
add %o0, 8, %o0
|
1999-07-27 04:43:32 +00:00
|
|
|
1: andcc %o4, 16, %g0
|
1999-03-29 13:25:15 +00:00
|
|
|
be,pn %icc, 1f
|
1999-07-27 04:43:32 +00:00
|
|
|
sub %o2, %o4, %o2
|
1999-03-29 13:25:15 +00:00
|
|
|
stx %o1, [%o0]
|
|
|
|
stx %o1, [%o0 + 8]
|
|
|
|
add %o0, 16, %o0
|
1999-07-27 04:43:32 +00:00
|
|
|
1: andcc %o4, 32, %g0
|
1999-03-29 13:25:15 +00:00
|
|
|
be,pn %icc, 7f
|
|
|
|
andncc %o2, 0x3f, %o3
|
|
|
|
stw %o1, [%o0]
|
|
|
|
stw %o1, [%o0 + 4]
|
|
|
|
stw %o1, [%o0 + 8]
|
|
|
|
stw %o1, [%o0 + 12]
|
|
|
|
stw %o1, [%o0 + 16]
|
|
|
|
stw %o1, [%o0 + 20]
|
|
|
|
stw %o1, [%o0 + 24]
|
|
|
|
stw %o1, [%o0 + 28]
|
|
|
|
add %o0, 32, %o0
|
|
|
|
7: be,pn %xcc, 9f
|
|
|
|
nop
|
|
|
|
ldd [%o0 - 8], %f0
|
|
|
|
18: wr %g0, ASI_BLK_P, %asi
|
|
|
|
membar #StoreStore | #LoadStore
|
|
|
|
andcc %o3, 0xc0, %g5
|
|
|
|
and %o2, 0x3f, %o2
|
2012-05-31 21:19:30 +00:00
|
|
|
fsrc2 %f0, %f2
|
|
|
|
fsrc2 %f0, %f4
|
1999-03-29 13:25:15 +00:00
|
|
|
andn %o3, 0xff, %o3
|
2012-05-31 21:19:30 +00:00
|
|
|
fsrc2 %f0, %f6
|
1999-03-29 13:25:15 +00:00
|
|
|
cmp %g5, 64
|
2012-05-31 21:19:30 +00:00
|
|
|
fsrc2 %f0, %f8
|
|
|
|
fsrc2 %f0, %f10
|
|
|
|
fsrc2 %f0, %f12
|
1999-03-29 13:25:15 +00:00
|
|
|
brz,pn %g5, 10f
|
2012-05-31 21:19:30 +00:00
|
|
|
fsrc2 %f0, %f14
|
1999-03-29 13:25:15 +00:00
|
|
|
be,pn %icc, 2f
|
|
|
|
stda %f0, [%o0 + 0x00] %asi
|
|
|
|
cmp %g5, 128
|
|
|
|
be,pn %icc, 2f
|
|
|
|
stda %f0, [%o0 + 0x40] %asi
|
|
|
|
stda %f0, [%o0 + 0x80] %asi
|
|
|
|
2: brz,pn %o3, 12f
|
|
|
|
add %o0, %g5, %o0
|
|
|
|
10: stda %f0, [%o0 + 0x00] %asi
|
|
|
|
stda %f0, [%o0 + 0x40] %asi
|
|
|
|
stda %f0, [%o0 + 0x80] %asi
|
|
|
|
stda %f0, [%o0 + 0xc0] %asi
|
|
|
|
11: subcc %o3, 256, %o3
|
|
|
|
bne,pt %xcc, 10b
|
|
|
|
add %o0, 256, %o0
|
|
|
|
12: wr %g0, FPRS_FEF, %fprs
|
|
|
|
membar #StoreLoad | #StoreStore
|
|
|
|
9: andcc %o2, 0x78, %g5
|
|
|
|
be,pn %xcc, 13f
|
|
|
|
andcc %o2, 7, %o2
|
|
|
|
14: rd %pc, %o4
|
|
|
|
srl %g5, 1, %o3
|
|
|
|
sub %o4, %o3, %o4
|
|
|
|
jmpl %o4 + (13f - 14b), %g0
|
|
|
|
add %o0, %g5, %o0
|
|
|
|
12: SET_BLOCKS (%o0, 0x68, %o1)
|
|
|
|
SET_BLOCKS (%o0, 0x48, %o1)
|
|
|
|
SET_BLOCKS (%o0, 0x28, %o1)
|
|
|
|
SET_BLOCKS (%o0, 0x08, %o1)
|
|
|
|
13: be,pn %xcc, 8f
|
|
|
|
andcc %o2, 4, %g0
|
|
|
|
be,pn %xcc, 1f
|
|
|
|
andcc %o2, 2, %g0
|
|
|
|
stw %o1, [%o0]
|
|
|
|
add %o0, 4, %o0
|
|
|
|
1: be,pn %xcc, 1f
|
|
|
|
andcc %o2, 1, %g0
|
|
|
|
sth %o1, [%o0]
|
|
|
|
add %o0, 2, %o0
|
|
|
|
1: bne,a,pn %xcc, 8f
|
|
|
|
stb %o1, [%o0]
|
|
|
|
8: retl
|
1999-07-27 04:43:32 +00:00
|
|
|
mov %o5, %o0
|
1999-03-29 13:25:15 +00:00
|
|
|
17: brz,pn %o2, 0f
|
|
|
|
8: add %o0, 1, %o0
|
|
|
|
subcc %o2, 1, %o2
|
|
|
|
bne,pt %xcc, 8b
|
|
|
|
stb %o1, [%o0 - 1]
|
|
|
|
0: retl
|
1999-07-27 04:43:32 +00:00
|
|
|
mov %o5, %o0
|
1999-03-29 13:25:15 +00:00
|
|
|
|
|
|
|
6: stx %o1, [%o0]
|
|
|
|
andncc %o2, 0x3f, %o3
|
|
|
|
be,pn %xcc, 9b
|
|
|
|
nop
|
|
|
|
ba,pt %xcc, 18b
|
|
|
|
ldd [%o0], %f0
|
|
|
|
END(memset)
|
Update.
* sysdeps/i386/fpu/ftestexcept.c: Also check SSE status word.
* include/signal.h: Use libc_hidden_proto for sigaddset and sigdelset.
* signal/sigaddset.c: Add libc_hidden_def.
* signal/sigdelset.c: Likewise.
2003-04-29 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/i486/string-inlines.c (__memcpy_g, __strchr_g): Move
to the end of the file.
* configure.in: Change __oline__ to $LINENO.
(HAVE_BUILTIN_REDIRECTION): New check.
* config.h.in (HAVE_BUILTIN_REDIRECTION): Add.
* include/libc-symbols.h (libc_hidden_builtin_proto,
libc_hidden_builtin_def, libc_hidden_builtin_weak,
libc_hidden_builtin_ver): Define.
* include/string.h (memchr, memcpy, memmove, memset, strcat, strchr,
strcmp, strcpy, strcspn, strlen, strncmp, strncpy, strpbrk, strrchr,
strspn, strstr): Add libc_hidden_builtin_proto.
* intl/plural.y: Include string.h.
* sysdeps/alpha/alphaev6/memchr.S (memchr): Add
libc_hidden_builtin_def.
* sysdeps/alpha/alphaev6/memcpy.S (memcpy): Likewise.
* sysdeps/alpha/alphaev6/memset.S (memset): Likewise.
* sysdeps/alpha/alphaev67/strcat.S (strcat): Likewise.
* sysdeps/alpha/alphaev67/strchr.S (strchr): Likewise.
* sysdeps/alpha/alphaev67/strlen.S (strlen): Likewise.
* sysdeps/alpha/alphaev67/strrchr.S (strrchr): Likewise.
* sysdeps/alpha/memchr.S (memchr): Likewise.
* sysdeps/alpha/memset.S (memset): Likewise.
* sysdeps/alpha/strcat.S (strcat): Likewise.
* sysdeps/alpha/strchr.S (strchr): Likewise.
* sysdeps/alpha/strcmp.S (strcmp): Likewise.
* sysdeps/alpha/strcpy.S (strcpy): Likewise.
* sysdeps/alpha/strlen.S (strlen): Likewise.
* sysdeps/alpha/strncmp.S (strncmp): Likewise.
* sysdeps/alpha/strncpy.S (strncpy): Likewise.
* sysdeps/alpha/strrchr.S (strrchr): Likewise.
* sysdeps/arm/memset.S (memset): Likewise.
* sysdeps/arm/strlen.S (strlen): Likewise.
* sysdeps/generic/memchr.c (memchr): Likewise.
* sysdeps/generic/memcpy.c (memcpy): Likewise.
* sysdeps/generic/memmove.c (memmove): Likewise.
* sysdeps/generic/memset.c (memset): Likewise.
* sysdeps/generic/strcat.c (strcat): Likewise.
* sysdeps/generic/strchr.c (strchr): Likewise.
* sysdeps/generic/strcmp.c (strcmp): Likewise.
* sysdeps/generic/strcpy.c (strcpy): Likewise.
* sysdeps/generic/strcspn.c (strcspn): Likewise.
* sysdeps/generic/strlen.c (strlen): Likewise.
* sysdeps/generic/strncmp.c (strncmp): Likewise.
* sysdeps/generic/strncpy.c (strncpy): Likewise.
* sysdeps/generic/strpbrk.c (strpbrk): Likewise.
* sysdeps/generic/strrchr.c (strrchr): Likewise.
* sysdeps/generic/strspn.c (strspn): Likewise.
* sysdeps/generic/strstr.c (strstr): Likewise.
* sysdeps/i386/i486/strcat.S (strcat): Likewise.
* sysdeps/i386/i486/strlen.S (strlen): Likewise.
* sysdeps/i386/i586/memcpy.S (memcpy): Likewise.
* sysdeps/i386/i586/memset.S (memset): Likewise.
* sysdeps/i386/i586/strchr.S (strchr): Likewise.
* sysdeps/i386/i586/strcpy.S (strcpy): Likewise.
* sysdeps/i386/i586/strlen.S (strlen): Likewise.
* sysdeps/i386/i686/memcpy.S (memcpy): Likewise.
* sysdeps/i386/i686/memmove.S (memmove): Likewise.
* sysdeps/i386/i686/memset.S (memset): Likewise.
* sysdeps/i386/i686/strcmp.S (strcmp): Likewise.
* sysdeps/i386/memchr.S (memchr): Likewise.
* sysdeps/i386/memset.c (memset): Likewise.
* sysdeps/i386/strchr.S (strchr): Likewise.
* sysdeps/i386/strcspn.S (strcspn): Likewise.
* sysdeps/i386/strlen.c (strlen): Likewise.
* sysdeps/i386/strpbrk.S (strpbrk): Likewise.
* sysdeps/i386/strrchr.S (strrchr): Likewise.
* sysdeps/i386/strspn.S (strspn): Likewise.
* sysdeps/ia64/memchr.S (memchr): Likewise.
* sysdeps/ia64/memcpy.S (memcpy): Likewise.
* sysdeps/ia64/memmove.S (memmove): Likewise.
* sysdeps/ia64/memset.S (memset): Likewise.
* sysdeps/ia64/strcat.S (strcat): Likewise.
* sysdeps/ia64/strchr.S (strchr): Likewise.
* sysdeps/ia64/strcmp.S (strcmp): Likewise.
* sysdeps/ia64/strcpy.S (strcpy): Likewise.
* sysdeps/ia64/strlen.S (strlen): Likewise.
* sysdeps/ia64/strncmp.S (strncmp): Likewise.
* sysdeps/ia64/strncpy.S (strncpy): Likewise.
* sysdeps/m68k/memchr.S (memchr): Likewise.
* sysdeps/m68k/strchr.S (strchr): Likewise.
* sysdeps/mips/mips64/memcpy.S (memcpy): Likewise.
* sysdeps/mips/mips64/memset.S (memset): Likewise.
* sysdeps/mips/memcpy.S (memcpy): Likewise.
* sysdeps/mips/memset.S (memset): Likewise.
* sysdeps/powerpc/powerpc32/memset.S (memset): Likewise.
* sysdeps/powerpc/powerpc32/strchr.S (strchr): Likewise.
* sysdeps/powerpc/powerpc32/strcmp.S (strcmp): Likewise.
* sysdeps/powerpc/powerpc32/strcpy.S (strcpy): Likewise.
* sysdeps/powerpc/powerpc32/strlen.S (strlen): Likewise.
* sysdeps/powerpc/powerpc64/memcpy.S (memcpy): Likewise.
* sysdeps/powerpc/powerpc64/memset.S (memset): Likewise.
* sysdeps/powerpc/powerpc64/strchr.S (strchr): Likewise.
* sysdeps/powerpc/powerpc64/strcmp.S (strcmp): Likewise.
* sysdeps/powerpc/powerpc64/strcpy.S (strcpy): Likewise.
* sysdeps/powerpc/powerpc64/strlen.S (strlen): Likewise.
* sysdeps/powerpc/strcat.c (strcat): Likewise.
* sysdeps/sparc/sparc32/memchr.S (memchr): Likewise.
* sysdeps/sparc/sparc32/memcpy.S (memcpy): Likewise.
* sysdeps/sparc/sparc32/memset.S (memset): Likewise.
* sysdeps/sparc/sparc32/strcat.S (strcat): Likewise.
* sysdeps/sparc/sparc32/strchr.S (strchr, strrchr): Likewise.
* sysdeps/sparc/sparc32/strcmp.S (strcmp): Likewise.
* sysdeps/sparc/sparc32/strcpy.S (strcpy): Likewise.
* sysdeps/sparc/sparc32/strlen.S (strlen): Likewise.
* sysdeps/sparc/sparc64/sparcv9b/memcpy.S (memcpy, memmove): Likewise.
* sysdeps/sparc/sparc64/memchr.S (memchr): Likewise.
* sysdeps/sparc/sparc64/memcpy.S (memcpy, memmove): Likewise.
* sysdeps/sparc/sparc64/memset.S (memset): Likewise.
* sysdeps/sparc/sparc64/strcat.S (strcat): Likewise.
* sysdeps/sparc/sparc64/strchr.S (strchr, strrchr): Likewise.
* sysdeps/sparc/sparc64/strcmp.S (strcmp): Likewise.
* sysdeps/sparc/sparc64/strcpy.S (strcpy): Likewise.
* sysdeps/sparc/sparc64/strcspn.S (strcspn): Likewise.
* sysdeps/sparc/sparc64/strlen.S (strlen): Likewise.
* sysdeps/sparc/sparc64/strncmp.S (strncmp): Likewise.
* sysdeps/sparc/sparc64/strncpy.S (strncpy): Likewise.
* sysdeps/sparc/sparc64/strpbrk.S (strpbrk): Likewise.
* sysdeps/sparc/sparc64/strspn.S (strspn): Likewise.
* sysdeps/sh/memcpy.S (memcpy): Likewise.
* sysdeps/sh/memset.S (memset): Likewise.
* sysdeps/sh/strlen.S (strlen): Likewise.
* sysdeps/s390/s390-32/memchr.S (memchr): Likewise.
* sysdeps/s390/s390-32/memcpy.S (memcpy): Likewise.
* sysdeps/s390/s390-32/memset.S (memset): Likewise.
* sysdeps/s390/s390-32/strcmp.S (strcmp): Likewise.
* sysdeps/s390/s390-32/strcpy.S (strcpy): Likewise.
* sysdeps/s390/s390-32/strncpy.S (strncpy): Likewise.
* sysdeps/s390/s390-64/memchr.S (memchr): Likewise.
* sysdeps/s390/s390-64/memcpy.S (memcpy): Likewise.
* sysdeps/s390/s390-64/memset.S (memset): Likewise.
* sysdeps/s390/s390-64/strcmp.S (strcmp): Likewise.
* sysdeps/s390/s390-64/strcpy.S (strcpy): Likewise.
* sysdeps/s390/s390-64/strncpy.S (strncpy): Likewise.
* sysdeps/x86_64/memcpy.S (memcpy): Likewise.
* sysdeps/x86_64/memset.S (memset): Likewise.
* sysdeps/x86_64/strcat.S (strcat): Likewise.
* sysdeps/x86_64/strchr.S (strchr): Likewise.
* sysdeps/x86_64/strcmp.S (strcmp): Likewise.
* sysdeps/x86_64/strcpy.S (strcpy): Likewise.
* sysdeps/x86_64/strcspn.S (strcspn): Likewise.
* sysdeps/x86_64/strlen.S (strlen): Likewise.
* sysdeps/x86_64/strspn.S (strspn): Likewise.
* string/string-inlines.c: Move...
* sysdeps/generic/string-inlines.c: ...here.
(__memcpy_g, __strchr_g): Remove.
(__NO_INLINE__): Define before including <string.h>,
undefine after. Include bits/string.h and bits/string2.h.
* sysdeps/i386/i486/string-inlines.c: New file.
* sysdeps/i386/string-inlines.c: New file.
* sysdeps/i386/i486/Versions: Remove.
All GLIBC_2.1.1 symbols moved...
* sysdeps/i386/Versions (libc): ...here.
2003-04-29 Ulrich Drepper <drepper@redhat.com>
2003-04-29 22:49:58 +00:00
|
|
|
libc_hidden_builtin_def (memset)
|
1999-03-29 13:25:15 +00:00
|
|
|
|
|
|
|
#define ZERO_BLOCKS(base, offset, source) \
|
|
|
|
stx source, [base - offset - 0x38]; \
|
|
|
|
stx source, [base - offset - 0x30]; \
|
|
|
|
stx source, [base - offset - 0x28]; \
|
|
|
|
stx source, [base - offset - 0x20]; \
|
|
|
|
stx source, [base - offset - 0x18]; \
|
|
|
|
stx source, [base - offset - 0x10]; \
|
|
|
|
stx source, [base - offset - 0x08]; \
|
|
|
|
stx source, [base - offset - 0x00];
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 32
|
|
|
|
ENTRY(__bzero)
|
|
|
|
#ifndef USE_BPR
|
|
|
|
srl %o1, 0, %o1
|
|
|
|
#endif
|
1999-07-27 04:43:32 +00:00
|
|
|
mov %o0, %o5
|
1999-03-29 13:25:15 +00:00
|
|
|
50: cmp %o1, 7
|
|
|
|
bleu,pn %xcc, 17f
|
|
|
|
andcc %o0, 3, %o2
|
|
|
|
be,a,pt %xcc, 4f
|
|
|
|
andcc %o0, 4, %g0
|
|
|
|
cmp %o2, 3
|
|
|
|
be,pn %xcc, 2f
|
|
|
|
stb %g0, [%o0 + 0x00]
|
|
|
|
cmp %o2, 2
|
|
|
|
be,pt %xcc, 2f
|
|
|
|
stb %g0, [%o0 + 0x01]
|
|
|
|
stb %g0, [%o0 + 0x02]
|
|
|
|
2: sub %o2, 4, %o2
|
|
|
|
sub %o0, %o2, %o0
|
|
|
|
add %o1, %o2, %o1
|
|
|
|
andcc %o0, 4, %g0
|
|
|
|
4: be,pt %xcc, 2f
|
|
|
|
cmp %o1, 128
|
|
|
|
stw %g0, [%o0]
|
|
|
|
sub %o1, 4, %o1
|
|
|
|
add %o0, 4, %o0
|
|
|
|
2: blu,pn %xcc, 9f
|
|
|
|
andcc %o0, 0x38, %o2
|
|
|
|
be,pn %icc, 6f
|
1999-07-27 04:43:32 +00:00
|
|
|
mov 64, %o4
|
1999-03-29 13:25:15 +00:00
|
|
|
andcc %o0, 8, %g0
|
|
|
|
be,pn %icc, 1f
|
1999-07-27 04:43:32 +00:00
|
|
|
sub %o4, %o2, %o4
|
1999-03-29 13:25:15 +00:00
|
|
|
stx %g0, [%o0]
|
|
|
|
add %o0, 8, %o0
|
1999-07-27 04:43:32 +00:00
|
|
|
1: andcc %o4, 16, %g0
|
1999-03-29 13:25:15 +00:00
|
|
|
be,pn %icc, 1f
|
1999-07-27 04:43:32 +00:00
|
|
|
sub %o1, %o4, %o1
|
1999-03-29 13:25:15 +00:00
|
|
|
stx %g0, [%o0]
|
|
|
|
stx %g0, [%o0 + 8]
|
|
|
|
add %o0, 16, %o0
|
1999-07-27 04:43:32 +00:00
|
|
|
1: andcc %o4, 32, %g0
|
1999-03-29 13:25:15 +00:00
|
|
|
be,pn %icc, 7f
|
|
|
|
andncc %o1, 0x3f, %o3
|
|
|
|
stx %g0, [%o0]
|
|
|
|
stx %g0, [%o0 + 8]
|
|
|
|
stx %g0, [%o0 + 16]
|
|
|
|
stx %g0, [%o0 + 24]
|
|
|
|
add %o0, 32, %o0
|
|
|
|
6: andncc %o1, 0x3f, %o3
|
|
|
|
7: be,pn %xcc, 9f
|
|
|
|
wr %g0, ASI_BLK_P, %asi
|
|
|
|
membar #StoreLoad | #StoreStore | #LoadStore
|
|
|
|
fzero %f0
|
|
|
|
andcc %o3, 0xc0, %o2
|
|
|
|
and %o1, 0x3f, %o1
|
|
|
|
fzero %f2
|
|
|
|
andn %o3, 0xff, %o3
|
|
|
|
faddd %f0, %f2, %f4
|
|
|
|
fmuld %f0, %f2, %f6
|
|
|
|
cmp %o2, 64
|
|
|
|
faddd %f0, %f2, %f8
|
|
|
|
fmuld %f0, %f2, %f10
|
|
|
|
faddd %f0, %f2, %f12
|
|
|
|
brz,pn %o2, 10f
|
|
|
|
fmuld %f0, %f2, %f14
|
|
|
|
be,pn %icc, 2f
|
|
|
|
stda %f0, [%o0 + 0x00] %asi
|
|
|
|
cmp %o2, 128
|
|
|
|
be,pn %icc, 2f
|
|
|
|
stda %f0, [%o0 + 0x40] %asi
|
|
|
|
stda %f0, [%o0 + 0x80] %asi
|
|
|
|
2: brz,pn %o3, 12f
|
|
|
|
add %o0, %o2, %o0
|
|
|
|
10: stda %f0, [%o0 + 0x00] %asi
|
|
|
|
stda %f0, [%o0 + 0x40] %asi
|
|
|
|
stda %f0, [%o0 + 0x80] %asi
|
|
|
|
stda %f0, [%o0 + 0xc0] %asi
|
|
|
|
11: subcc %o3, 256, %o3
|
|
|
|
bne,pt %xcc, 10b
|
|
|
|
add %o0, 256, %o0
|
|
|
|
12: wr %g0, FPRS_FEF, %fprs
|
|
|
|
membar #StoreLoad | #StoreStore
|
|
|
|
9: andcc %o1, 0xf8, %o2
|
|
|
|
be,pn %xcc, 13f
|
|
|
|
andcc %o1, 7, %o1
|
|
|
|
14: rd %pc, %o4
|
|
|
|
srl %o2, 1, %o3
|
|
|
|
sub %o4, %o3, %o4
|
|
|
|
jmpl %o4 + (13f - 14b), %g0
|
|
|
|
add %o0, %o2, %o0
|
|
|
|
12: ZERO_BLOCKS (%o0, 0xc8, %g0)
|
|
|
|
ZERO_BLOCKS (%o0, 0x88, %g0)
|
|
|
|
ZERO_BLOCKS (%o0, 0x48, %g0)
|
|
|
|
ZERO_BLOCKS (%o0, 0x08, %g0)
|
|
|
|
13: be,pn %xcc, 8f
|
|
|
|
andcc %o1, 4, %g0
|
|
|
|
be,pn %xcc, 1f
|
|
|
|
andcc %o1, 2, %g0
|
|
|
|
stw %g0, [%o0]
|
|
|
|
add %o0, 4, %o0
|
|
|
|
1: be,pn %xcc, 1f
|
|
|
|
andcc %o1, 1, %g0
|
|
|
|
sth %g0, [%o0]
|
|
|
|
add %o0, 2, %o0
|
|
|
|
1: bne,a,pn %xcc, 8f
|
|
|
|
stb %g0, [%o0]
|
|
|
|
8: retl
|
1999-07-27 04:43:32 +00:00
|
|
|
mov %o5, %o0
|
1999-03-29 13:25:15 +00:00
|
|
|
17: be,pn %xcc, 13b
|
|
|
|
orcc %o1, 0, %g0
|
|
|
|
be,pn %xcc, 0f
|
|
|
|
8: add %o0, 1, %o0
|
|
|
|
subcc %o1, 1, %o1
|
|
|
|
bne,pt %xcc, 8b
|
|
|
|
stb %g0, [%o0 - 1]
|
|
|
|
0: retl
|
1999-07-27 04:43:32 +00:00
|
|
|
mov %o5, %o0
|
1999-03-29 13:25:15 +00:00
|
|
|
END(__bzero)
|
|
|
|
|
2005-05-26 14:30:51 +00:00
|
|
|
weak_alias (__bzero, bzero)
|