glibc/sysdeps/sparc/sparc64/stpncpy.S
Ulrich Drepper 37ba7d6663 Update.
2002-08-02  Ulrich Drepper  <drepper@redhat.com>

	* configure.in (HAVE_BROKEN_ALIAS_ATTRIBUTE): Add check for
	broken alias attribute handling.
	* config.h.in (HAVE_BROKEN_ALIAS_ATTRIBUTE): Add.

	* assert/assert.c (__assert_fail): Fix typo in comment.

	* include/rpc/rpc.h: Declare __libc_tsd_RPC_VARS if USE_TLS &&
	HAVE___THREAD.
	* sunrpc/rpc_thread.c: Don't define __libc_tsd_RPC_VARS as static
	if USE_TLS && HAVE___THREAD.
	* sunrpc/Versions [libc] (GLIBC_PRIVATE): Export __libc_tsd_RPC_VARS.

2002-08-02  Jakub Jelinek  <jakub@redhat.com>

	* assert/assert.c (__assert_fail): Remove undef.
	Replace INTDEF with libc_hidden_def.
	* assert/__assert.c (__assert): Remove INTUSE.
	* elf/dl-minimal.c (__assert_fail): Replace INTDEF with
	libc_hidden_weak.
	* include/libc-symbols.h (hidden_proto, hidden_def, hidden_weak,
	hidden_ver, libc_hidden_proto, libc_hidden_def, libc_hidden_weak,
	libc_hidden_ver, rtld_hidden_proto, rtld_hidden_def, rtld_hidden_weak,
	rltd_hidden_ver, libm_hidden_proto, libm_hidden_def, libm_hidden_weak,
	libm_hiden_ver): Define.
	* include/assert.h (__assert_fail_internal): Remove.
	(__assert_fail): Add prototype.  Add hidden_proto.
	* include/libc-internal.h (__libc_freeres, __profile_frequency): Add
	libc_hidden_proto.
	* include/wchar.h (__mbrtowc_internal, __mbrlen_internal): Remove.
	(__mbrtowc, __mbrlen): Use libc_hidden_proto.  Remove macros.
	* include/string.h (__mempcpy, __stpncpy, __rawmemchr, __strcasecmp):
	Add libc_hidden_proto.
	* include/fcntl.h (__open64, __libc_open, __libc_fcntl, __open,
	__fcntl): Add libc_hidden_proto.  Remove macros.
	(__open_internal, __fcntl_internal): Remove.
	* libio/iofdopen.c (_IO_fcntl): Remove INTUSE from __fcntl.
	* malloc/set-freeres.c (__libc_freeres): Add libc_hidden_def.
	* nss/nsswitch.h (__nss_database_lookup, __nss_next): Add
	libc_hiden_proto.
	* nss/nsswitch.c (__nss_database_lookup, __nss_next): Add
	libc_hidden_def.
	* sysdeps/generic/mempcpy.c (__mempcpy): Remove undef.
	Add libc_hidden_def.
	* sysdeps/generic/open64.c (__open64): Add libc_hidden_def.
	* sysdeps/generic/open.c (__open): Remove undef.
	Add libc_hidden_def.  Remove INTDEF.
	* sysdeps/generic/fcntl.c (__fcntl): Remove undef.
	Add libc_hidden_def.
	* sysdeps/mach/hurd/fcntl.c (__fcntl): Likewise.
	* sysdeps/i386/i586/mempcpy.S (__mempcpy): Add libc_hidden_def.
	* sysdeps/i386/i686/mempcpy.S (__mempcpy): Likewise.
	* sysdeps/mach/hurd/fcntl.c (__libc_fcntl, __fcntl): Remove undef.
	(__fcntl): Remove INTDEF2.  Add libc_hidden_weak.
	(__libc_fcntl): Add libc_hidden_def.
	* sysdeps/mach/hurd/open.c (__libc_open, __open): Remove undef.
	(__open): Remove INTDEF2.  Add libc_hidden_weak.
	(__libc_open): Add libc_hidden_def.
	* sysdeps/posix/open64.c (__open64): Add libc_hidden_weak.
	* sysdeps/standalone/open.c (__open): Add libc_hidden_def.
	* sysdeps/unix/sysv/aix/fcntl.c (__libc_fcntl, __fcntl): Remove undef.
	Add libc_hidden_def.
	* sysdeps/unix/sysv/aix/open.c (__libc_open, __open): Remove undef.
	Add libc_hidden_def.
	* sysdeps/unix/sysv/linux/i386/fcntl.c (__libc_fcntl, __fcntl): Remove
	undef.
	(__fcntl): Remove INTDEF2.  Add libc_hidden_weak.
	(__libc_fcntl): Add libc_hidden_def.
	* sysdeps/unix/sysv/linux/syscalls.list (__fcntl_internal,
	__getpgid_internal, __chown_internal): Remove.
	(__GI___fcntl, __GI___libc_fcntl, __GI___getpgid, __GI___pipe,
	__GI___sched_setscheduler, __GI___select, __GI___setpgid,
	__GI___chown): Add.
	* sysdeps/unix/syscalls.list (__close_internal, __dup2_internal,
	__getpid_internal, __open_internal, __write_internal): Remove.
	(__GI___fcntl, __GI___libc_fcntl, __GI___open, __GI___libc_open,
	__GI___chown, __GI___close, __GI___dup2, __GI___getpid,
	__GI___libc_open, __GI___open, __GI___read, __GI___libc_read,
	__GI___select, __GI___statfs, __GI___write, __GI___libc_write): Add.
	* wcsmbs/mbrlen.c (__mbrlen): Remove undef.
	Replace INTDEF with libc_hidden_def.
	* wcsmbs/mbrtowc.c (__mbrtowc): Likewise.
	* catgets/catgetsinfo.h (__open_catalog): Add libc_hidden_proto.
	* catgets/open_catalog.c (__open_catalog): Add libc_hidden_def.
	* elf/dl-profile.c (__profile_frequency): Add libc_hidden_proto.
	* include/rpc/rpc.h (__rpc_thread_svc_fdset, __rpc_thread_createerr):
	Add libc_hidden_proto.
	* include/sys/poll.h (__poll): Add libc_hidden_proto.
	* include/sys/select.h (__select): Likewise.
	* include/sys/socket.h (__send): Likewise.
	* include/sys/statfs.h (__statfs): Likewise.
	* include/unistd.h (__pwrite64, __libc_read, __pipe, __chown, __dup2,
	__getpid, __getpgid, __setpgid, __close, __read, __write,
	__getpagesize, __sbrk): Likewise.
	(__chown_internal, __dup2_internal, __getpid_internal,
	__getpgid_internal, __close_internal, __write_internal,
	__getpagesize_internal): Remove.
	(__close, __dup2, __getpagesize, __getpgid, __getpid, __libc_write):
	Remove macros.
	* include/printf.h (__printf_fp): Add libc_hidden_proto.
	* include/sched.h (__sched_setscheduler): Likewise.
	* include/resolv.h (__res_ninit, __res_randomid): Likewise.
	* include/stdlib.h (__secure_getenv): Likewise.
	* include/signal.h (__sigaction, __sigsuspend): Likewise.
	* inet/getaliasent_r.c (NSS_attribute_hidden): Remove.
	* inet/getaliasname_r.c (NSS_attribute_hidden): Remove.
	* inet/getnetbyad_r.c (NSS_attribute_hidden): Remove.
	* inet/getnetbynm_r.c (NSS_attribute_hidden): Remove.
	* inet/getnetent_r.c (NSS_attribute_hidden): Remove.
	* inet/getproto_r.c (NSS_attribute_hidden): Remove.
	* inet/getprtent_r.c (NSS_attribute_hidden): Remove.
	* inet/getprtname_r.c (NSS_attribute_hidden): Remove.
	* inet/getrpcbyname_r.c (NSS_attribute_hidden): Remove.
	* inet/getrpcbynumber_r.c (NSS_attribute_hidden): Remove.
	* inet/getrpcent_r.c (NSS_attribute_hidden): Remove.
	* inet/getservent_r.c (NSS_attribute_hidden): Remove.
	* inet/getsrvbynm_r.c (NSS_attribute_hidden): Remove.
	* inet/getsrvbypt_r.c (NSS_attribute_hidden): Remove.
	* inet/gethstbyad_r.c (DB_LOOKUP_FCT): Remove INTUSE.
	* inet/gethstbynm2_r.c (DB_LOOKUP_FCT): Likewise.
	* inet/gethstbynm_r.c (DB_LOOKUP_FCT): Likewise.
	* inet/gethstent_r.c (DB_LOOKUP_FCT): Likewise.
	* libio/genops.c (__overflow): Add libc_hidden_def.
	* libio/iovdprintf.c: Remove libio.h include.
	* libio/libioP.h (libc_hidden_proto, libc_hidden_def,
	libc_hidden_weak): Define to nothing if not defined.
	(__overflow, __woverflow): Add libc_hidden_proto.
	* libio/wgenops.c (__woverflow): Add libc_hidden_def.
	* nss/getXXent_r.c (NSS_attribute_hidden): Remove.
	(DB_LOOKUP_FCT): Add libc_hidden_proto.
	* nss/getXXbyYY_r.c (NSS_attribute_hidden): Remove.
	(DB_LOOKUP_FCT): Add libc_hidden_proto.
	* nss/XXX-lookup.c (DB_LOOKUP_FCT): Add libc_hidden_proto
	and libc_hidden_def.
	* nss/hosts-lookup.c (__nss_hosts_lookup): Remove INTDEF.
	* posix/bsd-getpgrp.c (__getpgid_internal): Remove.
	(__getpgid): Add libc_hidden_proto.
	(__bsd_getpgrp): Remove INTUSE.
	* resolv/res_init.c (__res_ninit, __res_randomid): Add
	libc_hidden_def.
	* shadow/getspent_r.c (NSS_attribute_hidden): Remove.
	* shadow/getspnam_r.c (NSS_attribute_hidden): Remove.
	* stdio-common/printf_fp.c (__printf_fp): Add libc_hidden_def.
	* stdlib/strfmon.c (__printf_fp): Add libc_hidden_proto.
	* stdlib/secure-getenv.c (__secure_getenv): Add libc_hidden_def.
	* sunrpc/rpc_thread.c (__rpc_thread_svc_fdset,
	__rpc_thread_createerr): Add libc_hidden_def.
	* sysdeps/alpha/alphaev67/rawmemchr.S (__rawmemchr): Add
	libc_hidden_def.
	* sysdeps/alpha/alphaev67/stpncpy.S (__stpncpy): Likewise.
	* sysdeps/alpha/rawmemchr.S (__rawmemchr): Likewise.
	* sysdeps/alpha/stpncpy.S (__stpncpy): Likewise.
	* sysdeps/generic/chown.c (__chown): Likewise.
	* sysdeps/generic/close.c (__close): Likewise.
	* sysdeps/generic/dup2.c (__dup2): Likewise.
	* sysdeps/generic/pipe.c (__pipe): Likewise.
	* sysdeps/generic/prof-freq.c (__profile_frequency): Likewise.
	* sysdeps/generic/pwrite64.c (__pwrite64): Likewise.
	* sysdeps/generic/rawmemchr.c (__rawmemchr): Likewise.
	* sysdeps/generic/read.c (__libc_read): Likewise.
	(__read): Add libc_hidden_weak.
	* sysdeps/generic/sbrk.c (__sbrk): Add libc_hidden_def.
	* sysdeps/generic/sched_sets.c (__sched_setscheduler): Likewise.
	* sysdeps/generic/select.c (__select): Likewise.
	* sysdeps/generic/send.c (__send): Likewise.
	* sysdeps/generic/setpgid.c (__setpgid): Likewise.
	* sysdeps/generic/sigaction.c (__sigaction): Likewise.
	* sysdeps/generic/sigsuspend.c (__sigsuspend): Likewise.
	* sysdeps/generic/statfs.c (__statfs): Likewise.
	* sysdeps/generic/stpncpy.c (__stpncpy): Likewise.
	* sysdeps/generic/strcasecmp.c (__strcasecmp): Likewise.
	* sysdeps/generic/getpagesize.c (__getpagesize): Likewise.
	Remove undef and INTDEF.
	* sysdeps/generic/getpgid.c (__getpgid): Likewise.
	* sysdeps/generic/getpid.c (__getpid): Likewise.
	* sysdeps/generic/write.c (__libc_write): Likewise.
	(__write): Add libc_hidden_weak.  Remove undef and INTDEF.
	* sysdeps/i386/rawmemchr.S (__rawmemchr): Add libc_hidden_def.
	* sysdeps/i386/stpncpy.S (__stpncpy): Likewise.
	* sysdeps/m68k/rawmemchr.S (__rawmemchr): Likewise.
	* sysdeps/mach/hurd/chown.c (__chown): Likewise.  Remove INTDEF.
	* sysdeps/mach/hurd/close.c (__close): Add libc_hidden_def.
	Remove undef and INTDEF.
	* sysdeps/mach/hurd/dup2.c (__dup2): Likewise.
	* sysdeps/mach/hurd/getpgid.c (__getpgid): Likewise.
	* sysdeps/mach/hurd/getpid.c (__getpid): Likewise.
	* sysdeps/mach/getpagesize.c (__getpagesize): Likewise.
	* sysdeps/mach/hurd/write.c (__libc_write): Likewise.
	(__write): Add libc_hidden_weak.  Remove undef and INTDEF.
	* sysdeps/mach/hurd/pipe.c: Include unistd.h.
	(__pipe): Add libc_hidden_def.
	* sysdeps/mach/hurd/dl-sysdep.c (__libc_read, __libc_write): Add
	libc_hidden_weak.
	* sysdeps/mach/hurd/poll.c (__poll): Add libc_hidden_def.
	* sysdeps/mach/hurd/profil.c (__profile_frequency): Likewise.
	* sysdeps/mach/hurd/read.c (__libc_read): Likewise.
	(__read): Add libc_hidden_weak.
	* sysdeps/mach/hurd/pwrite64.c (__pwrite64): Likewise.
	(__libc_pwrite64): Add libc_hidden_def.
	* sysdeps/mach/hurd/sbrk.c (__sbrk): Likewise.
	* sysdeps/mach/hurd/select.c (__select): Likewise.
	* sysdeps/mach/hurd/send.c (__send): Likewise.
	* sysdeps/mach/hurd/setpgid.c (__setpgid): Likewise.
	* sysdeps/mach/hurd/sigaction.c (__sigaction): Likewise.
	* sysdeps/mach/hurd/sigsuspend.c (__sigsuspend): Likewise.
	* sysdeps/mach/hurd/statfs.c (__statfs): Likewise.
	* sysdeps/posix/dup2.c: Likewise.
	Remove undef and INTDEF.
	* sysdeps/posix/getpagesize.c (__getpagesize): Likewise.
	* sysdeps/posix/pwrite64.c (__libc_pwrite64): Add libc_hidden_def.
	(__pwrite64): Add libc_hidden_weak.
	* sysdeps/posix/sigsuspend.c (__sigsuspend): Add libc_hidden_def.
	* sysdeps/sparc/sparc64/rawmemchr.S (__rawmemchr): Likewise.
	* sysdeps/sparc/sparc64/stpncpy.S (__stpncpy): Likewise.
	* sysdeps/standalone/close.c (__close): Likewise.
	* sysdeps/standalone/write.c (__libc_write): Likewise.
	(__write): Add libc_hidden_weak.
	* sysdeps/standalone/read.c (__read): Likewise.
	(__libc_read): Add libc_hidden_def.
	* sysdeps/unix/grantpt.c (grantpt): Remove INTUSE.
	* sysdeps/unix/bsd/m68k/pipe.S (__pipe): Add libc_hidden_def.
	* sysdeps/unix/bsd/osf/alpha/pipe.S (__pipe): Likewise.
	* sysdeps/unix/bsd/vax/pipe.S (__pipe): Likewise.
	* sysdeps/unix/bsd/syscalls.list (__GI___getpagesize): Likewise.
	* sysdeps/unix/bsd/poll.c (__poll): Likewise.
	* sysdeps/unix/bsd/sigaction.c (__sigaction): Likewise.
	* sysdeps/unix/bsd/sigsuspend.c (__sigsuspend): Likewise.
	* sysdeps/unix/common/syscalls.list (__GI___getpgid, __GI___setpgid,
	__GI___sigaction): Add.
	* sysdeps/unix/i386/pipe.S (__pipe): Add libc_hidden_def.
	* sysdeps/unix/inet/syscalls.list (__GI___send): Add.
	* sysdeps/unix/mips/pipe.S (__pipe): Add libc_hidden_def.
	* sysdeps/unix/sparc/pipe.S (__pipe): Likewise.
	* sysdeps/unix/sysv/irix4/syscalls.list (__GI___getpgid,
	__GI___setpgid): Add.
	* sysdeps/unix/sysv/aix/chown.c (__chown): Add libc_hidden_def.
	Remove undef and INTDEF.
	* sysdeps/unix/sysv/aix/getpgid.c (__getpgid): Likewise.
	* sysdeps/unix/sysv/aix/write.c (__write, __libc_write): Likewise.
	* sysdeps/unix/sysv/aix/close.c (__close): Add libc_hidden_def.
	* sysdeps/unix/sysv/aix/getpid.c (__getpid): Likewise.
	* sysdeps/unix/sysv/aix/pipe.c (__pipe): Likewise.
	* sysdeps/unix/sysv/aix/read.c (__read, __libc_read): Likewise.
	* sysdeps/unix/sysv/aix/poll.c (__poll): Likewise.
	* sysdeps/unix/sysv/aix/sbrk.c (__sbrk): Likewise.
	* sysdeps/unix/sysv/aix/sigaction.c (__sigaction): Likewise.
	* sysdeps/unix/sysv/aix/sigsuspend.c (__sigsuspend): Likewise.
	* sysdeps/unix/sysv/aix/statfs.c (__statfs): Likewise.
	* sysdeps/unix/sysv/aix/select.c (__select): Likewise.
	* sysdeps/unix/sysv/aix/setpgid.c (__setpgid): Likewise.
	* sysdeps/unix/sysv/linux/alpha/pipe.S (__pipe): Likewise.
	* sysdeps/unix/sysv/linux/alpha/syscalls.list (__GI___pwrite64,
	__GI___statfs, __GI___send): Add.
	* sysdeps/unix/sysv/linux/alpha/select.S (__select): Add
	libc_hidden_ver resp. libc_hidden_def.
	* sysdeps/unix/sysv/linux/alpha/sigsuspend.S (__sigsuspend): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/ia64/getpagesize.c (__getpagesize):
	Likewise.  Remove undef and INTDEF.
	* sysdeps/unix/sysv/linux/ia64/pipe.S (__pipe): Add libc_hidden_def.
	* sysdeps/unix/sysv/linux/ia64/syscalls.list (__GI___pwrite64,
	__GI___statfs, __GI___send): Add.
	* sysdeps/unix/sysv/linux/ia64/sigaction.c (__sigaction): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/ia64/sigsuspend.c (__sigsuspend):
	Likewise.
	* sysdeps/unix/sysv/linux/sh/pipe.S (__pipe): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/chown.c (__chown): Add
	libc_hidden_ver resp. libc_hidden_def.
	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (__GI___pwrite64,
	__GI___send): Add.
	* sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c (__sigaction):
	Add libc_hidden_weak.
	* sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c (__sigsuspend):
	Add libc_hidden_def.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list (__GI___send): Add.
	* sysdeps/unix/sysv/linux/arm/sigaction.c (__sigaction): Add
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/i386/chown.c (__chown): Add libc_hidden_ver
	resp. libc_hidden_def.
	* sysdeps/unix/sysv/linux/i386/sigaction.c (__sigaction): Add
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/m68k/chown.c (__chown): Likewise.  Remove
	INTDEF.
	* sysdeps/unix/sysv/linux/m68k/getpagesize.c (__getpagesize):
	Likewise.  Remove undef.
	* sysdeps/unix/sysv/linux/mips/pwrite64.c (__pwrite64): Add
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/mips/syscalls.list (__GI___send): Add.
	* sysdeps/unix/sysv/linux/mips/sigaction.c (__sigaction): Add
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/powerpc/chown.c (__chown): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/powerpc/pwrite64.c (__pwrite64): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getpagesize.c (__getpagesize):
	Likewise.  Remove undef and INTDEF.
	* sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S (__pipe): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (__sigaction): Add
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S (__pipe): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
	(__GI___pwrite64, __GI___statfs, __GI___select, __GI___send): Add.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (__sigaction): Add
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c (__sigsuspend):
	Add libc_hidden_def.
	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (__GI___pwrite64,
	__GI___statfs): Add.
	* sysdeps/unix/sysv/linux/x86_64/send.c (__send): Add
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/x86_64/sigaction.c (__sigaction): Likewise.
	* sysdeps/unix/sysv/linux/getpagesize.c: Add libc_hidden_def.
	Remove undef and INTDEF.
	* sysdeps/unix/sysv/linux/poll.c (__poll): Add libc_hidden_def.
	* sysdeps/unix/sysv/linux/pwrite64.c (__pwrite64): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/send.S (__send): Likewise.
	* sysdeps/unix/sysv/linux/sigaction.c (__sigaction): Add
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/sigsuspend.c (__sigsuspend): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/sco3.2.4/__setpgid.c (__setpgid): Likewise.
	* sysdeps/unix/sysv/sco3.2.4/sigaction.S (__sigaction): Likewise.
	* sysdeps/unix/sysv/sysv4/solaris2/syscalls.list (__GI___sigaction):
	Add.
	* sysdeps/unix/sysv/sysv4/__getpgid.c (__getpgid): Add
	libc_hidden_def.  Remove undef and INTDEF.
	* sysdeps/unix/sysv/sysv4/getpgid.c (__getpgid): Likewise.
	* sysdeps/unix/sysv/sysv4/__setpgid.c (__setpgid): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/sysv4/setpgid.c (__setpgid): Likewise.
	* sysdeps/unix/sysv/sysv4/sigaction.c (__sigaction): Likewise.
	* sysdeps/unix/sysv/sigaction.c (__sigaction): Likewise.
	* sysdeps/unix/getpagesize.c (__getpagesize): Add libc_hidden_def.
	Remove undef and INTDEF.
	* configure.in (HAVE_BROKEN_VISIBILITY_ATTRIBUTE): Add check for
	broken visibility attribute handling.
	* config.h.in (HAVE_BROKEN_VISIBILITY_ATTRIBUTE): Add.

