about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* S390: Refactor strcmp ifunc handling.Stefan Liebler2018-12-1811-104/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor strncat ifunc handling.Stefan Liebler2018-12-188-16/+123
| | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor strcat ifunc handling.Stefan Liebler2018-12-188-21/+123
| | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor stpncpy ifunc handling.Stefan Liebler2018-12-188-22/+128
| | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor strncpy ifunc handling.Stefan Liebler2018-12-1811-66/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor stpcpy ifunc handling.Stefan Liebler2018-12-188-26/+133
| | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor strcpy ifunc handling.Stefan Liebler2018-12-1811-103/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor strnlen ifunc handling.Stefan Liebler2018-12-188-21/+128
| | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor strlen ifunc handling.Stefan Liebler2018-12-188-20/+123
| | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Add z13 memmem ifunc variant.Stefan Liebler2018-12-187-1/+228
| | | | | | | | | | | | | | | | 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.
* S390: Add z13 strstr ifunc variant.Stefan Liebler2018-12-187-1/+201
| | | | | | | | | | | | | | | | 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.
* S390: Add z13 memmove ifunc variant.Stefan Liebler2018-12-187-1/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Add configure check to detect z13 as mininum architecture level set.Stefan Liebler2018-12-184-0/+75
| | | | | | | | | | 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.
* S390: Use memcpy for forward cases in memmove.Stefan Liebler2018-12-182-0/+27
| | | | | | | | | | 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.
* S390: Remove s390 specific implementation of bcopy.Stefan Liebler2018-12-183-156/+5
| | | | | | | | | | | | | | | | | 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.
* S390: Refactor memcpy/mempcpy ifunc handling.Stefan Liebler2018-12-1810-195/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Unify 31/64bit memcpy.Stefan Liebler2018-12-1810-281/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Refactor memcmp ifunc handling.Stefan Liebler2018-12-188-148/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Unify 31/64bit memcmp.Stefan Liebler2018-12-1810-219/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Implement bzero with memset.Stefan Liebler2018-12-187-68/+100
| | | | | | | | | | | | | | | | | 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.
* S390: Refactor memset ifunc handling.Stefan Liebler2018-12-188-146/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Unify 31/64bit memset.Stefan Liebler2018-12-1810-230/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* S390: Use hwcap instead of dl_hwcap in ifunc-resolvers.Stefan Liebler2018-12-182-6/+12
| | | | | | | | | | | | | | | 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.
* S390: Add configure check to detect z10 as mininum architecture level set.Stefan Liebler2018-12-184-0/+77
| | | | | | | | | | 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.
* x86: Merge i386/x86_64 atomic-machine.hH.J. Lu2018-12-183-621/+171
| | | | | | | | | | 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.
* locale: Rewrite locale/gen-translit.pl in PythonFlorian Weimer2018-12-1810-2364/+1581
| | | | | | This commit does not change the generated output file. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* localedata: Remove executable bit from localedata/locales/bi_VU [BZ #23995]Florian Weimer2018-12-182-0/+5
|
* Fix __TIMERSIZE and @theglibcadj typosAlbert ARIBAUD (3ADEV)2018-12-182-2/+2
| | | | | | Fix following typos in parent commit: - ChangeLog: __TIMERSIZE should be __TIMESIZE - manual/maint.texi: @theglibcadj should be @glibcadj
* Y2038: add function __localtime64Albert ARIBAUD (3ADEV)2018-12-174-1/+157
| | | | | | | | | | | 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.
* Do not clobber r12 for ia64 syscalls.Joseph Myers2018-12-172-1/+4
| | | | | | | | | | | | | 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.
* Add test that MAP_* constants agree with kernel.Joseph Myers2018-12-174-4/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add statx conditionals for wordsize-32 *xstat.cMao Han2018-12-1714-6/+186
| | | | | | | | | | | | | | | | | | | | | | | 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.
* regex: fix storage-exhaustion errorPaul Eggert2018-12-162-0/+9
| | | | | | [BZ #18040] * posix/regexec.c (get_subexp): Do not continue if storage is exhausted.
* regex: fix heap-use-after-free errorAssaf Gordon2018-12-162-0/+14
| | | | | | | | | | | | [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.
* support: Do not require overflow builtin in support/blob_repeat.cFlorian Weimer2018-12-152-3/+29
| | | | | | It is only available in GCC 5 and later. Tested-by: Romain Naour <romain.naour@gmail.com>
* Remove x86 mathinline.h asinh, acosh, atanh inlines.Joseph Myers2018-12-142-13/+7
| | | | | | | | | | | | | | | 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.
* manual: Document thread/task IDs for LinuxFlorian Weimer2018-12-143-18/+56
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Add tests for the long double version of ecvt and fcvtGabriel F. T. Gomes2018-12-145-28/+128
| | | | | | | | | | 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.
* Add missing libnss_testX.so requirement for tst-nss-test3.Stefan Liebler2018-12-142-1/+5
| | | | | | | | | | | | | | | 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.
* Do not clobber sp in _hurd_stack_setup.Joseph Myers2018-12-132-1/+6
| | | | | | | | | | | | | 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.
* x86: Add Hygon Dhyana support.Carlos O'Donell2018-12-132-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix rwlock stall with PREFER_WRITER_NONRECURSIVE_NP (bug 23861)Andreas Schwab2018-12-134-2/+95
| | | | | | | | | | 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).
* Reindent nptl/pthread_rwlock_common.cAndreas Schwab2018-12-132-78/+84
|
* Remove x86 mathinline.h hypot inline.Joseph Myers2018-12-122-4/+5
| | | | | | | | | | | | | 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.
* benchtests: send non-consumable data to stderrLeonardo Sandoval2018-12-122-3/+12
| | | | | | | | | | | 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.
* benchtests: include --stats parameterLeonardo Sandoval2018-12-122-9/+27
| | | | | | | | | | | | | | 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.
* benchtests: keep comparing even if function timings do not matchLeonardo Sandoval2018-12-122-1/+6
| | | | | | | 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.
* timespec_get (posix): Fix copyright headerFlorian Weimer2018-12-122-1/+6
| | | | | | | 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>
* powerpc: Add missing CFI register information (bug #23614)Tulio Magno Quites Machado Filho2018-12-124-18/+46
| | | | | | | | | | | | | | 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>
* Add *-ldbl.h headers to include/bitsGabriel F. T. Gomes2018-12-117-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.