]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
5 years agoPrint cache size and geometry auxv types on LD_SHOW_AUXV=1
Tulio Magno Quites Machado Filho [Wed, 19 Dec 2018 21:03:12 +0000 (19:03 -0200)] 
Print cache size and geometry auxv types on LD_SHOW_AUXV=1

Add support for AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE,
AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and AT_L3_CACHEGEOMETRY when
LD_SHOW_AUXV=1.

AT_L*_CACHESIZE is printed as decimal and represent the number of
bytes of the cache.

AT_L*_CACHEGEOMETRY is treated in order to specify the cache line size
and its associativity.

Example output from a POWER8:

AT_L1I_CACHESIZE:     32768
AT_L1I_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L1D_CACHESIZE:     65536
AT_L1D_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L2_CACHESIZE:      524288
AT_L2_CACHEGEOMETRY:  128B line size, 8-way set associative
AT_L3_CACHESIZE:      8388608
AT_L3_CACHEGEOMETRY:  128B line size, 8-way set associative

Some of the new types are longer than the previous ones, requiring to
increase the indentation in order to keep the values aligned.

* elf/dl-sysdep.c (auxvars): Add AT_L1I_CACHESIZE,
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY,
AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and
AT_L3_CACHEGEOMETRY.  Fix indentation when printing the other
fields.
(_dl_show_auxv): Give a special treatment to
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY
and AT_L3_CACHEGEOMETRY.
* sysdeps/powerpc/dl-procinfo.h (cache_geometry): New function.
(_dl_procinfo): Fix indentation when printing AT_HWCAP and
AT_HWCAP2.  Add support for AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY and AT_L3_CACHEGEOMETRY.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
5 years agonscd: avoid assertion failure during persistent db check
Andreas Schwab [Tue, 15 May 2018 12:42:37 +0000 (14:42 +0200)] 
nscd: avoid assertion failure during persistent db check

nscd should not abort when it finds inconsistencies in the persistent db.

5 years agohurd: Fix 64bit fcntl lock implementation
Samuel Thibault [Wed, 19 Dec 2018 01:17:22 +0000 (02:17 +0100)] 
hurd: Fix 64bit fcntl lock implementation

* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Test against 64bit `cmd'
values in the 64bit value cases.

5 years agoFix BZ number for 43a45c2d82
Adhemerval Zanella [Tue, 18 Dec 2018 22:23:35 +0000 (20:23 -0200)] 
Fix BZ number for 43a45c2d82

5 years agoY2038: add function __ctime64_r
Albert ARIBAUD (3ADEV) [Tue, 18 Dec 2018 22:13:55 +0000 (23:13 +0100)] 
Y2038: add function __ctime64_r

Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

* include/time.h
(__ctime64_r): Add.
* time/ctime_r.c
(__ctime64_r): Add.
[__TIMESIZE != 64] (__ctime_r): Turn into a wrapper.

5 years agoY2038: add function __ctime64
Albert ARIBAUD (3ADEV) [Tue, 18 Dec 2018 22:13:24 +0000 (23:13 +0100)] 
Y2038: add function __ctime64

Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

* include/time.h
(__ctime64): Add.
* time/gmtime.c
(__ctime64): Add.
[__TIMESIZE != 64] (ctime): Turn into a wrapper.

5 years agoY2038: add function __gmtime64_r
Albert ARIBAUD (3ADEV) [Tue, 18 Dec 2018 22:12:30 +0000 (23:12 +0100)] 
Y2038: add function __gmtime64_r

Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

* include/time.h
(__gmtime64_r): Add.
* time/gmtime.c
(__gmtime64_r): Add.
[__TIMESIZE != 64] (__gmtime): Turn into a wrapper.

5 years agoY2038: add function __gmtime64
Albert ARIBAUD (3ADEV) [Tue, 18 Dec 2018 22:11:40 +0000 (23:11 +0100)] 
Y2038: add function __gmtime64

Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

* include/time.h
(__gmtime64): Add.
* time/gmtime.c
(__gmtime64): Add.
[__TIMESIZE != 64] (__gmtime): Turn into a wrapper.

5 years agoY2038: add function __localtime64_r
Albert ARIBAUD (3ADEV) [Tue, 18 Dec 2018 22:11:08 +0000 (23:11 +0100)] 
Y2038: add function __localtime64_r

Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

* include/time.h
(__localtime64_r): Add.
* time/localtime.c
(__localtime64_r): Add.
[__TIMESIZE != 64] (__localtime_r): Turn into a wrapper.

5 years agos390: Use generic kernel_sigaction.h
Adhemerval Zanella [Tue, 11 Dec 2018 19:16:36 +0000 (17:16 -0200)] 
s390: Use generic kernel_sigaction.h

S390 kernel sigaction is the same as the Linux generic one.

Checked with a s390-linux-gnu and s390x-linux-gnu build.

* sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Use Linux generic
kernel_sigction definition.

5 years agoia64: Remove kernel_sigaction.h
Adhemerval Zanella [Tue, 11 Dec 2018 19:15:07 +0000 (17:15 -0200)] 
ia64: Remove kernel_sigaction.h

IA64 kernel_sigaction.h definition is the sama as the Linux generic
one.

Checked on ia64-linux-gnu.

* sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h: Remove file.

5 years agohppa: Remove kernel_sigaction.h
Adhemerval Zanella [Tue, 11 Dec 2018 19:14:09 +0000 (17:14 -0200)] 
hppa: Remove kernel_sigaction.h

HPPA kernel_sigaction.h definition is the sama as the Linux generic
one and old_kernel_sigaction is not used.

Checked on hppa-linux-gnu.

* sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h: Remove file.

5 years agoalpha: Use Linux generic sigaction implementation
Adhemerval Zanella [Tue, 11 Dec 2018 18:57:49 +0000 (16:57 -0200)] 
alpha: Use Linux generic sigaction implementation

Alpha rt_sigaction syscall uses a slight different kernel ABI than
generic one:

arch/alpha/kernel/signal.c

 90 SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
 91                 struct sigaction __user *, oact,
 92                 size_t, sigsetsize, void __user *, restorer)

Similar as sparc, the syscall expects a restorer function.  However
different than sparc, alpha defines the restorer as the 5th argument
(sparc defines as the 4th).

This patch removes the arch-specific alpha sigaction implementation,
adapt the Linux generic one to different restore placements (through
STUB macro), and make alpha use the Linux generic kernel_sigaction
definition.

Checked on alpha-linux-gnu and x86_64-linux-gnu (for sanity).

* sysdeps/unix/sysv/linux/alpha/Makefile: Update comment about
__syscall_rt_sigaction.
* sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
(kernel_sigaction): Use Linux generic defintion.
(STUB): Define.
(__syscall_rt_sigreturn, __syscall_sigreturn): Add prototype.
* sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
(__syscall_rt_sigaction): Remove implementation.
(__syscall_sigreturn, __syscall_rt_sigreturn): Define as global and
hidden.
* sysdeps/unix/sysv/linux/alpha/sigaction.c: Remove file.
* sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL,
INTERNAL_SYSCALL): Remove definitions.
* sysdeps/unix/sysv/linux/sigaction.c: Define STUB to accept both the
action and signal set size.
* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (STUB): Redefine.
* sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (STUB): Likewise.

5 years agom68k: Fix sigaction kernel definition (BZ #23960)
Adhemerval Zanella [Tue, 11 Dec 2018 18:52:47 +0000 (16:52 -0200)] 
m68k: Fix sigaction kernel definition (BZ #23960)

Commit b4a5d26d883 (linux: Consolidate sigaction implementation) added
a wrong kernel_sigaction definition for m68k, meant for __NR_sigaction
instead of __NR_rt_sigaction as used on generic Linux sigaction
implementation.  This patch fixes it by using the Linux generic
definition meant for the RT kernel ABI.

Checked the signal tests on emulated m68-linux-gnu (Aranym).  It fixes
the faulty signal/tst-sigaction and man works as expected.

Adhemerval Zanella  <adhemerval.zanella@linaro.org>
James Clarke  <jrtc27@jrtc27.com>

[BZ #23960]
* sysdeps/unix/sysv/linux/kernel_sigaction.h (HAS_SA_RESTORER):
Define if SA_RESTORER is defined.
(kernel_sigaction): Define sa_restorer if HAS_SA_RESTORER is defined.
(SET_SA_RESTORER, RESET_SA_RESTORER): Define iff the macro are not
already defined.
* sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h (SA_RESTORER,
kernel_sigaction, SET_SA_RESTORER, RESET_SA_RESTORER): Remove
definitions.
(HAS_SA_RESTORER): Define.
* sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h (SA_RESTORER,
SET_SA_RESTORER, RESET_SA_RESTORER): Remove definition.
(HAS_SA_RESTORER): Define.
* sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h: Include generic
kernel_sigaction after define SET_SA_RESTORER and RESET_SA_RESTORER.
* sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.

5 years agoRemove __ASSUME_ST_INO_64_BIT.
Joseph Myers [Tue, 18 Dec 2018 13:35:39 +0000 (13:35 +0000)] 
Remove __ASSUME_ST_INO_64_BIT.

kernel-features.h has a macro __ASSUME_ST_INO_64_BIT, with a comment
"However, SH is lame, and still does not have a 64-bit inode field.".

The macro is, in fact, defined to 0 by Alpha as well as SH.  The Alpha
case is, however, trivially useless: none of the files that test
__ASSUME_ST_INO_64_BIT are built for Alpha (which gained kernel
support for stat64 syscalls, with a 64-bit st_ino field, in Linux
2.6.4; the define to 0 for Alpha in glibc predates that).

The SH kernel gained support for a 64-bit st_ino in struct stat64 in
commit 760bcb1deec13c50e20399c84cb6a8ea41cc2820 ("sh: Fix fstatat64()
syscall."), which is in Linux 2.6.22 and later.  So the redefinition
of __ASSUME_ST_INO_64_BIT to 0 is of no use for SH either; three of
the files testing it do so immediately after a stat64-family syscall
has been used, which will always have set the 64-bit st_ino correctly
(in addition to the 32-bit __st_ino), while the relevant code
__xstat32_conv executes only after such a syscall in the function
calling __xstat32_conv.

Thus this patch removes __ASSUME_ST_INO_64_BIT and code testing it.
Removing the useless [!__ASSUME_ST_INO_64_BIT] code in __xstat32_conv
renders the [_HAVE_STAT64___ST_INO] and [!_HAVE_STAT64___ST_INO] cases
around it identical, so that conditional is also removed.

Tested compilation with build-many-glibcs.py for its Alpha and SH
configurations; also ran the glibc testsuite for x86_64 and x86.

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_ST_INO_64_BIT): Remove macro definition.
* sysdeps/unix/sysv/linux/alpha/kernel-features.h
(__ASSUME_ST_INO_64_BIT): Do not undefine and define.
* sysdeps/unix/sysv/linux/sh/kernel-features.h
(__ASSUME_ST_INO_64_BIT): Likewise.
* sysdeps/unix/sysv/linux/fxstat64.c: Do not include
<kernel-features.h>.
(___fxstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
Remove conditional code.
* sysdeps/unix/sysv/linux/lxstat64.c: Do not include
<kernel-features.h>.
(___lxstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
Remove conditional code.
* sysdeps/unix/sysv/linux/xstat64.c: Do not include
<kernel-features.h>.
(___xstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
Remove conditional code.
* sysdeps/unix/sysv/linux/xstatconv.c: Do not include
<kernel-features.h>.
(__xstat32_conv) [_HAVE_STAT64___ST_INO]: Remove conditional code.
[!_HAVE_STAT64___ST_INO]: Make code unconditional.

5 years agoS390: Cleanup ifunc-resolve.h.
Stefan Liebler [Tue, 18 Dec 2018 12:57:25 +0000 (13:57 +0100)] 
S390: Cleanup ifunc-resolve.h.

The ifunc macros s390_vx_libc* are no longer used and
can be removed as all users are now relying on
s390_libc_ifunc_expr.

The same applies to s390_libc_ifunc.  The macro
s390_libc_ifunc_init is now renamed to
s390_libc_ifunc_expr_stfle_init and the users are
adjusted accordingly.

ChangeLog:

* sysdeps/s390/multiarch/ifunc-resolve.h
(s390_vx_libc_ifunc, s390_vx_libc_ifunc_redirected,
s390_vx_libc_ifunc2, s390_vx_libc_ifunc_init,
s390_vx_libc_ifunc2_redirected, s390_libc_ifunc):
Delete macro definition.
(s390_libc_ifunc_init): Rename to
s390_libc_ifunc_expr_stfle_init.
* sysdeps/s390/bzero: Use
s390_libc_ifunc_expr_stfle_init instead of
s390_libc_ifunc_init.
* sysdeps/s390/memcmp.c: Likewise.
* sysdeps/s390/memcpy.c: Likewise.
* sysdeps/s390/mempcpy.c: Likewise.
* sysdeps/s390/memset.c: Likewise.

5 years agoS390: Refactor gconv_simple ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:25 +0000 (13:57 +0100)] 
S390: Refactor gconv_simple ifunc handling.

The ifunc handling for various __gconv_transform_* functions
which are using IFUNC on s390x are adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Instead those functions are just an alias to the vector variants.

Furthermore the ifunc-macro s390_libc_ifunc_expr is now used instead of
s390_vx_libc_ifunc.

ChangeLog:

* sysdeps/s390/multiarch/gconv_simple.c (ICONV_VX_IFUNC):
Define macro dependent on HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT.

5 years agoS390: Refactor wmemcmp ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:25 +0000 (13:57 +0100)] 
S390: Refactor wmemcmp ifunc handling.

The ifunc handling for wmemcmp is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wmemcmp variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wmemcmp variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wmemcmp.
* sysdeps/s390/multiarch/wmemcmp-c.c: Move to ...
* sysdeps/s390/wmemcmp-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wmemcmp-vx.S: Move to ...
* sysdeps/s390/wmemcmp-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wmemcmp.c: Move to ...
* sysdeps/s390/wmemcmp.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wmemcmp.h: New file.

5 years agoS390: Refactor wmemset ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:24 +0000 (13:57 +0100)] 
S390: Refactor wmemset ifunc handling.

The ifunc handling for wmemset is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.
Glibc internal calls will use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wmemset variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wmemset variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wmemset.
* sysdeps/s390/multiarch/wmemset-c.c: Move to ...
* sysdeps/s390/wmemset-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wmemset-vx.S: Move to ...
* sysdeps/s390/wmemset-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wmemset.c: Move to ...
* sysdeps/s390/wmemset.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wmemset.h: New file.

5 years agoS390: Refactor wmemchr ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:24 +0000 (13:57 +0100)] 
S390: Refactor wmemchr ifunc handling.

The ifunc handling for wmemchr is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.
Glibc internal calls will use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wmemchr variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wmemchr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wmemchr.
* sysdeps/s390/multiarch/wmemchr-c.c: Move to ...
* sysdeps/s390/wmemchr-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wmemchr-vx.S: Move to ...
* sysdeps/s390/wmemchr-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wmemchr.c: Move to ...
* sysdeps/s390/wmemchr.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wmemchr.h: New file.

5 years agoS390: Refactor wcscspn ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:23 +0000 (13:57 +0100)] 
S390: Refactor wcscspn ifunc handling.

The ifunc handling for wcscspn is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcscspn variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcscspn variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcscspn.
* sysdeps/s390/multiarch/wcscspn-c.c: Move to ...
* sysdeps/s390/wcscspn-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcscspn-vx.S: Move to ...
* sysdeps/s390/wcscspn-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcscspn.c: Move to ...
* sysdeps/s390/wcscspn.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcscspn.h: New file.

5 years agoS390: Refactor wcspbrk ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:23 +0000 (13:57 +0100)] 
S390: Refactor wcspbrk ifunc handling.

The ifunc handling for wcspbrk is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.
Glibc internal calls will use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcspbrk variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcspbrk variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcspbrk.
* sysdeps/s390/multiarch/wcspbrk-c.c: Move to ...
* sysdeps/s390/wcspbrk-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcspbrk-vx.S: Move to ...
* sysdeps/s390/wcspbrk-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcspbrk.c: Move to ...
* sysdeps/s390/wcspbrk.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcspbrk.h: New file.

5 years agoS390: Refactor wcsspn ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:23 +0000 (13:57 +0100)] 
S390: Refactor wcsspn ifunc handling.

The ifunc handling for wcsspn is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.
Glibc internal calls will use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcsspn variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcsspn variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcsspn.
* sysdeps/s390/multiarch/wcsspn-c.c: Move to ...
* sysdeps/s390/wcsspn-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsspn-vx.S: Move to ...
* sysdeps/s390/wcsspn-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsspn.c: Move to ...
* sysdeps/s390/wcsspn.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcsspn.h: New file.

5 years agoS390: Refactor wcsrchr ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:22 +0000 (13:57 +0100)] 
S390: Refactor wcsrchr ifunc handling.

The ifunc handling for wcsrchr is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcsrchr variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcsrchr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcsrchr.
* sysdeps/s390/multiarch/wcsrchr-c.c: Move to ...
* sysdeps/s390/wcsrchr-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsrchr-vx.S: Move to ...
* sysdeps/s390/wcsrchr-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsrchr.c: Move to ...
* sysdeps/s390/wcsrchr.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcsrchr.h: New file.

5 years agoS390: Refactor wcschrnul ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:22 +0000 (13:57 +0100)] 
S390: Refactor wcschrnul ifunc handling.

The ifunc handling for wcschrnul is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcschrnul variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcschrnul variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcschrnul.
* sysdeps/s390/multiarch/wcschrnul-c.c: Move to ...
* sysdeps/s390/wcschrnul-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcschrnul-vx.S: Move to ...
* sysdeps/s390/wcschrnul-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcschrnul.c: Move to ...
* sysdeps/s390/wcschrnul.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcschrnul.h: New file.

5 years agoS390: Refactor wcschr ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:22 +0000 (13:57 +0100)] 
S390: Refactor wcschr ifunc handling.

The ifunc handling for wcschr is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.
Glibc internal calls will use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcschr variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcschr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcschr.
* sysdeps/s390/multiarch/wcschr-c.c: Move to ...
* sysdeps/s390/wcschr-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcschr-vx.S: Move to ...
* sysdeps/s390/wcschr-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcschr.c: Move to ...
* sysdeps/s390/wcschr.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcschr.h: New file.

5 years agoS390: Refactor wcsncmp ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:21 +0000 (13:57 +0100)] 
S390: Refactor wcsncmp ifunc handling.

The ifunc handling for wcsncmp is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcsncmp variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcsncmp variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcsncmp.
* sysdeps/s390/multiarch/wcsncmp-c.c: Move to ...
* sysdeps/s390/wcsncmp-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsncmp-vx.S: Move to ...
* sysdeps/s390/wcsncmp-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsncmp.c: Move to ...
* sysdeps/s390/wcsncmp.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcsncmp.h: New file.

5 years agoS390: Refactor wcscmp ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:21 +0000 (13:57 +0100)] 
S390: Refactor wcscmp ifunc handling.

The ifunc handling for wcscmp is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcscmp variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcscmp variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcscmp.
* sysdeps/s390/multiarch/wcscmp-c.c: Move to ...
* sysdeps/s390/wcscmp-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcscmp-vx.S: Move to ...
* sysdeps/s390/wcscmp-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcscmp.c: Move to ...
* sysdeps/s390/wcscmp.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcscmp.h: New file.

5 years agoS390: Refactor wcsncat ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:20 +0000 (13:57 +0100)] 
S390: Refactor wcsncat ifunc handling.

The ifunc handling for wcsncat is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcsncat variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcsncat variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcsncat.
* sysdeps/s390/multiarch/wcsncat-c.c: Move to ...
* sysdeps/s390/wcsncat-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsncat-vx.S: Move to ...
* sysdeps/s390/wcsncat-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsncat.c: Move to ...
* sysdeps/s390/wcsncat.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcsncat.h: New file.

5 years agoS390: Refactor wcscat ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:20 +0000 (13:57 +0100)] 
S390: Refactor wcscat ifunc handling.

The ifunc handling for wcscat is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcscat variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcscat variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcscat.
* sysdeps/s390/multiarch/wcscat-c.c: Move to ...
* sysdeps/s390/wcscat-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcscat-vx.S: Move to ...
* sysdeps/s390/wcscat-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcscat.c: Move to ...
* sysdeps/s390/wcscat.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcscat.h: New file.

5 years agoS390: Refactor wcpncpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:19 +0000 (13:57 +0100)] 
S390: Refactor wcpncpy ifunc handling.

The ifunc handling for wcpncpy is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcpncpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcpncpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcpncpy.
* sysdeps/s390/multiarch/wcpncpy-c.c: Move to ...
* sysdeps/s390/wcpncpy-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcpncpy-vx.S: Move to ...
* sysdeps/s390/wcpncpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcpncpy.c: Move to ...
* sysdeps/s390/wcpncpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcpncpy.h: New file.

5 years agoS390: Refactor wcsncpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:19 +0000 (13:57 +0100)] 
S390: Refactor wcsncpy ifunc handling.

The ifunc handling for wcsncpy is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcsncpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcsncpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcsncpy.
* sysdeps/s390/multiarch/wcsncpy-c.c: Move to ...
* sysdeps/s390/wcsncpy-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsncpy-vx.S: Move to ...
* sysdeps/s390/wcsncpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsncpy.c: Move to ...
* sysdeps/s390/wcsncpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcsncpy.h: New file.

5 years agoS390: Refactor wcpcpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:19 +0000 (13:57 +0100)] 
S390: Refactor wcpcpy ifunc handling.

The ifunc handling for wcpcpy is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcpcpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcpcpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcpcpy.
* sysdeps/s390/multiarch/wcpcpy-c.c: Move to ...
* sysdeps/s390/wcpcpy-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcpcpy-vx.S: Move to ...
* sysdeps/s390/wcpcpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcpcpy.c: Move to ...
* sysdeps/s390/wcpcpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcpcpy.h: New file.

5 years agoS390: Refactor wcscpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:18 +0000 (13:57 +0100)] 
S390: Refactor wcscpy ifunc handling.

The ifunc handling for wcscpy is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcscpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcscpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcscpy.
* sysdeps/s390/multiarch/wcscpy-c.c: Move to ...
* sysdeps/s390/wcscpy-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcscpy-vx.S: Move to ...
* sysdeps/s390/wcscpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcscpy.c: Move to ...
* sysdeps/s390/wcscpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcscpy.h: New file.

5 years agoS390: Refactor wcsnlen ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:18 +0000 (13:57 +0100)] 
S390: Refactor wcsnlen ifunc handling.

The ifunc handling for wcsnlen is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.
Glibc internal calls will use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcsnlen variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcsnlen variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcsnlen.
* sysdeps/s390/multiarch/wcsnlen-c.c: Move to ...
* sysdeps/s390/wcsnlen-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsnlen-vx.S: Move to ...
* sysdeps/s390/wcsnlen-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcsnlen.c: Move to ...
* sysdeps/s390/wcsnlen.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcsnlen.h: New file.

5 years agoS390: Refactor wcslen ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:17 +0000 (13:57 +0100)] 
S390: Refactor wcslen ifunc handling.

The ifunc handling for wcslen is adjusted in order to omit ifunc
if the minimum architecture level already supports newer CPUs by default.
Unfortunately the c ifunc variant can't be omitted at all as it is used
by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove wcslen variants.
* sysdeps/s390/Makefile (sysdep_routines): Add wcslen variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for wcslen.
* sysdeps/s390/multiarch/wcslen-c.c: Move to ...
* sysdeps/s390/wcslen-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcslen-vx.S: Move to ...
* sysdeps/s390/wcslen-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/wcslen.c: Move to ...
* sysdeps/s390/wcslen.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-wcslen.h: New file.

5 years agoS390: Refactor memrchr ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:17 +0000 (13:57 +0100)] 
S390: Refactor memrchr ifunc handling.

The ifunc handling for memrchr is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove memrchr variants.
* sysdeps/s390/Makefile (sysdep_routines): Add memrchr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for memrchr.
* sysdeps/s390/multiarch/memrchr-c.c: Move to ...
* sysdeps/s390/memrchr-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/memrchr-vx.S: Move to ...
* sysdeps/s390/memrchr-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/memrchr.c: Move to ...
* sysdeps/s390/memrchr.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-memrchr.h: New file.

5 years agoS390: Refactor memccpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:16 +0000 (13:57 +0100)] 
S390: Refactor memccpy ifunc handling.

The ifunc handling for memccpy is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove memccpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add memccpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for memccpy.
* sysdeps/s390/multiarch/memccpy-c.c: Move to ...
* sysdeps/s390/memccpy-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/memccpy-vx.S: Move to ...
* sysdeps/s390/memccpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/memccpy.c: Move to ...
* sysdeps/s390/memccpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-memccpy.h: New file.

5 years agoS390: Refactor rawmemchr ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:16 +0000 (13:57 +0100)] 
S390: Refactor rawmemchr ifunc handling.

The ifunc handling for rawmemchr is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove rawmemchr variants.
* sysdeps/s390/Makefile (sysdep_routines): Add rawmemchr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for rawmemchr.
* sysdeps/s390/multiarch/rawmemchr-c.c: Move to ...
* sysdeps/s390/rawmemchr-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/rawmemchr-vx.S: Move to ...
* sysdeps/s390/rawmemchr-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/rawmemchr.c: Move to ...
* sysdeps/s390/rawmemchr.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-rawmemchr.h: New file.

5 years agoS390: Refactor memchr ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:16 +0000 (13:57 +0100)] 
S390: Refactor memchr ifunc handling.

The ifunc handling for memchr is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

Note: The fallback s390-32/s390-64 ifunc variants with srst instruction
are now moved to the unified memchr-z900.S file which can be used for
31/64bit. The s390-32/s390-64 files multiarch/memchr.c and memchr.S
are deleted.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove memchr variants.
* sysdeps/s390/Makefile (sysdep_routines): Add memchr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for memchr.
* sysdeps/s390/multiarch/memchr-vx.S: Move to ...
* sysdeps/s390/memchr-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/memchr.c: Move to ...
* sysdeps/s390/memchr.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-memchr.h: New file.
* sysdeps/s390/s390-64/memchr.S: Move to ...
* sysdeps/s390/memchr-z900.S: ... here and adjust to be usable
for 31/64bit and ifunc handling.
* sysdeps/s390/s390-32/multiarch/memchr.c: Delete file.
* sysdeps/s390/s390-64/multiarch/memchr.c: Likewise.
* sysdeps/s390/s390-32/memchr.S: Likewise.

5 years agoS390: Refactor strcspn ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:15 +0000 (13:57 +0100)] 
S390: Refactor strcspn ifunc handling.

The ifunc handling for strcspn is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strcspn variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strcspn variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strcspn.
* sysdeps/s390/multiarch/strcspn-c.c: Move to ...
* sysdeps/s390/strcspn-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strcspn-vx.S: Move to ...
* sysdeps/s390/strcspn-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strcspn.c: Move to ...
* sysdeps/s390/strcspn.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strcspn.h: New file.

5 years agoS390: Refactor strpbrk ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:15 +0000 (13:57 +0100)] 
S390: Refactor strpbrk ifunc handling.

The ifunc handling for strpbrk is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strpbrk variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strpbrk variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strpbrk.
* sysdeps/s390/multiarch/strpbrk-c.c: Move to ...
* sysdeps/s390/strpbrk-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strpbrk-vx.S: Move to ...
* sysdeps/s390/strpbrk-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strpbrk.c: Move to ...
* sysdeps/s390/strpbrk.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strpbrk.h: New file.

5 years agoS390: Refactor strspn ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:15 +0000 (13:57 +0100)] 
S390: Refactor strspn ifunc handling.

The ifunc handling for strspn is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strspn variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strspn variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strspn.
* sysdeps/s390/multiarch/strspn-c.c: Move to ...
* sysdeps/s390/strspn-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strspn-vx.S: Move to ...
* sysdeps/s390/strspn-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strspn.c: Move to ...
* sysdeps/s390/strspn.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strspn.h: New file.

5 years agoS390: Refactor strrchr ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:14 +0000 (13:57 +0100)] 
S390: Refactor strrchr ifunc handling.

The ifunc handling for strrchr is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strrchr variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strrchr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strrchr.
* sysdeps/s390/multiarch/strrchr-c.c: Move to ...
* sysdeps/s390/strrchr-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strrchr-vx.S: Move to ...
* sysdeps/s390/strrchr-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strrchr.c: Move to ...
* sysdeps/s390/strrchr.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strrchr.h: New file.

5 years agoS390: Refactor strchrnul ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:14 +0000 (13:57 +0100)] 
S390: Refactor strchrnul ifunc handling.

The ifunc handling for strchrnul is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strchrnul variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strchrnul variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strchrnul.
* sysdeps/s390/multiarch/strchrnul-c.c: Move to ...
* sysdeps/s390/strchrnul-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strchrnul-vx.S: Move to ...
* sysdeps/s390/strchrnul-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strchrnul.c: Move to ...
* sysdeps/s390/strchrnul.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strchrnul.h: New file.

5 years agoS390: Refactor strchr ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:14 +0000 (13:57 +0100)] 
S390: Refactor strchr ifunc handling.

The ifunc handling for strchr is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strchr variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strchr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strchr.
* sysdeps/s390/multiarch/strchr-c.c: Move to ...
* sysdeps/s390/strchr-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strchr-vx.S: Move to ...
* sysdeps/s390/strchr-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strchr.c: Move to ...
* sysdeps/s390/strchr.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strchr.h: New file.

5 years agoS390: Refactor strncmp ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:13 +0000 (13:57 +0100)] 
S390: Refactor strncmp ifunc handling.

The ifunc handling for strncmp is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strncmp variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strncmp variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strncmp.
* sysdeps/s390/multiarch/strncmp-c.c: Move to ...
* sysdeps/s390/strncmp-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strncmp-vx.S: Move to ...
* sysdeps/s390/strncmp-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strncmp.c: Move to ...
* sysdeps/s390/strncmp.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strncmp.h: New file.

5 years agoS390: Refactor strcmp ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:13 +0000 (13:57 +0100)] 
S390: Refactor strcmp ifunc handling.

The ifunc handling for strcmp is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

Note: The fallback s390-32/s390-64 ifunc variants with clst instruction
are now moved to the unified strcmp-z900.S file which can be used for
31/64bit. The s390-32/s390-64 files multiarch/strcmp.c and strcmp.S
are deleted.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strcmp variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strcmp variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strcmp.
* sysdeps/s390/multiarch/strcmp-vx.S: Move to ...
* sysdeps/s390/strcmp-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strcmp.c: Move to ...
* sysdeps/s390/strcmp.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strcmp.h: New file.
* sysdeps/s390/s390-64/strcmp.S: Move to ...
* sysdeps/s390/strcmp-z900.S: ... here and adjust to be usable
for 31/64bit and ifunc handling.
* sysdeps/s390/s390-32/multiarch/strcmp.c: Delete file.
* sysdeps/s390/s390-64/multiarch/strcmp.c: Likewise.
* sysdeps/s390/s390-32/strcmp.S: Likewise.

5 years agoS390: Refactor strncat ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:12 +0000 (13:57 +0100)] 
S390: Refactor strncat ifunc handling.

The ifunc handling for strncat is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strncat variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strncat variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strncat.
* sysdeps/s390/multiarch/strncat-c.c: Move to ...
* sysdeps/s390/strncat-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strncat-vx.S: Move to ...
* sysdeps/s390/strncat-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strncat.c: Move to ...
* sysdeps/s390/strncat.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strncat.h: New file.

5 years agoS390: Refactor strcat ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:12 +0000 (13:57 +0100)] 
S390: Refactor strcat ifunc handling.

The ifunc handling for strcat is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strcat variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strcat variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strcat.
* sysdeps/s390/multiarch/strcat-c.c: Move to ...
* sysdeps/s390/strcat-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strcat-vx.S: Move to ...
* sysdeps/s390/strcat-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strcat.c: Move to ...
* sysdeps/s390/strcat.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strcat.h: New file.

5 years agoS390: Refactor stpncpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:11 +0000 (13:57 +0100)] 
S390: Refactor stpncpy ifunc handling.

The ifunc handling for stpncpy is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove stpncpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add stpncpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for stpncpy.
* sysdeps/s390/multiarch/stpncpy-c.c: Move to ...
* sysdeps/s390/stpncpy-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/stpncpy-vx.S: Move to ...
* sysdeps/s390/stpncpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/stpncpy.c: Move to ...
* sysdeps/s390/stpncpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-stpncpy.h: New file.

5 years agoS390: Refactor strncpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:11 +0000 (13:57 +0100)] 
S390: Refactor strncpy ifunc handling.

The ifunc handling for strncpy is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

Note: The fallback s390-32/s390-64 ifunc variants are now moved to
the strncpy-z900.S files. The s390-32/s390-64 files multiarch/strncpy.c
and strncpy.S are deleted.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strncpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strncpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strncpy.
* sysdeps/s390/multiarch/strncpy-vx.S: Move to ...
* sysdeps/s390/strncpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strncpy.c: Move to ...
* sysdeps/s390/strncpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strncpy.h: New file.
* sysdeps/s390/s390-64/strncpy.S: Move to ...
* sysdeps/s390/s390-64/strncpy-z900.S: ... here
and adjust ifunc handling.
* sysdeps/s390/s390-32/strncpy.S: Move to ...
* sysdeps/s390/s390-32/strncpy-z900.S: ... here
and adjust ifunc handling.
* sysdeps/s390/s390-32/multiarch/strncpy.c: Delete file.
* sysdeps/s390/s390-64/multiarch/strncpy.c: Likewise.

5 years agoS390: Refactor stpcpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:11 +0000 (13:57 +0100)] 
S390: Refactor stpcpy ifunc handling.

The ifunc handling for stpcpy is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove stpcpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add stpcpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for stpcpy.
* sysdeps/s390/multiarch/stpcpy-c.c: Move to ...
* sysdeps/s390/stpcpy-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/stpcpy-vx.S: Move to ...
* sysdeps/s390/stpcpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/stpcpy.c: Move to ...
* sysdeps/s390/stpcpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-stpcpy.h: New file.

5 years agoS390: Refactor strcpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:10 +0000 (13:57 +0100)] 
S390: Refactor strcpy ifunc handling.

The ifunc handling for strcpy is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

Note: The fallback s390-32/s390-64 ifunc variants with mvst instruction
are now moved to the unified strcpy-z900.S file which can be used for
31/64bit. The s390-32/s390-64 files multiarch/strcpy.c and strcpy.S
are deleted.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strcpy variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strcpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strcpy.
* sysdeps/s390/multiarch/strcpy-vx.S: Move to ...
* sysdeps/s390/strcpy-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strcpy.c: Move to ...
* sysdeps/s390/strcpy.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strcpy.h: New file.
* sysdeps/s390/s390-64/strcpy.S: Move to ...
* sysdeps/s390/strcpy-z900.S: ... here and adjust to be usable
for 31/64bit and ifunc handling.
* sysdeps/s390/s390-32/multiarch/strcpy.c: Delete file.
* sysdeps/s390/s390-64/multiarch/strcpy.c: Likewise.
* sysdeps/s390/s390-32/strcpy.S: Likewise.

5 years agoS390: Refactor strnlen ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:10 +0000 (13:57 +0100)] 
S390: Refactor strnlen ifunc handling.

The ifunc handling for strnlen is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strnlen variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strnlen variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strnlen.
* sysdeps/s390/multiarch/strnlen-c.c: Move to ...
* sysdeps/s390/strnlen-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strnlen-vx.S: Move to ...
* sysdeps/s390/strnlen-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strnlen.c: Move to ...
* sysdeps/s390/strnlen.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strnlen.h: New file.

5 years agoS390: Refactor strlen ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:10 +0000 (13:57 +0100)] 
S390: Refactor strlen ifunc handling.

The ifunc handling for strlen is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

* sysdeps/s390/multiarch/Makefile
(sysdep_routines): Remove strlen variants.
* sysdeps/s390/Makefile (sysdep_routines): Add strlen variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Refactor ifunc handling for strlen.
* sysdeps/s390/multiarch/strlen-c.c: Move to ...
* sysdeps/s390/strlen-c.c: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strlen-vx.S: Move to ...
* sysdeps/s390/strlen-vx.S: ... here and adjust ifunc handling.
* sysdeps/s390/multiarch/strlen.c: Move to ...
* sysdeps/s390/strlen.c: ... here and adjust ifunc handling.
* sysdeps/s390/ifunc-strlen.h: New file.

5 years agoS390: Add z13 memmem ifunc variant.
Stefan Liebler [Tue, 18 Dec 2018 12:57:09 +0000 (13:57 +0100)] 
S390: Add z13 memmem ifunc variant.

The new vector variant of memmem is using the common code
implementation, but instead of calling the default
mem* functions, the vector variants are called.

ChangeLog:

* sysdeps/s390/Makefile (sysdep_routines): Add memmem variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Add ifunc variants for memmem.
* sysdeps/s390/ifunc-memmem.h: New file.
* sysdeps/s390/memmem.c: Likewise.
* sysdeps/s390/memmem-c.c: Likewise.
* sysdeps/s390/memmem-vx.c: Likewise.

5 years agoS390: Add z13 strstr ifunc variant.
Stefan Liebler [Tue, 18 Dec 2018 12:57:09 +0000 (13:57 +0100)] 
S390: Add z13 strstr ifunc variant.

The new vector variant of strstr is using the common code
implementation, but instead of calling the default
str* / mem* functions, the vector variants are called.

ChangeLog:

* sysdeps/s390/Makefile (sysdep_routines): Add strstr variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Add ifunc variants for strstr.
* sysdeps/s390/ifunc-strstr.h: New file.
* sysdeps/s390/strstr.c: Likewise.
* sysdeps/s390/strstr-c.c: Likewise.
* sysdeps/s390/strstr-vx.c: Likewise.

5 years agoS390: Add z13 memmove ifunc variant.
Stefan Liebler [Tue, 18 Dec 2018 12:57:08 +0000 (13:57 +0100)] 
S390: Add z13 memmove ifunc variant.

This patch introduces a z13 specific ifunc variant for memmove.
As the common code implementation, it checks if we can copy from
the beginning to the end - with z196 memcpy implementation - or
if we have to copy from the end to the beginning.
The latter case is done by using vector load/store instructions.

If vector instructions are not available, the common-code is
used as fallback.  Therefore it is implemented in memmove-c with
a different name.
Furthermore the ifunc logic decides if we need the common-code
implementation at all.  If vector instructions are supported
due to the minimum architecture level set we can skip the
common-code ifunc variant.

ChangeLog:

* sysdeps/s390/Makefile (sysdep_routines): Add memmove-c.
* sysdeps/s390/ifunc-memcpy.h (HAVE_MEMMOVE_IFUNC,
HAVE_MEMMOVE_IFUNC_AND_VX_SUPPORT, MEMMOVE_DEFAULT,
HAVE_MEMMOVE_C, MEMMOVE_C,  HAVE_MEMMOVE_Z13, MEMMOVE_Z13):
New defines.
* sysdeps/s390/memcpy-z900.S: Add z13 memmove implementation.
* sysdeps/s390/memmove-c.c: New file.
* sysdeps/s390/memmove.c: Likewise.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Add ifunc variants for memmove.

5 years agoS390: Add configure check to detect z13 as mininum architecture level set.
Stefan Liebler [Tue, 18 Dec 2018 12:57:08 +0000 (13:57 +0100)] 
S390: Add configure check to detect z13 as mininum architecture level set.

Add a configure check for z13 in the same way as done for z196.

ChangeLog:

* config.h.in (HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT): New undefine.
* sysdeps/s390/configure.ac: Add check for z13 support.
* sysdeps/s390/configure: Regenerated.

5 years agoS390: Use memcpy for forward cases in memmove.
Stefan Liebler [Tue, 18 Dec 2018 12:57:07 +0000 (13:57 +0100)] 
S390: Use memcpy for forward cases in memmove.

The s390/s390x memcpy implementations are safe to be
used by memmove.  Starting with this commit, memmove is
using memcpy for the forward cases on s390.

ChangeLog:

* sysdeps/s390/memcopy.h: New file.

5 years agoS390: Remove s390 specific implementation of bcopy.
Stefan Liebler [Tue, 18 Dec 2018 12:57:07 +0000 (13:57 +0100)] 
S390: Remove s390 specific implementation of bcopy.

Nowadays gcc is automatically replacing a call to bcopy
with a call to memmove.  Thus only old binaries will call
the s390 specific bcopy implementation.

The s390 specific implementation is using an own
implementation for memcpy in the forward case and is
relying on memmove in the backward case.

After removing the s390 specific bcopy, the common code
bcopy is used.  It just performs a tail call to memmove.

ChangeLog:
* sysdeps/s390/s390-32/bcopy.S: Remove.
* sysdeps/s390/s390-64/bcopy.S: Likewise.

5 years agoS390: Refactor memcpy/mempcpy ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:06 +0000 (13:57 +0100)] 
S390: Refactor memcpy/mempcpy ifunc handling.

This patch moves all ifunc variants for memcpy/mempcpy
to sysdeps/s390/memcpy-z900.S. The configure-check/preprocessor logic
in sysdeps/s390/ifunc-memcpy.h decides if ifunc is needed at all
and which ifunc variants should be available.
E.g. if the compiler/assembler already supports z196 by default,
the older ifunc variants are not included.
If we only need the newest ifunc variant,
then we can skip ifunc at all.

Therefore the ifunc-resolvers and __libc_ifunc_impl_list are adjusted
in order to handle only the available ifunc variants.

ChangeLog:

* sysdeps/s390/ifunc-memcpy.h: New File.
* sysdeps/s390/memcpy.S: Move to ...
* sysdeps/s390/memcpy-z900.S ... here.
Move implementations from memcpy-s390x.s to here.
* sysdeps/s390/multiarch/memcpy-s390x.S: Delete File.
* sysdeps/s390/multiarch/Makefile (sysdep_routines):
Remove memcpy/mempcpy variants.
* sysdeps/s390/Makefile (sysdep_routines):
Add memcpy/mempcpy variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Adjust ifunc variants for
memcpy and mempcpy.
* sysdeps/s390/multiarch/memcpy.c: Move ifunc resolver
to ...
* sysdeps/s390/memcpy.c: ... here.
Adjust ifunc variants for memcpy.
* sysdeps/s390/multiarch/mempcpy.c: Move to ...
* sysdeps/s390/mempcpy.c: ... here.
Adjust ifunc variants for mempcpy.
* sysdeps/s390/mempcpy.S: Delete file.

5 years agoS390: Unify 31/64bit memcpy.
Stefan Liebler [Tue, 18 Dec 2018 12:57:06 +0000 (13:57 +0100)] 
S390: Unify 31/64bit memcpy.

The implementation of memcpy/mempcpy for s390-32 (31bit)
and s390-64 (64bit) is nearly the same.
This patch unifies it for maintability reasons.

__mem[p]cpy_z10 and __mem[p]cpy_z196 differs between 31 and 64bit:
-31bit needs .machinemode "zarch_nohighgprs" and llgfr   %r4,%r4
-lr vs lgr; lgr can be also used on 31bit as this ifunc variant
is only called if we are on a zarch machine.

__mem[p]cpy_default differs between 31 and 64bit:
-Some 31bit vs 64bit instructions (e.g. ltr vs ltgr.
Solved with 31/64 specific instruction macros).
-The address of mvc instruction is setup in different ways
(larl vs bras). Solved with #if defined __s390x__.

__memcpy_mvcle differs between 31 and 64bit:
-lr vs lgr; ahi vs aghi;
Solved with 31/64bit specific instruction macros.

Otherwise 31/64bit implementation has the same structure of the code.

ChangeLog:

* sysdeps/s390/s390-64/memcpy.S: Move to ...
* sysdeps/s390/memcpy.S: ... here.
Adjust to be usable for 31/64bit.
* sysdeps/s390/s390-32/memcpy.S: Delete File.
* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add memcpy.
* sysdeps/s390/s390-32/multiarch/Makefile: Delete file.
* sysdeps/s390/s390-64/multiarch/Makefile: Likewise.
* sysdeps/s390/s390-64/multiarch/memcpy-s390x.S: Move to ...
* sysdeps/s390/multiarch/memcpy-s390x.S: ... here.
Adjust to be usable for 31/64bit.
* sysdeps/s390/s390-32/multiarch/memcpy-s390.S: Delete File.
* sysdeps/s390/s390-64/multiarch/memcpy.c: Move to ...
* sysdeps/s390/multiarch/memcpy.c: ... here.
* sysdeps/s390/s390-32/multiarch/memcpy.c: Delete File.

5 years agoS390: Refactor memcmp ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:05 +0000 (13:57 +0100)] 
S390: Refactor memcmp ifunc handling.

This patch moves all ifunc variants for memcmp
to sysdeps/s390/memcmp-z900.S. The configure-check/preprocessor logic
in sysdeps/s390/ifunc-memcmp.h decides if ifunc is needed at all
and which ifunc variants should be available.
E.g. if the compiler/assembler already supports z196 by default,
the older ifunc variants are not included.
If we only need the newest ifunc variant,
then we can skip ifunc at all.

Therefore the ifunc-resolvers and __libc_ifunc_impl_list are adjusted
in order to handle only the available ifunc variants.

ChangeLog:

* sysdeps/s390/ifunc-memcmp.h: New File.
* sysdeps/s390/memcmp.S: Move to ...
* sysdeps/s390/memcmp-z900.S ... here.
Move implementations from memcmp-s390x.s to here.
* sysdeps/s390/multiarch/memcmp-s390x.S: Delete File.
* sysdeps/s390/multiarch/Makefile (sysdep_routines):
Remove memcmp variants.
* sysdeps/s390/Makefile (sysdep_routines):
Add memcmp variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Adjust ifunc variants for
memcmp.
* sysdeps/s390/multiarch/memcmp.c: Move ifunc resolver
to ...
* sysdeps/s390/memcmp.c: ... here.
Adjust ifunc variants for memcmp.

5 years agoS390: Unify 31/64bit memcmp.
Stefan Liebler [Tue, 18 Dec 2018 12:57:05 +0000 (13:57 +0100)] 
S390: Unify 31/64bit memcmp.

The implementation of memcmp for s390-32 (31bit) and
s390-64 (64bit) is nearly the same.
This patch unifies it for maintability reasons.

__memcmp_z10 and __memcmp_z196 differs between 31 and 64bit:
-31bit needs .machinemode "zarch_nohighgprs" and llgfr   %r4,%r4
-lr vs lgr and some other instructions:
But lgr and co can be also used on 31bit as this ifunc variant
is only called if we are on a zarch machine.

__memcmp_default differs between 31 and 64bit:
-Some 31bit vs 64bit instructions (e.g. ltr vs ltgr.
Solved with 31/64 specific instruction macros).
-The address of mvc instruction is setup in different ways
(larl vs bras). Solved with #if defined __s390x__.

Otherwise 31/64bit implementation has the same structure of the code.

ChangeLog:

* sysdeps/s390/s390-64/memcmp.S: Move to ...
* sysdeps/s390/memcmp.S: ... here.
Adjust to be usable for 31/64bit.
* sysdeps/s390/s390-32/memcmp.S: Delete File.
* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add memcmp.
* sysdeps/s390/s390-32/multiarch/Makefile (sysdep_routines):
Remove memcmp.
* sysdeps/s390/s390-64/multiarch/Makefile: Likewise.
* sysdeps/s390/s390-64/multiarch/memcmp-s390x.S: Move to ...
* sysdeps/s390/multiarch/memcmp-s390x.S: ... here.
Adjust to be usable for 31/64bit.
* sysdeps/s390/s390-32/multiarch/memcmp-s390.S: Delete File.
* sysdeps/s390/s390-64/multiarch/memcmp.c: Move to ...
* sysdeps/s390/multiarch/memcmp.c: ... here.
* sysdeps/s390/s390-32/multiarch/memcmp.c: Delete File.

5 years agoS390: Implement bzero with memset.
Stefan Liebler [Tue, 18 Dec 2018 12:57:05 +0000 (13:57 +0100)] 
S390: Implement bzero with memset.

This patch removes the bzero s390 implementation with mvcle and
adds entry points for bzero in memset ifunc variants.
Therefore an ifunc resolver is implemented for bzero, too.

ChangeLog:

* sysdeps/s390/s390-32/bzero.S: Delete file.
* sysdeps/s390/s390-64/bzero.S: Likewise.
* sysdeps/s390/Makefile (sysdep_routines): Add bzero.
* sysdeps/s390/bzero.c: New file.
* sysdeps/s390/memset-z900.S: Add bzero entry points.
* sysdeps/s390/ifunc-memset.h: Add bzero function macros.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Add bzero ifunc variants.

5 years agoS390: Refactor memset ifunc handling.
Stefan Liebler [Tue, 18 Dec 2018 12:57:04 +0000 (13:57 +0100)] 
S390: Refactor memset ifunc handling.

This patch moves all ifunc variants for memset
to sysdeps/s390/memset-z900.S. The configure-check/preprocessor logic
in sysdeps/s390/ifunc-memset.h decides if ifunc is needed at all
and which ifunc variants should be available.
E.g. if the compiler/assembler already supports z196 by default,
the older ifunc variants are not included.
If we only need the newest ifunc variant,
then we can skip ifunc at all.

Therefore the ifunc-resolvers and __libc_ifunc_impl_list are adjusted
in order to handle only the available ifunc variants.

ChangeLog:

* sysdeps/s390/ifunc-memset.h: New File.
* sysdeps/s390/memset.S: Move to ...
* sysdeps/s390/memset-z900.S ... here.
Move implementations from memset-s390x.s to here.
* sysdeps/s390/multiarch/memset-s390x.S: Delete File.
* sysdeps/s390/multiarch/Makefile (sysdep_routines):
Remove memset variants.
* sysdeps/s390/Makefile (sysdep_routines):
Add memset variants.
* sysdeps/s390/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Adjust ifunc variants for
memset.
* sysdeps/s390/multiarch/memset.c: Move ifunc resolver
to ...
* sysdeps/s390/memset.c: ... here.
Adjust ifunc variants for memset.

5 years agoS390: Unify 31/64bit memset.
Stefan Liebler [Tue, 18 Dec 2018 12:57:04 +0000 (13:57 +0100)] 
S390: Unify 31/64bit memset.

The implementation of memset for s390-32 (31bit) and
s390-64 (64bit) is nearly the same.
This patch unifies it for maintability reasons.

__memset_z10 and __memset_z196 differs between 31 and 64bit:
-31bit needs .machinemode "zarch_nohighgprs" and llgfr   %r4,%r4
-lr vs lgr and some other instructions:
But lgr and co can be also used on 31bit as this ifunc variant
is only called if we are on a zarch machine.

__memset_default differs between 31 and 64bit:
-Some 31bit vs 64bit instructions (e.g. ltr vs ltgr.
Solved with 31/64 specific instruction macros).
-The address of mvc instruction is setup in different ways
(larl vs bras). Solved with #if defined __s390x__.

Otherwise 31/64bit implementation has the same structure of the code.

ChangeLog:

* sysdeps/s390/s390-64/memset.S: Move to ...
* sysdeps/s390/memset.S: ... here.
Adjust to be usable for 31/64bit.
* sysdeps/s390/s390-32/memset.S: Delete File.
* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add memset.
* sysdeps/s390/s390-32/multiarch/Makefile (sysdep_routines):
Remove memset.
* sysdeps/s390/s390-64/multiarch/Makefile: Likewise.
* sysdeps/s390/s390-64/multiarch/memset-s390x.S: Move to ...
* sysdeps/s390/multiarch/memset-s390x.S: ... here.
Adjust to be usable for 31/64bit.
* sysdeps/s390/s390-32/multiarch/memset-s390.S: Delete File.
* sysdeps/s390/s390-64/multiarch/memset.c: Move to ...
* sysdeps/s390/multiarch/memset.c: ... here.
* sysdeps/s390/s390-32/multiarch/memset.c: Delete File.

5 years agoS390: Use hwcap instead of dl_hwcap in ifunc-resolvers.
Stefan Liebler [Tue, 18 Dec 2018 12:57:03 +0000 (13:57 +0100)] 
S390: Use hwcap instead of dl_hwcap in ifunc-resolvers.

The renaming of hwcap arguments in ifunc-resolvers is needed
in order to prepare for further commits which refactors
ifunc handling for memset, memcmp, and memcpy.  Now you are able
to use s390_libc_ifunc_init which stores the stfle bits
within the expression for an ifunc-resolver generated by
s390_libc_ifunc_expr.

ChangeLog:

* sysdeps/s390/multiarch/ifunc-resolve.h
(s390_libc_ifunc_init, s390_libc_ifunc,
s390_vx_libc_ifunc2_redirected): Use hwcap instead of dl_hwcap.

5 years agoS390: Add configure check to detect z10 as mininum architecture level set.
Stefan Liebler [Tue, 18 Dec 2018 12:57:03 +0000 (13:57 +0100)] 
S390: Add configure check to detect z10 as mininum architecture level set.

Add a configure check for z10 in the same way as done for z196.

ChangeLog:

* config.h.in (HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT): New undefine.
* sysdeps/s390/configure.ac: Add check for z10 support.
* sysdeps/s390/configure: Regenerated.

5 years agox86: Merge i386/x86_64 atomic-machine.h
H.J. Lu [Tue, 18 Dec 2018 12:25:12 +0000 (04:25 -0800)] 
x86: Merge i386/x86_64 atomic-machine.h

Merge i386 and x86_64 atomic-machine.h to x86 atomic-machine.h.

Tested on i686 and x86_64 as well as with build-many-glibcs.py.

* sysdeps/i386/atomic-machine.h: Merged with ...
* sysdeps/x86_64/atomic-machine.h: To ...
* sysdeps/x86/atomic-machine.h: This.  New file.

5 years agolocale: Rewrite locale/gen-translit.pl in Python
Florian Weimer [Tue, 18 Dec 2018 10:36:29 +0000 (11:36 +0100)] 
locale: Rewrite locale/gen-translit.pl in Python

This commit does not change the generated output file.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
5 years agolocaledata: Remove executable bit from localedata/locales/bi_VU [BZ #23995]
Florian Weimer [Tue, 18 Dec 2018 09:33:12 +0000 (10:33 +0100)] 
localedata: Remove executable bit from localedata/locales/bi_VU [BZ #23995]

5 years agoFix __TIMERSIZE and @theglibcadj typos
Albert ARIBAUD (3ADEV) [Tue, 20 Nov 2018 22:57:23 +0000 (23:57 +0100)] 
Fix __TIMERSIZE and @theglibcadj typos

Fix following typos in parent commit:
- ChangeLog: __TIMERSIZE should be __TIMESIZE
- manual/maint.texi: @theglibcadj should be @glibcadj

5 years agoY2038: add function __localtime64
Albert ARIBAUD (3ADEV) [Tue, 20 Nov 2018 22:57:23 +0000 (23:57 +0100)] 
Y2038: add function __localtime64

Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

* include/time.h
(__localtime64): Add.
* manual/maint.texi: Document Y2038 symbol handling.
* time/localtime.c
(__localtime64): Add.
[__TIMERSIZE != 64] (__localtime): Turn into a wrapper.

5 years agoDo not clobber r12 for ia64 syscalls.
Joseph Myers [Mon, 17 Dec 2018 18:31:50 +0000 (18:31 +0000)] 
Do not clobber r12 for ia64 syscalls.

GCC mainline now gives errors for an asm that clobbers the stack
pointer.  According to
<https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html> GCC
previously ignored such a clobber; thus, this patch removes it from
the clobbers for ia64 syscalls.

Tested with build-many-glibcs.py for ia64-linux-gnu.

* sysdeps/unix/sysv/linux/ia64/sysdep.h (ASM_CLOBBERS_6_COMMON):
Do not clobber r12.

5 years agoAdd test that MAP_* constants agree with kernel.
Joseph Myers [Mon, 17 Dec 2018 18:29:36 +0000 (18:29 +0000)] 
Add test that MAP_* constants agree with kernel.

Continuing the process of building up and using Python infrastructure
for extracting and using values in headers, this patch adds a test
that MAP_* constants from sys/mman.h agree with those in the Linux
kernel headers.  (Other sys/mman.h constants could be added to the
test separately.)

This set of constants has grown over time, so the generic code is
enhanced to allow saying extra constants are OK on either side of the
comparison (where the caller sets those parameters based on the Linux
kernel headers version, compared with the version the headers were
last updated from).  Although the test is a custom Python file, my
intention is to move in future to a single Python script for such
tests and text files it takes as inputs, once there are enough
examples to provide a guide to the common cases in such tests (I'd
like to end up with most or all such sets of constants copied from
kernel headers having such tests, and likewise for structure layouts
from the kernel).

The Makefile code is essentially the same as for tst-signal-numbers,
but I didn't try to find an object file to depend on to represent the
dependency on the headers used by the test (the conform/ tests don't
try to represent such header dependencies at all, for example).

Tested with build-many-glibcs.py, and also for x86_64 with older
kernel headers.

* scripts/glibcextract.py (compare_macro_consts): Take parameters
to allow extra macros from first or second sources.
* sysdeps/unix/sysv/linux/tst-mman-consts.py: New file.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) = misc]
(tests-special): Add $(objpfx)tst-mman-consts.out.
($(objpfx)tst-mman-consts.out): New makefile target.

5 years agoAdd statx conditionals for wordsize-32 *xstat.c
Mao Han [Mon, 26 Nov 2018 03:13:32 +0000 (11:13 +0800)] 
Add statx conditionals for wordsize-32 *xstat.c

Linux kernel have remove stat64 family from default syscall set, new
implementations with statx is needed when __ARCH_WANT_STAT64 is not
define. This patch add conditionals for relevant functions, using statx
system call to get information and then copy to the return buf, ref to
include/linux/fs.h from linux kernel.

* sysdeps/unix/sysv/linux/Makefile: Add statx_cp.c.
* sysdeps/unix/sysv/linux/fxstat64.c: Add conditionals for kernel
without stat64 system call support.
* sysdeps/unix/sysv/linux/fxstatat64.c: Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c: Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c: Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c: Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c: Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c: Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/statx_cp.c: New file.
* sysdeps/unix/sysv/linux/statx_cp.c: Likewise.
* sysdeps/unix/sysv/linux/statx_cp.h: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/statx_cp.c: Likewise.

5 years agoregex: fix storage-exhaustion error
Paul Eggert [Thu, 6 Sep 2018 06:57:08 +0000 (23:57 -0700)] 
regex: fix storage-exhaustion error

[BZ #18040]
* posix/regexec.c (get_subexp):
Do not continue if storage is exhausted.

5 years agoregex: fix heap-use-after-free error
Assaf Gordon [Thu, 6 Sep 2018 06:25:07 +0000 (23:25 -0700)] 
regex: fix heap-use-after-free error

[BZ #18040]
Problem reported by Saito Takaaki <tails.saito@gmail.com> in
https://debbugs.gnu.org/32592
Call stack get_subexp->get_subexp_sub->clean_state_log_if_needed may
call extend_buffers which reallocates the re_string_t internal buffer.
Local variable 'buf' was not updated in such case, resulting in
use-after-free.
* posix/regexec.c (get_subexp): Update 'buf' after call to
get_subexp_sub.

5 years agosupport: Do not require overflow builtin in support/blob_repeat.c
Florian Weimer [Sat, 15 Dec 2018 17:58:09 +0000 (18:58 +0100)] 
support: Do not require overflow builtin in support/blob_repeat.c

It is only available in GCC 5 and later.

Tested-by: Romain Naour <romain.naour@gmail.com>
5 years agoRemove x86 mathinline.h asinh, acosh, atanh inlines.
Joseph Myers [Fri, 14 Dec 2018 22:35:57 +0000 (22:35 +0000)] 
Remove x86 mathinline.h asinh, acosh, atanh inlines.

Continuing the removal of bits/mathinline.h inlines that would better
be done by the compiler, this patch removes x86 inlines for asinh,
acosh and atanh functions (only for fast-math, non-SSE 32-bit x86).
I've filed <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88502> for
adding such inlines as an optimization in GCC.

Tested for x86_64 and x86.

* sysdeps/x86/fpu/bits/mathinline.h (asinh): Remove inline
definition.
(acosh): Likewise.
(atanh): Likewise.

5 years agomanual: Document thread/task IDs for Linux
Florian Weimer [Fri, 14 Dec 2018 20:11:09 +0000 (21:11 +0100)] 
manual: Document thread/task IDs for Linux

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
5 years agoAdd tests for the long double version of ecvt and fcvt
Gabriel F. T. Gomes [Tue, 30 Oct 2018 18:04:18 +0000 (15:04 -0300)] 
Add tests for the long double version of ecvt and fcvt

The test case misc/tst-efgcvt.c only tests the double variants of the
Old-fashioned System V number-to-string functions: ecvt, fcvt, and their
re-entrant counterparts.  With a few macros, the code can be reused for
the long double versions of these functions.  A future patch will reuse
it again for IEEE long double on powerpc64le.

Tested for powerpc and powerpc64le.

5 years agoAdd missing libnss_testX.so requirement for tst-nss-test3.
Stefan Liebler [Fri, 14 Dec 2018 08:50:53 +0000 (09:50 +0100)] 
Add missing libnss_testX.so requirement for tst-nss-test3.

Sometimes tst-nss-test3 fails with:
error: test-container.c:386: unable to open .../nss/libnss_test1.so for reading

The test tst-nss-test3 which runs in a container needs
libnss_test[12].so. (see e.g. tst-nss-test3.script).
Before this test was moved from tests to tests-container variable,
the requirement was met.  Thus this patch adds this requirement
also for tests in tests-container.

ChangeLog:

* nss/Makefile (tst-nss-test3.out): New rule.

5 years agoDo not clobber sp in _hurd_stack_setup.
Joseph Myers [Thu, 13 Dec 2018 22:36:33 +0000 (22:36 +0000)] 
Do not clobber sp in _hurd_stack_setup.

GCC mainline now gives errors for an asm that clobbers the stack
pointer.  According to
<https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html> GCC
previously ignored such a clobber; thus, this patch removes it from
_hurd_stack_setup.

Tested with build-many-glibcs.py for i686-gnu.

* sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Do not
clobber sp.

5 years agox86: Add Hygon Dhyana support.
Carlos O'Donell [Wed, 12 Dec 2018 14:24:17 +0000 (09:24 -0500)] 
x86: Add Hygon Dhyana support.

This patch fix Hygon Dhyana processor CPU Vendor ID detection
problem in glibc sysdep module, current glibc codes doesn't
recognize Dhyana CPU Vendor ID("HygonGenuine") and set kind to
arch_kind_other, which result to incorrect zero value for
__cache_sysconf() syscall. As Hygon Dhyana share most
architecture feature as AMD Family 17h, this patch add Hygon CPU
Vendor ID check and setup kind to arch_kind_amd and reuse AMD
code path, which lead to correct return value in
__cache_sysconf() syscall. we run the glibc test suite for both
Hygon Dhyana and AMD EPYC and found no failure case.

Background:
Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture
between AMD and Haiguang Information Technology Co.,Ltd., aims at
providing high performance x86 processor for China server market.
Its first generation processor codename is Dhyana, which
originates from AMD technology and shares most of the
architecture with AMD's family 17h, but with different CPU Vendor
ID("HygonGenuine")/Family series number(Family 18h).

Related Hygon kernel patch can be found on
http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn

Signed-off-by: fanjinke <fanjinke@hygon.cn>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
5 years agoFix rwlock stall with PREFER_WRITER_NONRECURSIVE_NP (bug 23861)
Andreas Schwab [Thu, 8 Nov 2018 13:28:22 +0000 (14:28 +0100)] 
Fix rwlock stall with PREFER_WRITER_NONRECURSIVE_NP (bug 23861)

In the read lock function (__pthread_rwlock_rdlock_full) there was a
code path which would fail to reload __readers while waiting for
PTHREAD_RWLOCK_RWAITING to change. This failure to reload __readers
into a local value meant that various conditionals used the old value
of __readers and with only two threads left it could result in an
indefinite stall of one of the readers (waiting for PTHREAD_RWLOCK_RWAITING
to go to zero, but it never would).

5 years agoReindent nptl/pthread_rwlock_common.c
Andreas Schwab [Mon, 12 Nov 2018 10:11:40 +0000 (11:11 +0100)] 
Reindent nptl/pthread_rwlock_common.c

5 years agoRemove x86 mathinline.h hypot inline.
Joseph Myers [Wed, 12 Dec 2018 22:33:06 +0000 (22:33 +0000)] 
Remove x86 mathinline.h hypot inline.

Continuing the removal of bits/mathinline.h inlines that would better
be done by the compiler, this patch removes an x86 inline for hypot
functions (only for fast-math, only for non-SSE 32-bit x86).  I've
filed <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88474> for adding
such an inline as an optimization in GCC.

Tested for x86_64 and x86.

* sysdeps/x86/fpu/bits/mathinline.h (hypot): Remove inline
definition.

5 years agobenchtests: send non-consumable data to stderr
Leonardo Sandoval [Mon, 10 Dec 2018 21:20:23 +0000 (15:20 -0600)] 
benchtests: send non-consumable data to stderr

Non-consumable data, alias data not related to benchmarks, should be sent to
the standard error, thus pipelines can work as expected.

* benchtests/scripts/compare_bench.py (do_compare): write to stderr in case
    stat is not present.
* benchtests/scripts/compare_bench.py (plot_graphs): write to stderr in case
    timings field is not present. Also string showing the output filename goes
    into the stderr.

5 years agobenchtests: include --stats parameter
Leonardo Sandoval [Mon, 10 Dec 2018 21:15:34 +0000 (15:15 -0600)] 
benchtests: include --stats parameter

Allows user to pick a statistic, defaulting to min and mean, from command
line. At the same time, if stat does not exit, catch the run-time exception
and keep comparing the rest of benchmarked functions. Finally, take care of
division-by-zero exceptions and as the latter, keep comparing the rest of the
functions, turning the script a bit more fault tolerant thus useful.

* benchtests/scripts/compare_bench.py (do_compare): Catch KeyError and
    ZeroDivisorError exceptions.
* benchtests/scripts/compare_bench.py (compare_runs): Use stats argument to
    loop through user provided statistics.
* benchtests/scripts/compare_bench.py (main): Include the --stats argument.

5 years agobenchtests: keep comparing even if function timings do not match
Leonardo Sandoval [Mon, 10 Dec 2018 20:52:23 +0000 (14:52 -0600)] 
benchtests: keep comparing even if function timings do not match

Allows other functions to be processed, making the script a bit more fault
tolerant thus useful.

* benchtests/scripts/compare_bench.py (compare_runs): Continue instead of return.

5 years agotimespec_get (posix): Fix copyright header
Florian Weimer [Wed, 12 Dec 2018 16:13:17 +0000 (17:13 +0100)] 
timespec_get (posix): Fix copyright header

The “any later version” clause was missing.  This change was approved
in principle by the FSF in RT ticket #1316403.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
5 years agopowerpc: Add missing CFI register information (bug #23614)
Tulio Magno Quites Machado Filho [Wed, 12 Dec 2018 12:41:52 +0000 (10:41 -0200)] 
powerpc: Add missing CFI register information (bug #23614)

Add CFI information about the offset of registers stored in the stack
frame.

[BZ #23614]
* sysdeps/powerpc/powerpc64/addmul_1.S (FUNC): Add CFI offset for
registers saved in the stack frame.
* sysdeps/powerpc/powerpc64/lshift.S (__mpn_lshift): Likewise.
* sysdeps/powerpc/powerpc64/mul_1.S (__mpn_mul_1): Likewise.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
5 years agoAdd *-ldbl.h headers to include/bits
Gabriel F. T. Gomes [Fri, 23 Nov 2018 16:00:06 +0000 (14:00 -0200)] 
Add *-ldbl.h headers to include/bits

On some platforms, long double may have either the same format as double
or another, wider format, such as the Quadruple IEC 60559 long double
format or the IBM Extended Precision format (both 128-bits wide).
Selecting between the available formats is done by using one of the
following compiler switches: -mlong-double-128, for the wider format, or
-mlong-double-64, for the narrower.  On all platforms that provide this
choice, the wider format is the default.

When the non-default format is selected by user code (i.e.: when
building with -mlong-double-64) calls to functions that take long double
parameters or return a long double type (e.g.: strfroml) are redirected
to a compat function, via assembler redirection, by headers such as
bits/stdlib-ldbl.h or bits/misc-ldbl.h.

In glibc builds, however, these headers are currently being read from
the system directories (/usr/include/bits) rather than from the source
directory.  Although this works correctly today, it raises
reproducibility concerns.  Besides that, builds for powerpc64le will
need these files from the source directory, because on powerpc64le, the
new redirections for long double with IEEE binary128 format will be
implemented in these headers.

Tested for powerpc64 and powerpc64le.

5 years agoRemove redirection of _IO_vfprintf
Gabriel F. T. Gomes [Wed, 5 Dec 2018 21:16:12 +0000 (19:16 -0200)] 
Remove redirection of _IO_vfprintf

Since the commit

commit 698fb75b9ff5ae454a1344b5f9fafa0ca367c555
Author: Zack Weinberg <zackw@panix.com>
Date:   Wed Mar 7 14:32:01 2018 -0500

    Add __v*printf_internal with flags arguments

_IO_vfprintf is gone.  This did not trigger any test case failures on
powerpc and powerpc64le, because there were no tests that covered it.
However, new test cases for nldbl versions of argp.h functions exposed
the problem.

Tested for powerpc64 and powerpc64le.

5 years agoRemove support for abilist-pattern
Andreas Schwab [Wed, 28 Nov 2018 16:23:59 +0000 (17:23 +0100)] 
Remove support for abilist-pattern

5 years agoFix powf overflow handling in non-nearest rounding mode [BZ #23961]
Szabolcs Nagy [Mon, 10 Dec 2018 11:08:36 +0000 (11:08 +0000)] 
Fix powf overflow handling in non-nearest rounding mode [BZ #23961]

The threshold value at which powf overflows depends on the rounding mode
and the current check did not take this into account. So when the result
was rounded away from zero it could become infinity without setting
errno to ERANGE.

Example: pow(0x1.7ac7cp+5, 23) is 0x1.fffffep+127 + 0.1633ulp

If the result goes above 0x1.fffffep+127 + 0.5ulp then errno is set,
which is fine in nearest rounding mode, but

  powf(0x1.7ac7cp+5, 23) is inf in upward rounding mode
  powf(-0x1.7ac7cp+5, 23) is -inf in downward rounding mode

and the previous implementation did not set errno in these cases.

The fix tries to avoid affecting the common code path or calling a
function that may introduce a stack frame, so float arithmetics is used
to check the rounding mode and the threshold is selected accordingly.

[BZ #23961]
* math/auto-libm-test-in: Add new test case.
* math/auto-libm-test-out-pow: Regenerated.
* sysdeps/ieee754/flt-32/e_powf.c (__powf): Fix overflow check.