2002-08-02  Ulrich Drepper  <drepper@redhat.com>
2002-08-03 07:02:10 +00:00

426 lines
13 KiB
ArmAsm

/* stpncpy(DST, SRC, COUNT) - Copy no more than N characters of
SRC to DEST, returning the address of the terminating '\0' in
DEST, if any, or else DEST + N.
For SPARC v9.
Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>.
The GNU C Library is free software; you can redistribute it and/or
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.
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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <sysdep.h>
#include <asm/asi.h>
#ifndef XCC
#define XCC xcc
#define USE_BPR
.register %g2, #scratch
.register %g3, #scratch
.register %g7, #scratch
#endif
/* Normally, this uses
((xword - 0x0101010101010101) & 0x8080808080808080) test
to find out if any byte in xword could be zero. This is fast, but
also gives false alarm for any byte in range 0x81-0xff. It does
not matter for correctness, as if this test tells us there could
be some zero byte, we check it byte by byte, but if bytes with
high bits set are common in the strings, then this will give poor
performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
will use one tick slower, but more precise test
((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
which does not give any false alarms (but if some bits are set,
one cannot assume from it which bytes are zero and which are not).
It is yet to be measured, what is the correct default for glibc
in these days for an average user.
*/
.text
.align 32
ENTRY(__stpncpy)
sethi %hi(0x01010101), %g1 /* IEU0 Group */
#ifdef USE_BPR
brz,pn %o2, 19f /* CTI+IEU1 */
#else
tst %o2 /* IEU1 */
be,pn %XCC, 19f /* CTI */
#endif
or %g1, %lo(0x01010101), %g1 /* IEU1 */
andcc %o0, 7, %g0 /* IEU1 Group */
sllx %g1, 32, %g2 /* IEU0 */
bne,pn %icc, 26f /* CTI */
or %g1, %g2, %g1 /* IEU0 Group */
andcc %o1, 7, %g3 /* IEU1 */
bne,pn %icc, 28f /* CTI */
sllx %g1, 7, %g2 /* IEU0 Group */
ldx [%o1], %o3 /* Load */
1: add %o1, 8, %o1 /* IEU1 */
2: subcc %o2, 8, %o2 /* IEU1 Group */
bl,pn %XCC, 18f /* CTI */
sub %o3, %g1, %o4 /* IEU0 */
add %o0, 8, %o0 /* IEU0 Group */
#ifdef EIGHTBIT_NOT_MORE
andn %o4, %o3, %o4 /* IEU1 */
#endif
mov %o3, %g3 /* IEU1 */
ldxa [%o1] ASI_PNF, %o3 /* Load */
add %o1, 8, %o1 /* IEU0 Group */
andcc %o4, %g2, %g0 /* IEU1 */
be,a,pt %xcc, 2b /* CTI */
stx %g3, [%o0-8] /* Store Group */
srlx %g3, 56, %g5 /* IEU0 Group */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 16f /* CTI */
srlx %g3, 48, %g4 /* IEU0 */
andcc %g4, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 15f /* CTI */
srlx %g3, 40, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 14f /* CTI */
srlx %g3, 32, %g4 /* IEU0 */
andcc %g4, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 13f /* CTI */
srlx %g3, 24, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 12f /* CTI */
srlx %g3, 16, %g4 /* IEU0 */
andcc %g4, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 11f /* CTI */
srlx %g3, 8, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 10f /* CTI */
sub %o0, 1, %g7 /* IEU0 */
andcc %g3, 0xff, %g0 /* IEU1 Group */
bne,pt %icc, 2b /* CTI */
3: stx %g3, [%o0-8] /* Store */
andncc %o2, 31, %g3 /* IEU1 Group */
4: be,pn %XCC, 41f /* CTI */
and %o2, 31, %o2 /* IEU1 Group */
40: stx %g0, [%o0] /* Store */
stx %g0, [%o0 + 8] /* Store Group */
subcc %g3, 32, %g3 /* IEU1 */
stx %g0, [%o0 + 16] /* Store Group */
stx %g0, [%o0 + 24] /* Store Group */
bne,pt %XCC, 40b /* CTI */
add %o0, 32, %o0 /* IEU0 */
41: subcc %o2, 8, %o2 /* IEU1 Group */
bl,a,pn %XCC, 6f /* CTI */
andcc %o2, 4, %g0 /* IEU1 Group */
5: stx %g0, [%o0] /* Store */
subcc %o2, 8, %o2 /* IEU1 Group */
bge,pt %XCC, 5b /* CTI */
add %o0, 8, %o0 /* IEU0 */
andcc %o2, 4, %g0 /* IEU1 Group */
6: be,a,pn %icc, 7f /* CTI */
andcc %o2, 2, %g0 /* IEU1 Group */
stw %g0, [%o0] /* Store */
add %o0, 4, %o0 /* IEU0 */
andcc %o2, 2, %g0 /* IEU1 Group */
7: be,a,pn %icc, 8f /* CTI */
andcc %o2, 1, %g0 /* IEU1 Group */
sth %g0, [%o0] /* Store */
add %o0, 2, %o0 /* IEU0 */
andcc %o2, 1, %g0 /* IEU1 Group */
8: bne,a,pn %icc, 9f /* CTI */
stb %g0, [%o0] /* Store */
9: retl /* CTI+IEU1 Group */
mov %g7, %o0 /* IEU0 */
10: subcc %o0, 2, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %g5, 8, %g3 /* IEU0 */
11: subcc %o0, 3, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %g4, 16, %g3 /* IEU0 */
12: subcc %o0, 4, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %g5, 24, %g3 /* IEU0 */
13: subcc %o0, 5, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %g4, 32, %g3 /* IEU0 */
14: subcc %o0, 6, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %g5, 40, %g3 /* IEU0 */
15: subcc %o0, 7, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %g4, 48, %g3 /* IEU0 */
16: subcc %o0, 8, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
clr %g3 /* IEU0 */
.align 16
17: or %o3, %o4, %o3 /* IEU0 Group */
sub %o3, %g1, %o4 /* IEU1 */
18: addcc %o2, 8, %o2 /* IEU1 Group */
be,pn %XCC, 19f /* CTI */
andcc %o4, %g2, %g0 /* IEU1 Group */
be,pt %xcc, 21f /* CTI */
srlx %o3, 56, %g5 /* IEU0 */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 20f /* CTI */
stb %g5, [%o0] /* Store */
add %o0, 1, %o0 /* IEU0 Group */
subcc %o2, 1, %o2 /* IEU1 */
be,pn %XCC, 19f /* CTI */
srlx %o3, 48, %g5 /* IEU0 Group */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 20f /* CTI */
stb %g5, [%o0] /* Store */
add %o0, 1, %o0 /* IEU0 Group */
subcc %o2, 1, %o2 /* IEU1 */
be,pn %XCC, 19f /* CTI */
srlx %o3, 40, %g5 /* IEU0 Group */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 20f /* CTI */
stb %g5, [%o0] /* Store */
add %o0, 1, %o0 /* IEU0 Group */
subcc %o2, 1, %o2 /* IEU1 */
be,pn %XCC, 19f /* CTI */
srlx %o3, 32, %g5 /* IEU0 Group */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 20f /* CTI */
stb %g5, [%o0] /* Store */
add %o0, 1, %o0 /* IEU0 Group */
subcc %o2, 1, %o2 /* IEU1 */
be,pn %XCC, 19f /* CTI */
srlx %o3, 24, %g5 /* IEU0 Group */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 20f /* CTI */
stb %g5, [%o0] /* Store */
add %o0, 1, %o0 /* IEU0 Group */
subcc %o2, 1, %o2 /* IEU1 */
be,pn %XCC, 19f /* CTI */
srlx %o3, 16, %g5 /* IEU0 Group */
andcc %g5, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 20f /* CTI */
stb %g5, [%o0] /* Store */
add %o0, 1, %o0 /* IEU0 Group */
subcc %o2, 1, %o2 /* IEU1 */
be,pn %XCC, 19f /* CTI */
srlx %o3, 8, %o3 /* IEU0 Group */
stb %o3, [%o0] /* Store */
59: add %o0, 1, %o2 /* IEU1 */
andcc %o3, 0xff, %g0 /* IEU1 Group */
retl /* CTI+IEU1 Group */
movne %icc, %o2, %o0 /* Single Group */
19: retl /* CTI+IEU1 Group */
nop /* IEU0 */
20: mov %o0, %g7 /* IEU0 Group */
subcc %o2, 1, %o2 /* IEU1 */
be,pn %XCC, 51f /* CTI */
add %o0, 1, %o0 /* IEU0 Group */
50: stb %g0, [%o0] /* Store Group */
subcc %o2, 1, %o2 /* IEU1 Group */
bne,pt %XCC, 50b /* CTI */
add %o0, 1, %o0 /* IEU0 */
51: retl /* CTI+IEU1 Group */
mov %g7, %o0 /* IEU0 */
.align 16
21: andcc %o2, 4, %g0 /* IEU1 Group */
be,pn %icc, 22f /* CTI */
srlx %o3, 32, %g5 /* IEU0 */
stw %g5, [%o0] /* Store Group */
add %o0, 4, %o0 /* IEU0 */
mov %o3, %g5 /* IEU1 */
22: andcc %o2, 2, %g0 /* IEU1 Group */
be,pn %icc, 23f /* CTI */
srlx %g5, 16, %g4 /* IEU0 */
sth %g4, [%o0] /* Store Group */
add %o0, 2, %o0 /* IEU0 */
mov %g5, %g4 /* IEU1 */
23: srlx %g4, 8, %g4 /* IEU0 Group */
andcc %o2, 1, %g0 /* IEU1 */
bne,a,pn %icc, 24f /* CTI */
stb %g4, [%o0] /* Store Group */
retl /* CTI+IEU1 Group */
nop /* IEU0 */
24: retl /* CTI+IEU1 Group */
add %o0, 1, %o0 /* IEU0 */
.align 16
55: sub %o0, 1, %g7 /* IEU0 Group */
25: andcc %o0, 7, %g0 /* IEU1 */
be,a,pn %icc, 4b /* CTI */
andncc %o2, 31, %g3 /* IEU1 Group */
stb %g0, [%o0] /* Store Group */
subcc %o2, 1, %o2 /* IEU1 */
bne,pt %XCC, 25b /* CTI */
add %o0, 1, %o0 /* IEU0 Group */
retl /* CTI+IEU1 Group */
mov %g7, %o0 /* IEU0 */
.align 16
26: ldub [%o1], %o3 /* Load */
sllx %g1, 7, %g2 /* IEU0 Group */
stb %o3, [%o0] /* Store */
27: subcc %o2, 1, %o2 /* IEU1 */
be,pn %XCC, 59b /* CTI */
add %o1, 1, %o1 /* IEU0 Group */
add %o0, 1, %o0 /* IEU1 */
andcc %o3, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 55b /* CTI */
lduba [%o1] ASI_PNF, %o3 /* Load */
andcc %o0, 7, %g0 /* IEU1 Group */
bne,a,pt %icc, 27b /* CTI */
stb %o3, [%o0] /* Store */
andcc %o1, 7, %g3 /* IEU1 Group */
be,a,pt %icc, 1b /* CTI */
ldx [%o1], %o3 /* Load */
28: orcc %g0, 64, %g4 /* IEU1 Group */
sllx %g3, 3, %g5 /* IEU0 */
sub %g4, %g5, %g4 /* IEU0 Group */
sub %o1, %g3, %o1 /* IEU1 */
/* %g1 = 0101010101010101
%g2 = 8080808080808080
%g3 = source alignment
%g5 = number of bits to shift left
%g4 = number of bits to shift right */
ldxa [%o1] ASI_PNF, %o5 /* Load Group */
addcc %o1, 8, %o1 /* IEU1 */
29: sllx %o5, %g5, %o3 /* IEU0 Group */
ldxa [%o1] ASI_PNF, %o5 /* Load */
subcc %o2, 8, %o2 /* IEU1 */
bl,pn %XCC, 17b /* CTI */
srlx %o5, %g4, %o4 /* IEU0 Group */
add %o1, 8, %o1 /* IEU1 */
or %o3, %o4, %o3 /* IEU0 Group */
add %o0, 8, %o0 /* IEU1 */
sub %o3, %g1, %o4 /* IEU0 Group */
#ifdef EIGHTBIT_NOT_RARE
andn %o4, %o3, %o4 /* IEU0 Group */
#endif
andcc %o4, %g2, %g0 /* IEU1 Group */
be,a,pt %xcc, 29b /* CTI */
stx %o3, [%o0-8] /* Store */
srlx %o3, 56, %o4 /* IEU0 Group */
andcc %o4, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 36f /* CTI */
srlx %o3, 48, %g7 /* IEU0 */
andcc %g7, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 35f /* CTI */
srlx %o3, 40, %o4 /* IEU0 */
andcc %o4, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 34f /* CTI */
srlx %o3, 32, %g7 /* IEU0 */
andcc %g7, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 33f /* CTI */
srlx %o3, 24, %o4 /* IEU0 */
andcc %o4, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 32f /* CTI */
srlx %o3, 16, %g7 /* IEU0 */
andcc %g7, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 31f /* CTI */
srlx %o3, 8, %o4 /* IEU0 */
andcc %o4, 0xff, %g0 /* IEU1 Group */
be,pn %icc, 30f /* CTI */
andcc %o3, 0xff, %g0 /* IEU1 Group */
bne,pn %icc, 29b /* CTI */
stx %o3, [%o0-8] /* Store */
sub %o0, 1, %g7 /* IEU0 Group */
ba,pt %xcc, 4b /* CTI */
andncc %o2, 31, %g3 /* IEU1 */
30: subcc %o0, 2, %g7 /* IEU0 */
ba,pt %xcc, 3b /* CTI */
sllx %o4, 8, %g3 /* IEU0 Group */
31: sllx %g7, 16, %g3 /* IEU0 Group */
ba,pt %xcc, 3b /* CTI */
sub %o0, 3, %g7 /* IEU1 */
32: subcc %o0, 4, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %o4, 24, %g3 /* IEU0 */
33: sllx %g7, 32, %g3 /* IEU0 Group */
ba,pt %xcc, 3b /* CTI */
sub %o0, 5, %g7 /* IEU1 */
34: subcc %o0, 6, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %o4, 40, %g3 /* IEU0 */
35: sllx %g7, 48, %g3 /* IEU0 Group */
ba,pt %xcc, 3b /* CTI */
sub %o0, 7, %g7 /* IEU1 */
36: subcc %o0, 8, %g7 /* IEU1 Group */
ba,pt %xcc, 3b /* CTI */
sllx %o4, 56, %g3 /* IEU0 */
END(__stpncpy)
libc_hidden_def (__stpncpy)
weak_alias (__stpncpy, stpncpy)