about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64
Commit message (Collapse)AuthorAgeFilesLines
* [BZ #20271] Add newlines in __libc_fatal calls.Paul Pluzhnikov2018-08-311-1/+1
|
* powerpc: Remove powerpc specific sinf and cosf optimizationRajalakshmi Srinivasaraghavan2018-08-209-1191/+0
| | | | | | | New generic optimization of sinf and cosf introduced by commit 599cf3976679e1b345307d9c02057f02aa95528f shows improvement compared to powerpc specific assembly version. Hence removing the powerpc assembly versions to make use of generic code.
* powerpc: Rearrange little endian specific filesRajalakshmi Srinivasaraghavan2018-08-168-24/+31
| | | | | | This patch moves little endian specific POWER9 optimization files to sysdeps/powerpc/powerpc64/le and creates POWER9 ifunc functions only for little endian.
* powerpc64: Always restore TOC on longjmp [BZ #21895]Rogerio Alves2018-07-164-4/+139
| | | | | | | | | | | | | | | | | | | This patch changes longjmp to always restore the TOC pointer (r2 register) to the caller frame on powerpc64 and powerpc64le. This is related to bug 21895 that reports a situation where you have a static longjmp to a shared object file. [BZ #21895] * sysdeps/powerpc/powerpc64/__longjmp-common.S: Remove condition code for restoring r2 in longjmp. * sysdeps/powerpc/powerpc64/Makefile: Added tst-setjmp-bug21895-static to test list. Added rules to build test tst-setjmp-bug21895-static. Added module setjmp-bug21895 and rules to build a shared object from it. * sysdeps/powerpc/powerpc64/setjmp-bug21895.c: New test file. * sysdeps/powerpc/powerpc64/tst-setjmp-bug21895-static.c: New test file. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* Fix powerpc64le build of nan-sign tests (bug 23303).Joseph Myers2018-06-181-1/+4
| | | | | | | | | | | | | | | | My recent nan-sign tests fail to build for powerpc64le with GCC 8 because of the special compile / link options needed there for any test using _Float128. This patch arranges for these tests to be handled on powerpc64le similarly to other such tests. Tested with build-many-glibcs.py for powerpc64le. [BZ #23303] * sysdeps/powerpc/powerpc64/le/Makefile (CFLAGS-tst-strtod-nan-sign.c): Add -mfloat128. (CFLAGS-tst-wcstod-nan-sign.c): Likewise. (gnulib-tests): Also add $(f128-loader-link) for tst-strtod-nan-sign abd tst-wcstod-nan-sign.
* Mark _init and _fini as hidden [BZ #23145]H.J. Lu2018-06-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _init and _fini are special functions provided by glibc for linker to define DT_INIT and DT_FINI in executable and shared library. They should never be put in dynamic symbol table. This patch marks them as hidden to remove them from dynamic symbol table. Tested with build-many-glibcs.py. [BZ #23145] * elf/Makefile (tests-special): Add $(objpfx)check-initfini.out. ($(all-built-dso:=.dynsym): New target. (common-generated): Add $(all-built-dso:$(common-objpfx)%=%.dynsym). ($(objpfx)check-initfini.out): New target. (generated): Add check-initfini.out. * scripts/check-initfini.awk: New file. * sysdeps/aarch64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/alpha/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/arm/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/hppa/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/i386/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/ia64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/m68k/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/microblaze/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/mips/mips32/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/mips/mips64/n32/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/mips/mips64/n64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/nios2/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/powerpc/powerpc32/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/powerpc/powerpc64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/s390/s390-32/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/s390/s390-64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/sh/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/sparc/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/x86_64/crti.S (_init): Mark as hidden. (_fini): Likewise.
* powerpc64le: Fix TFtype in sqrtf128 when using -mabi=ieeelongdoubleTulio Magno Quites Machado Filho2018-06-061-3/+8
| | | | | | | | | | | | | | | | When building with -mlong-double-128 or -mabi=ibmlongdouble, TFtype represents the IBM 128-bit extended floating point type, while KFtype represents the IEEE 128-bit floating point type. The soft float implementation of e_sqrtf128 had to redefine TFtype and TF in order to workaround this issue. However, this behavior changes when -mabi=ieeelongdouble is used and the macros are not necessary. * sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c [__HAVE_FLOAT128_UNLIKE_LDBL] (TFtype, TF): Restrict TFtype and TF redirection to KFtype and KF only when the default long double type is not the IEEE 128-bit floating point type. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* powerpc: Add multiarch sqrtf128 for ppc64leRajalakshmi Srinivasaraghavan2018-05-304-0/+107
| | | | | | | This patch creates ifunc for sqrtf128() to make use of new xssqrtqp instruction for POWER9 when --enable-multi-arch and --with-cpu=power8 options are used on power9 system. This is achieved by explicitly adding -mcpu=power9 flag for sqrtf128-power9.
* powerpc: Move around math-related ImpliesTulio Magno Quites Machado Filho2018-05-242-0/+10
| | | | | | | | | | | | | | | Currently, powerpc, powerpc64, and powerpc64le imply the same set of subdirectories from sysdeps/ieee754: flt-32, dbl-64, ldbl-128ibm, and ldbl-opt. In preparation for the transition of the long double format - from IBM Extended Precision to IEEE 754 128-bits floating-point - on powerpc64le, this patch splits the shared Implies file into three separate files (one for each of the powerpc architectures), without changing their contents. Future patches will modify powerpc64le. * sysdeps/powerpc/Implies: Removed. Previous contents copied to... * sysdeps/powerpc/powerpc32/Implies-after: ... here. * sysdeps/powerpc/powerpc64/be/Implies-after: ... here. * sysdeps/powerpc/powerpc64/le/Implies-before: ... and here.
* powerpc64*: fix the order of implied sysdeps directoriesGabriel F. T. Gomes2018-04-2791-39/+502
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The creation of the divergent sysdeps directory for powerpc64le commit 2f7f3cd8cd302bb10908c86f3f7b349df0a78e6a Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com> Date: Fri Jul 15 18:04:40 2016 -0500 powerpc64le: Create divergent sysdep directory for powerpc64le. allowed float128 to be enabled for powerpc64le (little-endian) and not for powerpc64 (big-endian). Since the only intended difference between them was the presence or absence of the float128 interface, the sysdeps directory for powerpc64le explicitly reused the files from powerpc64 (through the use of Implies files). Although this works, it also means that files under the powerpc64 directory might be preferred over files under powerpc64le. For instance, on a build for powerpc64le with target set to power9, a file from powerpc64/power5 might get built, even though a file with the same name exists in powerpc64le/power8. That happens because the processor hierarchy was only defined in the sysdeps directory for powerpc64 (and borrowed by powerpc64le). This patch fixes this behavior, by creating new subdirectories under powerpc64 (i.e.: powerpc64/be and powerpc64/le) and creating new Implies files to provide the hierarchy of processors for powerpc64 and powerpc64le separately. These changes have no effect on installed, stripped binaries (which remain unchanged). Tested that installed stripped binaries are unchanged and that there are no regressions on powerpc64 and powerpc64le.
* elf: Unify symbol address run-time calculation [BZ #19818]Maciej W. Rozycki2018-04-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrap symbol address run-time calculation into a macro and use it throughout, replacing inline calculations. There are a couple of variants, most of them different in a functionally insignificant way. Most calculations are right following RESOLVE_MAP, at which point either the map or the symbol returned can be checked for validity as the macro sets either both or neither. In some places both the symbol and the map has to be checked however. My initial implementation therefore always checked both, however that resulted in code larger by as much as 0.3%, as many places know from elsewhere that no check is needed. I have decided the size growth was unacceptable. Having looked closer I realized that it's the map that is the culprit. Therefore I have modified LOOKUP_VALUE_ADDRESS to accept an additional boolean argument telling it to access the map without checking it for validity. This in turn has brought quite nice results, with new code actually being smaller for i686, and MIPS o32, n32 and little-endian n64 targets, unchanged in size for x86-64 and, unusually, marginally larger for big-endian MIPS n64, as follows: i686: text data bss dec hex filename 152255 4052 192 156499 26353 ld-2.27.9000-base.so 152159 4052 192 156403 262f3 ld-2.27.9000-elf-symbol-value.so MIPS/o32/el: text data bss dec hex filename 142906 4396 260 147562 2406a ld-2.27.9000-base.so 142890 4396 260 147546 2405a ld-2.27.9000-elf-symbol-value.so MIPS/n32/el: text data bss dec hex filename 142267 4404 260 146931 23df3 ld-2.27.9000-base.so 142171 4404 260 146835 23d93 ld-2.27.9000-elf-symbol-value.so MIPS/n64/el: text data bss dec hex filename 149835 7376 408 157619 267b3 ld-2.27.9000-base.so 149787 7376 408 157571 26783 ld-2.27.9000-elf-symbol-value.so MIPS/o32/eb: text data bss dec hex filename 142870 4396 260 147526 24046 ld-2.27.9000-base.so 142854 4396 260 147510 24036 ld-2.27.9000-elf-symbol-value.so MIPS/n32/eb: text data bss dec hex filename 142019 4404 260 146683 23cfb ld-2.27.9000-base.so 141923 4404 260 146587 23c9b ld-2.27.9000-elf-symbol-value.so MIPS/n64/eb: text data bss dec hex filename 149763 7376 408 157547 2676b ld-2.27.9000-base.so 149779 7376 408 157563 2677b ld-2.27.9000-elf-symbol-value.so x86-64: text data bss dec hex filename 148462 6452 400 155314 25eb2 ld-2.27.9000-base.so 148462 6452 400 155314 25eb2 ld-2.27.9000-elf-symbol-value.so [BZ #19818] * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Add `set' parameter. (SYMBOL_ADDRESS): New macro. [!ELF_FUNCTION_PTR_IS_SPECIAL] (DL_SYMBOL_ADDRESS): Use SYMBOL_ADDRESS for symbol address calculation. * elf/dl-runtime.c (_dl_fixup): Likewise. (_dl_profile_fixup): Likewise. * elf/dl-symaddr.c (_dl_symbol_address): Likewise. * elf/rtld.c (dl_main): Likewise. * sysdeps/aarch64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/alpha/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/arm/dl-machine.h (elf_machine_rel): Likewise. (elf_machine_rela): Likewise. * sysdeps/hppa/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/hppa/dl-symaddr.c (_dl_symbol_address): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise. (elf_machine_rela): Likewise. * sysdeps/ia64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/microblaze/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/mips/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC): Likewise. (elf_machine_reloc): Likewise. (elf_machine_got_rel): Likewise. * sysdeps/mips/dl-trampoline.c (__dl_runtime_resolve): Likewise. * sysdeps/nios2/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/riscv/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/tile/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Don't include math.h/math_private.h in math_ldbl_opt.h.Zack Weinberg2018-03-103-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sysdeps/ieee754/ldbl-opt version of math_ldbl_opt.h includes math.h and math_private.h, despite not having any need for those headers itself; the sysdeps/generic version doesn't. About 20 files are relying on math_ldbl_opt.h to include math.h and/or math_private.h for them, even though none of them necessarily used on a platform that needs ldbl-opt support. * sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h: Don't include math.h or math_private.h. * sysdeps/alpha/fpu/s_isnan.c * sysdeps/ieee754/ldbl-128ibm/s_ceill.c * sysdeps/ieee754/ldbl-128ibm/s_floorl.c * sysdeps/ieee754/ldbl-128ibm/s_llrintl.c * sysdeps/ieee754/ldbl-128ibm/s_llroundl.c * sysdeps/ieee754/ldbl-128ibm/s_lrintl.c * sysdeps/ieee754/ldbl-128ibm/s_lroundl.c * sysdeps/ieee754/ldbl-128ibm/s_rintl.c * sysdeps/ieee754/ldbl-128ibm/s_roundl.c * sysdeps/ieee754/ldbl-128ibm/s_truncl.c * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot.c * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf.c: * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c * sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c * sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c: Include math_private.h. * sysdeps/ieee754/ldbl-64-128/s_finitel.c * sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c * sysdeps/ieee754/ldbl-64-128/s_isinfl.c * sysdeps/ieee754/ldbl-64-128/s_isnanl.c * sysdeps/ieee754/ldbl-64-128/s_signbitl.c * sysdeps/powerpc/power7/fpu/s_logb.c: Include math.h and math_private.h.
* powerpc: Fix syscalls during early process initialization [BZ #22685]Tulio Magno Quites Machado Filho2018-01-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The tunables framework needs to execute syscall early in process initialization, before the TCB is available for consumption. This behavior conflicts with powerpc{|64|64le}'s lock elision code, that checks the TCB before trying to abort transactions immediately before executing a syscall. This patch adds a powerpc-specific implementation of __access_noerrno that does not abort transactions before the executing syscall. Tested on powerpc{|64|64le}. [BZ #22685] * sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION_IMPL): Renamed from ABORT_TRANSACTION. (ABORT_TRANSACTION): Redirect to ABORT_TRANSACTION_IMPL. * sysdeps/powerpc/powerpc64/sysdep.h (ABORT_TRANSACTION, ABORT_TRANSACTION_IMPL): Likewise. * sysdeps/unix/sysv/linux/powerpc/not-errno.h: New file. Reuse Linux code, but remove the code that aborts transactions. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> Tested-by: Aurelien Jarno <aurelien@aurel32.net>
* powerpc: Fix error message during relocation overflowTulio Magno Quites Machado Filho2018-01-051-1/+4
| | | | | | | | | | | | The function _itoa_word() writes characters from the higher address to the lower address, requiring the destination string to reserve that size before calling it. * sysdeps/powerpc/powerpc64/dl-machine.c (_dl_reloc_overflow): Reserve 16 chars to reloc_addr before calling _itoa_word. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-01355-355/+355
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* powerpc: st{r,p}cpy optimization for aligned stringsRajalakshmi Srinivasaraghavan2017-12-151-3/+146
| | | | | | | This patch makes use of vectors for aligned inputs. Improvements upto 30% seen for larger aligned inputs. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* powerpc: POWER8 memcpy optimization for cached memoryAdhemerval Zanella2017-12-115-13/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On POWER8, unaligned memory accesses to cached memory has little impact on performance as opposed to its ancestors. It is disabled by default and will only be available when the tunable glibc.tune.cached_memopt is set to 1. __memcpy_power8_cached __memcpy_power7 ============================================================ max-size=4096: 33325.70 ( 12.65%) 38153.00 max-size=8192: 32878.20 ( 11.17%) 37012.30 max-size=16384: 33782.20 ( 11.61%) 38219.20 max-size=32768: 33296.20 ( 11.30%) 37538.30 max-size=65536: 33765.60 ( 10.53%) 37738.40 * manual/tunables.texi (Hardware Capability Tunables): Document glibc.tune.cached_memopt. * sysdeps/powerpc/cpu-features.c: New file. * sysdeps/powerpc/cpu-features.h: New file. * sysdeps/powerpc/dl-procinfo.c [!IS_IN(ldconfig)]: Add _dl_powerpc_cpu_features. * sysdeps/powerpc/dl-tunables.list: New file. * sysdeps/powerpc/ldsodefs.h: Include cpu-features.h. * sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h (INIT_ARCH): Initialize use_aligned_memopt. * sysdeps/powerpc/powerpc64/dl-machine.h [defined(SHARED && IS_IN(rtld))]: Restrict dl_platform_init availability and initialize CPU features used by tunables. * sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines): Add memcpy-power8-cached. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Add __memcpy_power8_cached. * sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S: New file. Reviewed-by: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
* Add elision tunablesRogerio Alves2017-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds several new tunables to control the behavior of elision on supported platforms[1]. Since elision now depends on tunables, we should always *compile* with elision enabled, and leave the code disabled, but available for runtime selection. This gives us *much* better compile-time testing of the existing code to avoid bit-rot[2]. Tested on ppc, ppc64, ppc64le, s390x and x86_64. [1] This part of the patch was initially proposed by Paul Murphy but was "staled" because the framework have changed since the patch was originally proposed: https://patchwork.sourceware.org/patch/10342/ [2] This part of the patch was inititally proposed as a RFC by Carlos O'Donnell. Make sense to me integrate this on the patch: https://sourceware.org/ml/libc-alpha/2017-05/msg00335.html * elf/dl-tunables.list: Add elision parameters. * manual/tunables.texi: Add entries about elision tunable. * sysdeps/unix/sysv/linux/powerpc/elision-conf.c: Add callback functions to dynamically enable/disable elision. Add multiple callbacks functions to set elision parameters. Deleted __libc_enable_secure check. * sysdeps/unix/sysv/linux/s390/elision-conf.c: Likewise. * sysdeps/unix/sysv/linux/x86/elision-conf.c: Likewise. * configure: Regenerated. * configure.ac: Option enable_lock_elision was deleted. * config.h.in: ENABLE_LOCK_ELISION flag was deleted. * config.make.in: Remove references to enable_lock_elision. * manual/install.texi: Elision configure option was removed. * INSTALL: Regenerated to remove enable_lock_elision. * nptl/Makefile: Disable elision so it can verify error case for destroying a mutex. * sysdeps/powerpc/nptl/elide.h: Cleanup ENABLE_LOCK_ELISION check. Deleted macros for the case when ENABLE_LOCK_ELISION was not defined. * sysdeps/s390/configure: Regenerated. * sysdeps/s390/configure.ac: Remove references to enable_lock_elision.. * nptl/tst-mutex8.c: Deleted all #ifndef ENABLE_LOCK_ELISION from the test. * sysdeps/powerpc/powerpc32/sysdep.h: Deleted all ENABLE_LOCK_ELISION checks. * sysdeps/powerpc/powerpc64/sysdep.h: Likewise. * sysdeps/powerpc/sysdep.h: Likewise. * sysdeps/s390/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/force-elision.h: Likewise. * sysdeps/unix/sysv/linux/s390/elision-conf.h: Likewise. * sysdeps/unix/sysv/linux/s390/force-elision.h: Likewise. * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/s390/Makefile: Remove references to enable-lock-elision. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* Use libm_alias_float for powerpc.Joseph Myers2017-12-0532-41/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes powerpc libm function implementations use libm_alias_float to define function aliases. Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged for all its hard-float powerpc configurations. * sysdeps/powerpc/fpu/s_cosf.c: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/powerpc/fpu/s_fabs.S: Include <libm-alias-float.h>. (fabsf): Define using libm_alias_float. * sysdeps/powerpc/fpu/s_fmaf.S: Include <libm-alias-float.h>. (fmaf): Define using libm_alias_float. * sysdeps/powerpc/fpu/s_rintf.c: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/powerpc/fpu/s_sinf.c: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float. * sysdeps/powerpc/power5+/fpu/s_modff.c: Include <libm-alias-float.h>. (modff): Define using libm_alias_float. * sysdeps/powerpc/power7/fpu/s_logbf.c: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_lround.S: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S: Include <libm-alias-float.h>. (nearbyintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_rintf.S: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c: Include <libm-alias-float.h>. (modff): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c: Include <libm-alias-float.h>. (modff): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S: Include <libm-alias-float.h>. (nearbyintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float.
* Use libm_alias_double for remaining powerpc functions.Joseph Myers2017-12-0213-167/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes the remaining double powerpc functions use libm_alias_double to define function aliases (with consequent removal of the need for local compat symbol handling). Previous cleanups avoid this patch changing installed stripped shared libraries for any build-many-glibcs.py configuration (there are still some functions in this patch for which the order of double and float aliases changes within an individual source file, but in this case this doesn't result in changes to the final library). Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged for all its hard-float powerpc configurations. * sysdeps/powerpc/power7/fpu/s_logb.c: Include <libm-alias-double.h>. (logb): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Include <libm-alias-double.h>. (copysign): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_llrint.c: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_llround.c: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Include <libm-alias-double.h>. (lrint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_lround.S: Include <libm-alias-double.h>. (lround): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c: Include <libm-alias-double.h>. (copysign): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint.c: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround.c: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c: Include <libm-alias-double.h>. (logb): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint.c: Include <libm-alias-double.h>. (lrint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround.c: Include <libm-alias-double.h>. (lround): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Include <libm-alias-double.h>. (lround): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Include <libm-alias-double.h>. (copysign): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: Include <libm-alias-double.h>. (lrint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: Include <libm-alias-double.h>. (lround): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c: Include <libm-alias-double.h>. (copysign): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. (lrint): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. (lround): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c: Include <libm-alias-double.h>. (logb): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Include <libm-alias-double.h>. (copysign): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. (lrint): Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llround.S: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. (lround): Likewise. * sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. (lround): Likewise. * sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Include <libm-alias-double.h>. (copysign): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. (lrint): Likewise. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. (lround): Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. (lrint): Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. (lround): Likewise.
* Define powerpc64 lroundl compat symbol only once.Joseph Myers2017-12-011-1/+0
| | | | | | | | | | | | | | | sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c defines the lroundl compat symbol, version GLIBC_2_1, twice, once based on llround and once based on __lround. Those are aliases for each other (llround weak, __lround strong), but defining it twice does not make sense. This patch changes it to define the compat symbol once only, matching how libm_alias_double defines it. Tested with build-many-glibcs.py for its powerpc64 configurations. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c [LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)] (lroundl): Do not define compat symbol based on llround.
* Base powerpc logbl compat symbols on __logb not logb.Joseph Myers2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | Some powerpc logb implementations define a compat symbol for logbl based on logb, whereas libm_alias_double defines such a compat symbol based on __logb instead. This difference (logb is weak, __logb isn't) is enough to result in different installed stripped shared libraries. The difference in the installed libraries isn't significant, but first changing the compat_symbol calls helps make it possible to validate a subsequent change to use libm_alias_double by comparison of libraries, so this patch does such a preliminary change. Tested with build-many-glibcs.py for all its hard-float powerpc configurations. * sysdeps/powerpc/power7/fpu/s_logb.c [LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Define as compat symbol based on __logb, not on logb. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c [LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c [LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Likewise.
* Ues libm_alias_double for various powerpc functions.Joseph Myers2017-12-0115-136/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch various powerpc functions use libm_alias_double to define function aliases (with consequent removal of the need for local compat symbol handling). (The present patch excludes the changes to some functions where such changes could result in differences in installed stripped shared libraries because of changes to the exact ordering or properties of symbols in individual .os files.) Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged for all its hard-float powerpc configurations. * sysdeps/powerpc/fpu/s_rint.c: Include <libm-alias-double.h>. (rint): Define using libm_alias_double. * sysdeps/powerpc/power5+/fpu/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_ceil.S: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_floor.S: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S: Include <libm-alias-double.h>. (nearbyint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_rint.S: Include <libm-alias-double.h>. (rint): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_round.S: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_trunc.S: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil.c: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor.c: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc.c: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/s_floor.S: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S: Include <libm-alias-double.h>. (nearbyint): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/s_rint.S: Include <libm-alias-double.h>. (rint): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/s_round.S: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double.
* Use libm_alias_double for powerpc fabs, fma.Joseph Myers2017-12-012-10/+0
| | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes powerpc fabs and fma use libm_alias_double to define function aliases. This brings in automatic symbol versioning compat handling, so the powerpc32 and powerpc64 wrappers that added such handling to the generic sysdeps/powerpc/fpu versions are removed as no longer required (there are no sysdeps directory ordering issues that would necessitate keeping trivial wrappers there). Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged for all its hard-float powerpc configurations. * sysdeps/powerpc/fpu/s_fabs.S: Include <libm-alias-double.h>. (fabs): Define using libm_alias_double. * sysdeps/powerpc/fpu/s_fma.S: Include <libm-alias-double.h>. (fma): Define using libm_alias_double. * sysdeps/powerpc/powerpc32/fpu/s_fabs.S: Remove file. * sysdeps/powerpc/powerpc32/fpu/s_fma.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_fabs.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_fma.S: Likewise.
* powerpc: Use latest optimization for internal function callsRajalakshmi Srinivasaraghavan2017-11-071-1/+1
| | | | | | | Update strcasestr-power8 to use power8 version of strnlen for calculating length. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* [PowerPC64] sysdep.h doesn't need to be included in multiarch filesAlan Modra2017-10-3196-193/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the .c/.S file neither uses nor modifies macros defined in sysdep.h there is no point to #include it. The same goes for math_ldbl_opt.h except that it includes shlib-compat.h, and if compat_symbol is redefined we need to include shlib-compat.h first. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S: Don't include sysdep.h. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset-power4.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset-power6.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S: Don't include sysdep.h and math_ldbl_opt.h. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S: Don't include sysdep.h and math_ldbl_opt.h. Include shlib-compat.h. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S: Likewise.
* [PowerPC64] strncase_l-power7.c should use strncase_l.cAlan Modra2017-10-311-2/+4
| | | | | | | | | | This is another one where we'll be wanting the base symbols for powerpc64le rather than just a power7 variant. * sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c: Include string/strncase_l.c, not string/strncase.c. (USE_IN_EXTENDED_LOCALE_MODEL): Don't define. (libc_hidden_def): Redefine.
* [PowerPC64] Tidy strcasecmp_l-power7.S symbolsAlan Modra2017-10-311-1/+3
| | | | | | | | | | | The routine being assembled here is strcasecmp_l, so ask for that via __STRCMP and STRCMP defines. That change means tweaking the power7 override. Needed for later powerpc64le changes where we want the base symbols, not just a power7 variant. * sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S: (__STRCMP, STRCMP, __strcasecmp_l): Define. (__strcasecmp): Don't define.
* [PowerPC64] Wrap str{,n}cmp-power{8,9}.S in IS_IN(libc)Alan Modra2017-10-314-0/+8
| | | | | | | | | | | These functions aren't used in ld.so at the moment since we don't have strcmp or strncmp ifuncs for them there. Remove the ld.so bloat. * sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S: Wrap in IS_IN (libc). * sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S: Likewise.
* [PowerPC64] Remove duplicate define in stpncpy-power8.SAlan Modra2017-10-311-2/+0
| | | | | | | | USE_AS_STPNCPY is defined by sysdeps/powerpc/powerpc64/power8/stpncpy.S, included by this file. * sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S: Don't define USE_AS_STPNCPY.
* [PowerPC64] Don't define __GI_ variant of isnan for static libAlan Modra2017-10-311-3/+5
| | | | | | | | | | | | | | It seems to me that libc.a should not contain any of the __GI_ symbols, and certainly --enable-multi-arch ought to not add to the list. At the end of this patch series we have the following in both --enable-multi-arch and --disable-multi-arch libc.a: 0000000000000000 T __GI___readdir64 0000000000000000 T __GI___fxstatat64 0000000000000000 T __GI_getrlimit 0000000000000000 T __GI___getrlimit * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S (hidden_def): Redefine only when SHARED.
* powerpc: Replace lxvd2x/stxvd2x with lvx/stvx in P7's memcpy/memmoveRajalakshmi Srinivasaraghavan2017-10-252-96/+96
| | | | | | | | | | | | | | | | POWER9 DD2.1 and earlier has an issue where some cache inhibited vector load traps to the kernel, causing a performance degradation. To handle this in memcpy and memmove, lvx/stvx is used for aligned addresses instead of lxvd2x/stxvd2x. Reference: https://patchwork.ozlabs.org/patch/814059/ * sysdeps/powerpc/powerpc64/power7/memcpy.S: Replace lxvd2x/stxvd2x with lvx/stvx. * sysdeps/powerpc/powerpc64/power7/memmove.S: Likewise. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* PowerPC64 power8 strncpy cfi fixesAlan Modra2017-10-231-13/+14
| | | | | | | | | | | | | | | | | | | | | cfi info for stack adjust needs to be on the insn doing the adjust. cfi describing register saves can be anywhere after the save insn but before the reg is altered. Fewer locations with cfi result in smaller cfi programs and possibly slightly faster exception handling. Thus the LR cfi_offset move. The idea behind ajusting sp after restoring regs is to break a register dependency chain, in this case not be using r1 immediately after it is modified. The missing LR cfi_restore meant that code after the blr, unaligned_lt_16 and other labels, would have cfi that said LR was at cfa+16, but that code is reached without LR being saved. * sysdeps/powerpc/powerpc64/power8/strncpy.S: Move LR cfi. Adjust stack after restoring regs. Add missing LR cfi_restore. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* PowerPC64 power7 strncpy stack handling and cfiAlan Modra2017-10-231-10/+13
| | | | | | | | | | | | | This patch moves the frame setup and teardown to immediately around the single memset call, as has been done for power8. I've also decreased FRAMESIZE to that needed to save the two callee-saved registers used. Plus added cfi. * sysdeps/powerpc/powerpc64/power7/strncpy.S: Decrease FRAMESIZE. Move LR save and frame setup/teardown and LR restore to immediately around memset call. Provide cfi. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* [BZ #22142] powerpc: Fix the carry bit on mpn_[add|sub]_n on POWER7Tulio Magno Quites Machado Filho2017-10-131-4/+4
| | | | | | | | | | | | | | | | | Fix the ifdef clause that was being used in the opposite way, setting a wrong value of the carry bit. This is also correcting 2 memory accesses that were mistakenly referring to r0 while they were supposed to mean the immediate value 0. [BZ #22142] * stdio-common/tst-printf.c (fp_test): Add tests for DBL_MAX and -DBL_MAX. (do_test): Likewise. * stdio-common/tst-printf.sh: Likewise. * sysdeps/powerpc/powerpc64/power7/add_n.S: Invert the initial ifdef clause in order to set the carry bit right. Replace r0 by 0 without changing the behavior.
* powerpc: Fix IFUNC for memrchrRajalakshmi Srinivasaraghavan2017-10-063-17/+31
| | | | | | | | | | | | | | | Recent commit 59ba2d2b5421 missed to add __memrchr_power8 in ifunc list. Also handled discarding unwanted bytes for unaligned inputs in power8 optimization. 2017-10-05 Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> * sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c: Revert back to powerpc32 file. * sysdeps/powerpc/powerpc64/multiarch/memrchr.c (memrchr): Add __memrchr_power8 to ifunc list. * sysdeps/powerpc/powerpc64/power8/memrchr.S: Mask extra bytes for unaligned inputs.
* Use libm_alias_double for dbl-64 modf.Joseph Myers2017-10-031-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes dbl-64 modf use libm_alias_double. Both the dbl-64 and dbl-64/wordsize-64 versions are changed, and the ldbl-opt version is changed to define the libc compat symbol only. Because of multiarch wrappers, the changed implementations are made not to define aliases at all if __modf is defined as a macro, as with other functions, so avoiding duplicate compat symbols while allowing those wrappers to be simplified. Tested for x86_64, and verified with build-many-glibcs.py that installed stripped shared libraries are unchanged by the patch. * sysdeps/ieee754/dbl-64/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double, only if [!__modf]. * sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double, only if [!__modf]. * sysdeps/ieee754/ldbl-opt/s_modf.c (modfl): Only define libc compat symbol here. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c (weak_alias): Do not undefine and redefine. (strong_alias): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c (weak_alias): Likewise. (strong_alias): Likewise.
* Use libm_alias_double for dbl-64 logb.Joseph Myers2017-10-031-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes dbl-64 logb use libm_alias_double. Both the dbl-64 and dbl-64/wordsize-64 versions are changed, and the ldbl-opt version is removed. Because of multiarch wrappers, the changed implementations are made not to define aliases at all if __logb is defined as a macro, as with other functions, so avoiding duplicate compat symbols while allowing those wrappers to be simplified. Tested for x86_64, and verified with build-many-glibcs.py that installed stripped shared libraries are unchanged (except on alpha where changes from using the wordsize-64 version are expected). * sysdeps/ieee754/dbl-64/s_logb.c: Include <libm-alias-double.h>. (logb): Define using libm_alias_double, only if [!__logb]. * sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c: Include <libm-alias-double.h>. (logb): Define using libm_alias_double, only if [!__logb]. * sysdeps/ieee754/ldbl-opt/s_logb.c: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-ppc32.c (weak_alias): Do not undefine and redefine. (strong_alias): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c (weak_alias): Likewise. (strong_alias): Likewise.
* Do not wrap expf and exp2fSzabolcs Nagy2017-10-023-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The new generic expf and exp2f code don't need wrappers any more, they set errno inline, so only use the wrappers on targets that need it. (If the wrapper is needed, then the top level wrapper code is included, otherwise empty w_exp*f.c is used to suppress the wrapper.) A powerpc64 expf implementation includes the expf c code directly which needed some changes. * sysdeps/ieee754/flt-32/e_exp2f.c (__exp2f): Define without wrapper. * sysdeps/ieee754/flt-32/e_expf.c (__expf): Likewise * sysdeps/ieee754/flt-32/w_exp2f.c: New file. * sysdeps/ieee754/flt-32/w_expf.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c: Update for the new expf code. * sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c: New file. * sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c: New file. * sysdeps/m68k/m680x0/fpu/w_exp2f.c: New file. * sysdeps/m68k/m680x0/fpu/w_expf.c: New file. * sysdeps/i386/fpu/w_exp2f.c: New file. * sysdeps/i386/fpu/w_expf.c: New file. * sysdeps/i386/i686/fpu/multiarch/w_expf.c: New file. * sysdeps/x86_64/fpu/w_expf.c: New file.
* powerpc: Optimize memrchr for power8Rajalakshmi Srinivasaraghavan2017-10-025-3/+368
| | | | | | | Vectorized loops are used for sizes greater than 32B to improve performance over power7 optimization. This shows as an average of 25% improvement depending on the position of search character. The performance is same for shorter strings.
* powerpc: Add redirection for finitef128, isinf128, and isnanf128Gabriel F. T. Gomes2017-09-213-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On powerpc64le, compiler support for float128 is not enabled by default on gcc. To enable it, the flag -mfloat128 must be passed as a command line option to the compiler. This means that only the few files that actively have -mfloat128 passed as an argument get compiler support for float128, whereas all other files don't. When -mfloat128 becomes enabled by default on powerpc [1], all the files that do not currently have compiler support for float128 enabled during their compilation, will start to have it. This will lead to build errors in s_finite.c, s_isinf.c, and s_isnan.c. The errors are due to the unintended macro expansion of __finitef128 to __redirect_finitef128 in math/bits/mathcalls-helper-functions.h. In that header, __MATHDECL_1 takes '__finite' and 'f128' as arguments and concatenates them. However, since '__finite' has been redefined in s_finite.c, the function declaration becomes __redirect_finitef128: extern int __redirect___finitef128 (_Float128 __value) __attribute__ ((__nothrow__ )) __attribute__ ((__const__)); This declaration itself is OK. The problem arises when include/math.h creates the hidden prototype ('hidden_proto (__finitef128)'), which expands to: extern __typeof (__finitef128) __finitef128 __attribute__ ((visibility ("hidden"))); Since __finitef128 is not declared, __typeof fails. This effect was already true for the 'float' and 'long double' versions and is now true for float128. Likewise for isinsff128 and isnanf128. This patch defines __finitef128 as __redirect___finitef128 in sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c, similarly to what's done for the float and long double versions of these functions, to get rid of the build error. Likewise for isinff128 and isnanf128. [1] https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01028.html Tested for powerpc64 and powerpc64le. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c (__finitef128): Define to __redirect___finitef128. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c (__isinff128): Define to __redirect___isinff128. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c (__isnanf128): Define to __redirect___isnanf128.
* powerpc: Avoid misaligned stores in memsetRajalakshmi Srinivasaraghavan2017-09-191-2/+68
| | | | | | | | As per the section "3.1.4.2 Alignment Interrupts" of the "POWER8 Processor User's Manual for the Single-Chip Module", alignment interrupt is reported for misaligned stores in Caching-inhibited storage. As memset is used in some drivers for DMA (like xorg), this patch avoids misaligned stores for sizes less than 8 in memset.
* [BZ #21745] powerpc: build some IFUNC math functions for libc and libmTulio Magno Quites Machado Filho2017-09-152-17/+22
| | | | | | | | | | | | | | | | | | | | | | | Some math functions have to be distributed in libc because they're required by printf. libc and libm require their own builds of these functions, e.g. libc functions have to call __stack_chk_fail_local in order to bypass the PLT, while libm functions have to call __stack_chk_fail. While math/Makefile treat the generic cases, i.e. s_isinff, the multiarch Makefile has to treat its own files, i.e. s_isinff-ppc64. [BZ #21745] * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: [$(subdir) = math] (sysdep_calls): New variable. Has the previous contents of sysdep_routines, but re-sorted.. [$(subdir) = math] (sysdep_routines): Re-use the contents from sysdep_calls. [$(subdir) = math] (libm-sysdep_routines): Remove the functions defined in sysdep_calls and replace by the respective m_* names. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S: (compat_symbol): Undefine to avoid duplicated compat symbols in libc.
* Do not use __ptr_t.Joseph Myers2017-08-0810-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sys/cdefs.h has a macro __ptr_t, which a few places in glibc use instead of void *. void * is a well-understood standard type for that purpose and in a post-C89 context there is no need for a macro for it; this patch changes those places to use void * directly instead. Unlike __long_double_t, __ptr_t is widely used outside glibc (or at least has many hits on codesearch.debian.net). I don't know how many of those uses would break if sys/cdefs.h ceased to define the macro, but there's enough risk that this patch leaves the definition and just removes the uses within glibc; removal of the definition can be considered separately if desired. Tested for x86_64, and with build-many-glibcs.py. * malloc/mcheck.c (old_free_hook): Use void * instead of __ptr_t. (old_malloc_hook): Likewise. (old_memalign_hook): Likewise. (old_realloc_hook): Likewise. (struct hdr): Likewise. (flood): Likewise. (freehook): Likewise. (mallochook): Likewise. (memalignhook): Likewise. (reallochook): Likewise. (mprobe): Likewise. * malloc/mtrace.c (mallwatch): Likewise. (tr_old_free_hook): Likewise. (tr_old_malloc_hook): Likewise. (tr_old_realloc_hook): Likewise. (tr_old_memalign_hook): Likewise. (tr_where): Likewise. (lock_and_info): Likewise. (tr_freehook): Likewise. (tr_mallochook): Likewise. (tr_reallochook): Likewise. (tr_memalignhook): Likewise. * misc/err.h [!__GNUC_VA_LIST] (__gnuc_va_list): Likewise. * misc/mmap.c (__mmap): Likewise. * misc/mmap64.c (__mmap64): Likewise. * misc/mprotect.c (__mprotect): Likewise. * misc/msync.c (msync): Likewise. * misc/munmap.c (__munmap): Likewise. * posix/posix_madvise.c (posix_madvise): Likewise. * socket/send.c (__send): Likewise. * socket/sendto.c (__sendto): Likewise. * socket/setsockopt.c (__setsockopt): Likewise. * string/memcmp.c (__ptr_t): Remove macro. (MEMCMP): Use void * instead of ptr_t. * string/memrchr.c (__ptr_t): Remove macro. (__memrchr): Use void * instead of ptr_t. * sysdeps/mach/hurd/dl-sysdep.c (__mmap): Likewise. * sysdeps/mach/hurd/mmap.c (__mmap): Likewise. * sysdeps/mach/hurd/mmap64.c (__mmap64): Likewise. * sysdeps/mach/mprotect.c (__mprotect): Likewise. * sysdeps/mach/msync.c (msync): Likewise. * sysdeps/mach/munmap.c (__munmap): Likewise. * sysdeps/mips/bits/setjmp.h (struct __jmp_buf_internal_tag): Likewise. * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/powerpc/powerpc32/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc32/power4/memcpy.S (memcpy): Likewise. * sysdeps/powerpc/powerpc32/power4/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc32/power6/memcpy.S (memcpy): Likewise. * sysdeps/powerpc/powerpc32/power6/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc32/power7/memcpy.S (memcpy): Likewise. * sysdeps/powerpc/powerpc32/power7/mempcpy.S (__mempcpy): Likewise. * sysdeps/powerpc/powerpc32/power7/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc64/memcpy.S (memcpy): Likewise. * sysdeps/powerpc/powerpc64/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc64/power4/memcpy.S (memcpy): Likewise. * sysdeps/powerpc/powerpc64/power4/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc64/power6/memcpy.S (memcpy): Likewise. * sysdeps/powerpc/powerpc64/power6/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc64/power7/memcpy.S (memcpy): Likewise. * sysdeps/powerpc/powerpc64/power7/mempcpy.S (__mempcpy): Likewise. * sysdeps/powerpc/powerpc64/power7/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc64/power8/memset.S (memset): Likewise. * sysdeps/tile/memcmp.c (__ptr_t): Remove macro. (MEMCMP): Use void * instead of ptr_t. * sysdeps/unix/sysv/linux/alpha/oldglob.c (old_glob_t): Likewise. * sysdeps/unix/sysv/linux/mmap.c (__mmap): Likewise.
* tst-tlsopt-powerpc as a shared libAlan Modra2017-08-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the __tls_get_addr_opt test run as a shared library, and so actually test that DTPMOD64/DTPREL64 pairs are processed by ld.so to support the __tls_get_adfr_opt call stub fast return. After a 2017-01-24 patch (binutils f0158f4416) ld.bfd no longer emitted unnecessary dynamic relocations against local thread variables, instead setting up the __tls_index GOT entries for the call stub fast return. This meant tst-tlsopt-powerpc passed but did not check ld.so relocation support. After a 2017-07-16 patch (binutils 676ee2b5fa) ld.bfd no longer set up the __tls_index GOT entries for the call stub fast return, and tst-tlsopt-powerpc failed. Compiling mod-tlsopt-powerpc.c with -DSHARED exposed a bug in powerpc64/tls-macros.h, which defines a __TLS_GET_ADDR macro that clashes with one defined in dl-tls.h. The tls-macros.h version is only used in that file, so delete it and expand. * sysdeps/powerpc/mod-tlsopt-powerpc.c: Extract from tst-tlsopt-powerpc.c with function name change and no test harness. * sysdeps/powerpc/tst-tlsopt-powerpc.c: Remove body of test. Call tls_get_addr_opt_test. * sysdeps/powerpc/Makefile (LDFLAGS-tst-tlsopt-powerpc): Don't define. (modules-names): Add mod-tlsopt-powerpc. (mod-tlsopt-powerpc.so-no-z-defs): Define. (tst-tlsopt-powerpc): Depend on .so. * sysdeps/powerpc/powerpc64/tls-macros.h (__TLS_GET_ADDR): Don't define. Expand use in TLS_GD and TLS_LD.
* powerpc: Clean up strlen and strnlen for power8Rajalakshmi Srinivasaraghavan2017-07-032-20/+1
| | | | | To align a quadword aligned address to 64 bytes, maximum of three 16 bytes load is needed for worst case instead of loading four times.
* Rename struct ucontext tag (bug 21457).Joseph Myers2017-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ucontext_t type has a tag struct ucontext. As with previous such issues for siginfo_t and stack_t, this tag is not permitted by POSIX (is not in a reserved namespace), and so namespace conformance means breaking C++ name mangling for this type. In this case, the type does need to have some tag rather than just a typedef name, because it includes a pointer to itself. This patch uses struct ucontext_t as the new tag, so the type is mangled as ucontext_t (the POSIX *_t reservation applies in all namespaces, not just the namespace of ordinary identifiers). Another reserved name such as struct __ucontext could of course be used. Because of other namespace issues, this patch does not by itself fix bug 21457 or allow any XFAILs to be removed. Tested for x86_64, and with build-many-glibcs.py. [BZ #21457] * sysdeps/arm/sys/ucontext.h (struct ucontext): Rename to struct ucontext_t. * sysdeps/generic/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/i386/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/m68k/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/mips/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/alpha/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/arm/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/mips/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/s390/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/sh/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/tile/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/unix/sysv/linux/x86/sys/ucontext.h (struct ucontext): Likewise. * sysdeps/powerpc/powerpc32/backtrace.c (struct rt_signal_frame_32): Likewise. * sysdeps/powerpc/powerpc64/backtrace.c (struct signal_frame_64): Likewise. * sysdeps/unix/sysv/linux/aarch64/kernel_rt_sigframe.h (struct kernel_rt_sigframe): Likewise. * sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h (SIGCONTEXT): Likewise. * sysdeps/unix/sysv/linux/arm/register-dump.h (register_dump): Likewise. * sysdeps/unix/sysv/linux/arm/sigcontextinfo.h (SIGCONTEXT): Likewise. * sysdeps/unix/sysv/linux/hppa/profil-counter.h (__profil_counter): Likewise. * sysdeps/unix/sysv/linux/microblaze/sigcontextinfo.h (SIGCONTEXT): Likewise. * sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h (struct kernel_rt_sigframe): Likewise. * sysdeps/unix/sysv/linux/nios2/kernel_rt_sigframe.h (struct kernel_rt_sigframe): Likewise. * sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h (SIGCONTEXT): Likewise. * sysdeps/unix/sysv/linux/sh/makecontext.S (__makecontext): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c (__start_context): Likewise. * sysdeps/unix/sysv/linux/tile/sigcontextinfo.h (SIGCONTEXT): Likewise. * sysdeps/unix/sysv/linux/x86_64/register-dump.h (register_dump): Likewise. * sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h (SIGCONTEXT): Likewise.
* powerpc: Fix sinf() IFUNC fallback.Rogerio A. Cardoso2017-06-231-1/+1
| | | | | | | | sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-ppc64.c should fall back to sysdeps/powerpc/fpu/s_sinf.c not to sysdeps/ieee754/flt-32/s_sinf.c. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-ppc64.c: Change s_sinf.c from sysdeps/ieee754/flt-32/ to sysdeps/powerpc/fpu/.
* powerpc: refactor strrchr IFUNCRajalakshmi Srinivasaraghavan2017-06-232-19/+7
| | | | | | As done in commit 6d15a5c2e9450a1e926d5b4991759e1cfa50fccf clean up IFUNC implementation for power8 in order to remove unneeded macro definitions.
* powerpc: Add optimized version of [l]lroundfRajalakshmi Srinivasaraghavan2017-06-239-1/+103
| | | | | This patch makes use of optimized double version of llround for single precision as both the versions return [long] long type.