about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
...
* login: Remove utmp backend jump tables [BZ #23518]Florian Weimer2019-08-051-4/+3
| | | | | | | There is just one file-based implementation, so this dispatch mechanism is unnecessary. Instead of the vtable pointer __libc_utmp_jump_table, use a non-negative file_fd as the indicator that the backend is initialized.
* Update kernel version in comment in syscall-names.list.Joseph Myers2019-08-021-1/+1
| | | | | | | This patch updates the Linux kernel version in a comment in syscall-names.list to agree with the following "kernel" line. * sysdeps/unix/sysv/linux/syscall-names.list: Update comment.
* Update Linux kernel version number in tst-mman-consts.py to 5.2.Joseph Myers2019-08-021-1/+1
| | | | | | | | | | | | | | The tst-mman-consts.py test includes a kernel version number, to avoid failures because of newly added constants in the kernel (if kernel headers are newer than this version of glibc) or missing constants in the kernel (if kernel headers are older than this version of glibc). This patch updates it to 5.2 to reflect that the MAP_* constants in glibc are still current as of that kernel version. Tested with build-many-glibcs.py. * sysdeps/unix/sysv/linux/tst-mman-consts.py (main): Update Linux kernel version number to 5.2.
* powerpc: Cleanup: use actual power8 assembly mnemonicsRaoni Fassina Firmino2019-08-0111-187/+87
| | | | | | | | | | | | | | | | | | | | | | Some implementations in sysdeps/powerpc/powerpc64/power8/*.S still had pre power8 compatible binutils hardcoded macros and were not using .machine power8. This patch should not have semantic changes, in fact it should have the same exact code generated. Tested that generated stripped shared objects are identical when using "strip --remove-section=.note.gnu.build-id". Checked on: - powerpc64le, power9, build-many-glibcs.py, gcc 6.4.1 20180104, binutils 2.26.2.20160726 - powerpc64le, power8, debian 9, gcc 6.3.0 20170516, binutils 2.28 - powerpc64le, power9, ubuntu 19.04, gcc 8.3.0, binutils 2.32 - powerpc64le, power9, opensuse tumbleweed, gcc 9.1.1 20190527, binutils 2.32 - powerpc64, power9, debian 10, gcc 8.3.0, binutils 2.31.1 Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
* hppa: Update libm-tests-ulpsAdhemerval Zanella2019-08-011-44/+44
| | | | | | The make regen-ulps was done on a PA8900 with 8.3.0. * sysdeps/hppa/fpu/libm-test-ulps: Update.
* Get new entropy on each attempt __gen_tempname (BZ #15813)Adhemerval Zanella2019-08-011-7/+6
| | | | | | | | | | | This is missing bit for fully fix BZ#15813 (the other two were fixed by 359653aaacad463). Checked on x86_64-linux-gnu. [BZ #15813] sysdeps/posix/tempname.c (__gen_tempname): get entrypy on each attempt.
* Restore r31 setting in powerpc32 swapcontext.Joseph Myers2019-07-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit ffe8a9a8318e1db225b22da8bc067408494bac5c, "powerpc: Remove rt_sigreturn usage on context function", removed from powerpc32 swapcontext a setting of r31 that is relied upon in subsequent code. I'm not sure why this didn't produce test failures in Adhemerval's 32-bit testing; in my (soft-float) testing in preparation for 2.30 release, I see several context-related failures FAIL: stdlib/tst-makecontext2 FAIL: stdlib/tst-makecontext3 FAIL: stdlib/tst-setcontext FAIL: stdlib/tst-setcontext2 FAIL: stdlib/tst-setcontext4 FAIL: stdlib/tst-setcontext7 FAIL: stdlib/tst-setcontext9 FAIL: stdlib/tst-swapcontext1 that did not appear in 2.29 testing. This patch restores the removed register setting in question, and thus fixes those failures. Tested for powerpc (soft-float). * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S (__CONTEXT_FUNC_NAME): Restore setting of r31.
* Linux: Move getdents64 to <dirent.h>Florian Weimer2019-07-292-6/+33
| | | | | | This matches the location of the declaration in musl. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* x86-64: Compile branred.c with -mprefer-vector-width=128 [BZ #24603]H.J. Lu2019-07-243-0/+43
| | | | | | | | | | | | | | | | | | | | | When compiled with -O3 and AVX, GCC 8 and 9 optimize some loops in sysdeps/ieee754/dbl-64/branred.c with 256-bit vector instructions, which leads to store forward stall: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90579 There is no easy fix in compiler. This patch limits vector width to 128 bits to work around this issue. It improves performance of sin and cos by more than 40% on Skylake compiled with -O3 -march=skylake. Tested with GCC 7/8/9 on x86-64. [BZ #24603] * sysdeps/x86_64/configure.ac: Check if -mprefer-vector-width=128 works. * sysdeps/x86_64/configure: Regenerated. * sysdeps/x86_64/fpu/Makefile (CFLAGS-branred.c): New. Set to -mprefer-vector-width=128 if supported.
* Linux: Use in-tree copy of SO_ constants for !__USE_MISC [BZ #24532]Florian Weimer2019-07-249-94/+311
| | | | | | | | | | | | | | | | | | | | The kernel changes for a 64-bit time_t on 32-bit architectures resulted in <asm/socket.h> indirectly including <linux/posix_types.h>. The latter is not namespace-clean for the POSIX version of <sys/socket.h>. This issue has persisted across several Linux releases, so this commit creates our own copy of the SO_* definitions for !__USE_MISC mode. The new test socket/tst-socket-consts ensures that the copy is consistent with the kernel definitions (which vary across architectures). The test is tricky to get right because CPPFLAGS includes include/libc-symbols.h, which in turn defines _GNU_SOURCE unconditionally. Tested with build-many-glibcs.py. I verified that a discrepancy in the definitions actually results in a failure of the socket/tst-socket-consts test.
* Linux: Update syscall-names.list to Linux 5.2Florian Weimer2019-07-191-1/+7
| | | | | | | This adds the system call names fsconfig, fsmount, fsopen, fspick, move_mount, open_tree. Tested with build-many-glibcs.py.
* nptl: Add POSIX-proposed _clock functions to hppa pthread.hAdhemerval Zanella2019-07-181-0/+36
| | | | | | | | | | | | | | The pthread _clock functions that were recently added to nptl need to be declared in hppa's pthread.h too. After this change, the function declaration part of sysdeps/nptl/pthread.h and sysdeps/unix/sysv/linux/hppa/pthread.h are identical. * sysdeps/unix/sysv/linux/hppa/pthread.h: Add declarations of functions recently added to sysdeps/nptl/pthread.h: pthread_mutex_clocklock, pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock and pthread_cond_clockwait. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Remove unnecessary forwarding of pthread_cond_clockwait from libcMike Crowe2019-07-181-4/+0
| | | | | | | | | | | | | | | | | | | | In afe4de7d283ebd88157126c5494ce1796194c16e, I added forwarding functions from libc to libpthread for __pthread_cond_clockwait and pthread_cond_clockwait to mirror those for pthread_cond_timedwait. These are unnecessary[1], since these functions aren't (yet) being called from within libc itself. Let's remove them. * nptl/forward.c: Remove unnecessary __pthread_cond_clockwait and pthread_cond_clockwait forwarding functions. There are no internal users, so it is unnecessary to expose these functions in libc.so. * sysdeps/nptl/pthread-functions.h (pthread_functions): Remove unnecessary ptr___pthread_cond_clockwait member. * nptl/nptl-init.c (pthread_functions): Remove assignment of removed member. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> [1] https://sourceware.org/ml/libc-alpha/2017-10/msg00082.html
* nptl: Remove futex_supports_exact_relative_timeoutsMike Crowe2019-07-122-16/+1
| | | | | | | | | | | | | | | | | | The only implementation of futex_supports_exact_relative_timeouts always returns true. Let's remove it and all its callers. * nptl/pthread_cond_wait.c: (__pthread_cond_clockwait): Remove code that is only useful if futex_supports_exact_relative_timeouts () returns false. * nptl/pthread_condattr_setclock.c: (pthread_condattr_setclock): Likewise. * sysdeps/nptl/futex-internal.h: Remove comment about relative timeouts potentially being imprecise since it's no longer true. Remove declaration of futex_supports_exact_relative_timeouts. * sysdeps/unix/sysv/linux/futex-internal.h: Remove implementation of futex_supports_exact_relative_timeouts. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add POSIX-proposed pthread_mutex_clocklockMike Crowe2019-07-1225-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add POSIX-proposed pthread_mutex_clocklock function that works like pthread_mutex_timedlock but takes a clockid parameter to measure the abstime parameter against. * sysdeps/nptl/pthread.h: Add pthread_mutex_clocklock. * nptl/DESIGN-systemtap-probes.txt: Likewise. * nptl/pthread_mutex_timedlock.c (__pthread_mutex_clocklock_common): Rename from __pthread_mutex_timedlock and add clockid parameter. Pass this parameter to lll_clocklock and lll_clocklock_elision in place of CLOCK_REALTIME. (__pthread_mutex_clocklock): New function to add LIBC_PROBE and validate clockid parameter before calling __pthread_mutex_clocklock_common. (__pthread_mutex_timedlock): New implementation to add LIBC_PROBE and calls __pthread_mutex_clocklock_common passing CLOCK_REALTIME as the clockid. * nptl/Makefile: Add tst-mutex11.c. * nptl/tst-abstime.c (th): Add tests for pthread_mutex_clocklock. * nptl/tst-mutex11.c: New tests for passing invalid and unsupported clockid parameters to pthread_mutex_clocklock. * nptl/tst-mutex5.c (do_test_clock): Rename from do_test and take clockid parameter to indicate which clock to be used. Call pthread_mutex_timedlock or pthread_mutex_clocklock as appropriate. (do_test): Call do_test_clock to separately test pthread_mutex_timedlock, pthread_mutex_clocklock(CLOCK_REALTIME) and pthread_mutex_clocklock(CLOCK_MONOTONIC). * nptl/tst-mutex9.c: Likewise. * nptl/Versions (GLIBC_2.30): Add pthread_mutex_clocklock. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Rename lll_timedlock to lll_clocklock and add clockid parameterMike Crowe2019-07-1210-41/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename lll_timedlock to lll_clocklock and add clockid parameter to indicate the clock that the abstime parameter should be measured against in preparation for adding pthread_mutex_clocklock. The name change mirrors the naming for the exposed pthread functions: timed => absolute timeout measured against CLOCK_REALTIME (or clock specified by attribute in the case of pthread_cond_timedwait.) clock => absolute timeout measured against clock specified in preceding parameter. * sysdeps/nptl/lowlevellock.h (lll_clocklock): Rename from lll_timedlock and add clockid parameter. (__lll_clocklock): Rename from __lll_timedlock and add clockid parameter. * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_clocklock): Likewise. * nptl/lll_timedlock_wait.c (__lll_clocklock_wait): Rename from __lll_timedlock_wait and add clockid parameter. Use __clock_gettime rather than __gettimeofday so that clockid can be used. This means that conversion from struct timeval is no longer required. * sysdeps/sparc/sparc32/lowlevellock.c (lll_clocklock_wait): Likewise. * sysdeps/sparc/sparc32/lll_timedlock_wait.c: Update comment to refer to __lll_clocklock_wait rather than __lll_timedlock_wait. * nptl/pthread_mutex_timedlock.c (lll_clocklock_elision): Rename from lll_timedlock_elision, add clockid parameter and use meaningful names for other parameters. (__pthread_mutex_timedlock): Pass CLOCK_REALTIME where necessary to lll_clocklock and lll_clocklock_elision. * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_clocklock_elision): Rename from lll_timedlock_elision and add clockid parameter. (__lll_clocklock_elision): Rename from __lll_timedlock_elision and add clockid parameter. * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/x86/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/elision-timed.c (__lll_lock_elision): Call __lll_clocklock_elision rather than __lll_timedlock_elision. (EXTRAARG): Add clockid parameter. (LLL_LOCK): Likewise. * sysdeps/unix/sysv/linux/s390/elision-timed.c: Likewise. * sysdeps/unix/sysv/linux/x86/elision-timed.c: Likewise. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add POSIX-proposed pthread_rwlock_clockrdlock & pthread_rwlock_clockwrlockMike Crowe2019-07-1225-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add: int pthread_rwlock_clockrdlock (pthread_rwlock_t *rwlock, clockid_t clockid, const struct timespec *abstime) and: int pthread_rwlock_clockwrlock (pthread_rwlock_t *rwlock, clockid_t clockid, const struct timespec *abstime) which behave like pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock respectively, except they always measure abstime against the supplied clockid. The functions currently support CLOCK_REALTIME and CLOCK_MONOTONIC and return EINVAL if any other clock is specified. * sysdeps/nptl/pthread.h: Add pthread_rwlock_clockrdlock and pthread_wrlock_clockwrlock. * nptl/Makefile: Build pthread_rwlock_clockrdlock.c and pthread_rwlock_clockwrlock.c. * nptl/pthread_rwlock_clockrdlock.c: Implement pthread_rwlock_clockrdlock. * nptl/pthread_rwlock_clockwrlock.c: Implement pthread_rwlock_clockwrlock. * nptl/pthread_rwlock_common.c (__pthread_rwlock_rdlock_full): Add clockid parameter and verify that it indicates a supported clock on entry so that we fail even if it doesn't end up being used. Pass that clock on to futex_abstimed_wait when necessary. (__pthread_rwlock_wrlock_full): Likewise. * nptl/pthread_rwlock_rdlock.c: (__pthread_rwlock_rdlock): Pass CLOCK_REALTIME to __pthread_rwlock_rdlock_full even though it won't be used because there's no timeout. * nptl/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Pass CLOCK_REALTIME to __pthread_rwlock_wrlock_full even though it won't be used because there is no timeout. * nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Pass CLOCK_REALTIME to __pthread_rwlock_rdlock_full since abstime uses that clock. * nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Pass CLOCK_REALTIME to __pthread_rwlock_wrlock_full since abstime uses that clock. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. * nptl/tst-abstime.c (th): Add pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock timeout tests to match the existing pthread_rwlock_timedrdloock and pthread_rwlock_timedwrlock tests. * nptl/tst-rwlock14.c (do_test): Likewise. * nptl/tst-rwlock6.c Invent verbose_printf macro, and use for ancillary output throughout. (tf): Accept thread_args structure so that rwlock, a clockid and function name can be passed to the thread. (do_test_clock): Rename from do_test. Accept clockid parameter to specify test clock. Use the magic clockid value of CLOCK_USE_TIMEDLOCK to indicate that pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock should be tested, otherwise pass the specified clockid to pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock. Use xpthread_create and xpthread_join. (do_test): Call do_test_clock to test each clockid in turn. * nptl/tst-rwlock7.c: Likewise. * nptl/tst-rwlock9.c (writer_thread, reader_thread): Accept thread_args structure so that the (now int) thread number, the clockid and the function name can be passed to the thread. (do_test_clock): Renamed from do_test. Pass the necessary thread_args when creating the reader and writer threads. Use xpthread_create and xpthread_join. (do_test): Call do_test_clock to test each clockid in turn. * manual/threads.texi: Add documentation for pthread_rwlock_clockrdlock and pthread_rwlock_clockwrclock. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add POSIX-proposed pthread_cond_clockwaitMike Crowe2019-07-1226-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add: int pthread_cond_clockwait (pthread_cond_t *cond, pthread_mutex_t *mutex, clockid_t clockid, const struct timespec *abstime) which behaves just like pthread_cond_timedwait except it always measures abstime against the supplied clockid. Currently supports CLOCK_REALTIME and CLOCK_MONOTONIC and returns EINVAL if any other clock is specified. Includes feedback from many others. This function was originally proposed[1] as pthread_cond_timedwaitonclock_np, but The Austin Group preferred the new name. * nptl/Makefile: Add tst-cond26 and tst-cond27 * nptl/Versions (GLIBC_2.30): Add pthread_cond_clockwait * sysdeps/nptl/pthread.h: Likewise * nptl/forward.c: Add __pthread_cond_clockwait * nptl/forward.c: Likewise * nptl/pthreadP.h: Likewise * sysdeps/nptl/pthread-functions.h: Likewise * nptl/pthread_cond_wait.c (__pthread_cond_wait_common): Add clockid parameter and comment describing why we don't need to check its value. Use that value when calling futex_abstimed_wait_cancelable rather than reading the clock from the flags. (__pthread_cond_wait): Pass unused clockid parameter. (__pthread_cond_timedwait): Read clock from flags and pass it to __pthread_cond_wait_common. (__pthread_cond_clockwait): Add new function with weak alias from pthread_cond_clockwait. * sysdeps/mach/hurd/i386/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist * (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. * nptl/tst-cond11.c (run_test): Support testing pthread_cond_clockwait too by using a special magic CLOCK_USE_ATTR_CLOCK value to determine whether to call pthread_cond_timedwait or pthread_cond_clockwait. (do_test): Pass CLOCK_USE_ATTR_CLOCK for existing tests, and add new tests using all combinations of CLOCK_MONOTONIC and CLOCK_REALTIME. * ntpl/tst-cond26.c: New test for passing unsupported and * invalid clocks to pthread_cond_clockwait. * nptl/tst-cond27.c: Add test similar to tst-cond5.c, but using struct timespec and pthread_cond_clockwait. * manual/threads.texi: Document pthread_cond_clockwait. The * comment was provided by Carlos O'Donell. [1] https://sourceware.org/ml/libc-alpha/2015-07/msg00193.html Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add POSIX-proposed sem_clockwaitMike Crowe2019-07-1225-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add: int sem_clockwait (sem_t *sem, clockid_t clock, const struct timespec *abstime) which behaves just like sem_timedwait, but measures abstime against the specified clock. Currently supports CLOCK_REALTIME and CLOCK_MONOTONIC and sets errno == EINVAL if any other clock is specified. * nptl/sem_waitcommon.c (do_futex_wait, __new_sem_wait_slow): Add clockid parameters to indicate the clock which abstime should be measured against. * nptl/sem_timedwait.c (sem_timedwait), nptl/sem_wait.c (__new_sem_wait): Pass CLOCK_REALTIME as clockid to __new_sem_wait_slow. * nptl/sem_clockwait.c: New file to implement sem_clockwait based on sem_timedwait.c. * nptl/Makefile: Add sem_clockwait.c source file. Add CFLAGS for sem_clockwait.c to match those used for sem_timedwait.c. * sysdeps/pthread/semaphore.h: Add sem_clockwait. * nptl/Versions (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. * nptl/tst-sem17.c: Add new test for passing invalid clock to sem_clockwait. * nptl/tst-sem13.c, nptl/tst-sem5.c: Modify existing sem_timedwait tests to also test sem_clockwait. * manual/threads.texi: Document sem_clockwait. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add clockid parameter to futex timed wait callsMike Crowe2019-07-124-17/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for adding POSIX clockwait variants of timedwait functions, add a clockid_t parameter to futex_abstimed_wait functions and pass CLOCK_REALTIME from all callers for the time being. Replace lll_futex_timed_wait_bitset with lll_futex_clock_wait_bitset which takes a clockid_t parameter rather than the magic clockbit. * sysdeps/nptl/lowlevellock-futex.h, sysdeps/unix/sysv/linux/lowlevellock-futex.h: Replace lll_futex_timed_wait_bitset with lll_futex_clock_wait_bitset that takes a clockid rather than a special clockbit. * sysdeps/nptl/lowlevellock-futex.h: Add lll_futex_supported_clockid so that client functions can check whether their clockid parameter is valid even if they don't ultimately end up calling lll_futex_clock_wait_bitset. * sysdeps/nptl/futex-internal.h, sysdeps/unix/sysv/linux/futex-internal.h (futex_abstimed_wait, futex_abstimed_wait_cancelable): Add clockid_t parameter to indicate which clock the absolute time passed should be measured against. Pass that clockid onto lll_futex_clock_wait_bitset. Add invalid clock as reason for returning -EINVAL. * sysdeps/nptl/futex-internal.h, sysdeps/unix/sysv/linux/futex-internal.h: Introduce futex_abstimed_supported_clockid so that client functions can check whether their clockid parameter is valid even if they don't ultimately end up calling futex_abstimed_wait. * nptl/pthread_cond_wait.c (__pthread_cond_wait_common): Remove code to calculate relative timeout for __PTHREAD_COND_CLOCK_MONOTONIC_MASK and just pass CLOCK_MONOTONIC or CLOCK_REALTIME as required to futex_abstimed_wait_cancelable. * nptl/pthread_rwlock_common (__pthread_rwlock_rdlock_full) (__pthread_wrlock_full), nptl/sem_waitcommon (do_futex_wait): Pass additional CLOCK_REALTIME to futex_abstimed_wait_cancelable. * nptl/pthread_mutex_timedlock.c (__pthread_mutex_timedlock): Switch to lll_futex_clock_wait_bitset and pass CLOCK_REALTIME Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* posix: Fix large mmap64 offset for mips64n32 (BZ#24699)Adhemerval Zanella2019-07-103-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for BZ#21270 (commit 158d5fa0e19) added a mask to avoid offset larger than 1^44 to be used along __NR_mmap2. However mips64n32 users __NR_mmap, as mips64n64, but still defines off_t as old non-LFS type (other ILP32, such x32, defines off_t being equal to off64_t). This leads to use the same mask meant only for __NR_mmap2 call for __NR_mmap, thus limiting the maximum offset it can use with mmap64. This patch fixes by setting the high mask only for __NR_mmap2 usage. The posix/tst-mmap-offset.c already tests it and also fails for mips64n32. The patch also change the test to check for an arch-specific header that defines the maximum supported offset. Checked on x86_64-linux-gnu, i686-linux-gnu, and I also tests tst-mmap-offset on qemu simulated mips64 with kernel 3.2.0 kernel for both mips-linux-gnu and mips64-n32-linux-gnu. [BZ #24699] * posix/tst-mmap-offset.c: Mention BZ #24699. (do_test_bz21270): Rename to do_test_large_offset and use mmap64_maximum_offset to check for maximum expected offset value. * sysdeps/generic/mmap_info.h: New file. * sysdeps/unix/sysv/linux/mips/mmap_info.h: Likewise. * sysdeps/unix/sysv/linux/mmap64.c (MMAP_OFF_HIGH_MASK): Define iff __NR_mmap2 is used.
* aarch64: simplify the DT_AARCH64_VARIANT_PCS handling codeSzabolcs Nagy2019-07-102-6/+1
| | | | | | | | | | | Remove unnecessary variant_pcs field: the dynamic tag can be checked directly. * sysdeps/aarch64/dl-machine.h (elf_machine_runtime_setup): Remove the DT_AARCH64_VARIANT_PCS check. (elf_machine_lazy_rel): Use l_info[DT_AARCH64 (VARIANT_PCS)]. * sysdeps/aarch64/linkmap.h (struct link_map_machine): Remove variant_pcs.
* [powerpc] fenv_libc.h: protect use of __builtin_cpu_supportsPaul A. Clarke2019-07-091-1/+3
| | | | | | | | | | | | | Using __builtin_cpu_supports() requires support in GCC and Glibc. My recent patch to fenv_libc.h added an unprotected use of __builtin_cpu_supports(). Compilation of Glibc itself will fail with a sufficiently new GCC and sufficiently old Glibc: ../sysdeps/powerpc/fpu/fegetexcept.c: In function ‘__fegetexcept’: ../sysdeps/powerpc/fpu/fenv_libc.h:52:20: error: builtin ‘__builtin_cpu_supports’ needs GLIBC (2.23 and newer) that exports hardware capability bits [-Werror] Reviewed-by: Florian Weimer <fweimer@redhat.com> Fixes 3db85a9814784a74536a1f0e7b7ddbfef7dc84bb.
* powerpc: refactor logb{f,l}Adhemerval Zanella2019-07-0820-125/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The power7 logb implementation does not show a performance gain on ISA 2.07+ chips with faster floating-point to GRP instructions (currently POWER8 and POWER9). This patch moves the POWER7 implementation to generic one and enables it for POWER7. It also add some cleanup to use inline floating-point number instead of define them using static const. The performance difference is for POWER9: - Without patch: "logb": { "subnormal": { "duration": 4.99202e+09, "iterations": 8.83662e+08, "max": 75.194, "min": 5.501, "mean": 5.64925 }, "normal": { "duration": 4.97063e+09, "iterations": 9.97094e+08, "max": 46.489, "min": 4.956, "mean": 4.98512 } } - With patch: "logb": { "subnormal": { "duration": 4.97226e+09, "iterations": 9.92036e+08, "max": 77.209, "min": 4.892, "mean": 5.01218 }, "normal": { "duration": 4.96192e+09, "iterations": 1.07545e+09, "max": 12.361, "min": 4.593, "mean": 4.61382 } } The ifunc implementation is also enabled only for powerpc64. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/power7/fpu/s_logb.c: Move to ... * sysdeps/powerpc/fpu/s_logb.c: ... here. Use inline FP constants. * sysdeps/powerpc/power7/fpu/s_logbf.c: Move to ... * sysdeps/powerpc/fpu/s_logbf.c: ... here. Use inline FP constants. * sysdeps/powerpc/power7/fpu/s_logbl.c: Move to ... * sysdeps/powerpc/fpu/s_logbl.c: ... here. Use inline FP constants. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-power7.c: Adjust implementation path. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-power7.c: Adjust implementation path. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-power7.c: Adjust implementation path. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_log* objects. (CFLAGS-s_logbf-power7.c, CFLAGS-s_logbl-power7.c, CFLAGS-s_logb-power7.c): New fule. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logb-power7.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logb-ppc64.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logb.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logbf-power7.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logbf-ppc64.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logbf.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logbl-power7.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logbl-ppc64.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_logbl.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Remove file. * sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c: Remove file. * sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c: Likewise. * sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c: Likewise. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
* math: Use wordsize-64 version for s_logbAdhemerval Zanella2019-07-082-79/+29
| | | | | | | | | | | | | | | | | | | | | | - The resulting binary difference on 32 bits architecture is minimum. On i686-linux-gnu (with architecture optimization routine removed) there is no different using logb benchtests - It helps wordsize-64 architectures that use ldbl-opt. - It add some code simplification with reduction of duplicated implementations. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c: Move to ... * sysdeps/ieee754/dbl-64/s_logb.c: ... here. Add work around for powerpc32 integer 0 converting to -0. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
* powerpc: Refactor modf{f}Adhemerval Zanella2019-07-0812-42/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The modf{f} optimization is not an optimization for ISA 2.07+. This patch move the IFUNC for powerpc64 only, move the power5+ to generic location, and include the generic implementation for ISA 2.07+. The performance changes are based on modf benchtests: * POWER9 - ppc64 "modf": { "": { "duration": 4.97057e+09, "iterations": 1.00688e+09, "max": 28.76, "min": 4.912, "mean": 4.9366 } } * POWER9 - power5+ "modf": { "": { "duration": 4.98291e+09, "iterations": 9.32818e+08, "max": 15.058, "min": 5.107, "mean": 5.34178 } } * POWER8 - ppc64 "modf": { "": { "duration": 5.05329e+09, "iterations": 8.38814e+08, "max": 518.051, "min": 5.79, "mean": 6.02433 } } * POWER8 - power5+ "modf": { "": { "duration": 5.05573e+09, "iterations": 8.35254e+08, "max": 63.141, "min": 5.873, "mean": 6.05293 } } * POWER7 - ppc64 "modf": { "": { "duration": 4.89818e+09, "iterations": 1.08408e+09, "max": 57.556, "min": 3.953, "mean": 4.51827 } } * POWER7 - power5+ "modf": { "": { "duration": 4.83789e+09, "iterations": 1.33409e+09, "max": 46.608, "min": 2.224, "mean": 3.62636 } } Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/power5+/fpu/s_modf.c: Move to ... * sysdeps/powerpc/fpu/s_modf.c: ... here. Add ISA 2.07 optimization. * sysdeps/powerpc/power5+/fpu/s_modff.c: Move to ... * sysdeps/powerpc/fpu/s_modff.c: ... here. Add ISA 2.07 optimization. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-power5+.c: Adjust include. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-power5+.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile (sysdep_calls, sysdep_routines): Add s_modf* objects. (CFLAGS-s_modf-power5+.c, CFLAGS-s_modff-power5+.c, CFLAGS-s_modf-ppc64.c, CFLAGS-s_modff-ppc64.c): New rule. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_modf-power5+.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c: Movo to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_modf-power5+.c: Move ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_modf.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_modff-power5+.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_modff-ppc64.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_modff.c: ... here. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
* powerpc: hypot refactor and optimizationAdhemerval Zanella2019-07-088-232/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The powerpc hypot is slight optimized by: - Commit 8df4e219e43, both isnan and isinf are always inlined and thus the check TEST_INF_NAN does not make sense anymore. The generic check for POWER7 should be faster on all powerpc configuration. - The redundant check 'y > two60factor && (x / y) > two60' is removed. Both changes leads to unrequired ifunc especialization for power7 and thus they are removed. Finally The code is also cleanup a bit by inlining the constants floating points. The performance changes using the hypot benchtests are: - POWER9 without patch: "hypot": { "overflow": { "duration": 4.98585e+09, "iterations": 4.84932e+08, "max": 46.551, "min": 10.229, "mean": 10.2815 }, "higher_two500": { "duration": 5.00192e+09, "iterations": 4.24843e+08, "max": 33.319, "min": 11.606, "mean": 11.7736 }, "subnormal": { "duration": 5.0075e+09, "iterations": 4.06792e+08, "max": 22.178, "min": 12.15, "mean": 12.3097 }, "less_two500": { "duration": 5.00685e+09, "iterations": 4.08772e+08, "max": 22.784, "min": 12.052, "mean": 12.2485 }, "default": { "duration": 5.06002e+09, "iterations": 4.09894e+08, "max": 20.648, "min": 11.874, "mean": 12.3447 } } - POWER9 with patch: "hypot": { "overflow": { "duration": 4.91848e+09, "iterations": 7.28039e+08, "max": 47.958, "min": 6.436, "mean": 6.75579 }, "higher_two500": { "duration": 4.9359e+09, "iterations": 6.63376e+08, "max": 20.783, "min": 7.321, "mean": 7.44057 }, "subnormal": { "duration": 4.9479e+09, "iterations": 6.19772e+08, "max": 18.856, "min": 7.817, "mean": 7.98341 }, "less_two500": { "duration": 4.94275e+09, "iterations": 6.3889e+08, "max": 17.452, "min": 7.597, "mean": 7.73647 }, "default": { "duration": 5.03645e+09, "iterations": 5.70718e+08, "max": 18.904, "min": 8.55, "mean": 8.82476 } } - POWER7 without patch "hypot": { "overflow": { "duration": 4.86637e+09, "iterations": 6.43196e+08, "max": 53.958, "min": 7.328, "mean": 7.56592 }, "higher_two500": { "duration": 4.99842e+09, "iterations": 3.11012e+08, "max": 78.227, "min": 15.696, "mean": 16.0715 }, "subnormal": { "duration": 4.99841e+09, "iterations": 3.08935e+08, "max": 51.392, "min": 15.983, "mean": 16.1795 }, "less_two500": { "duration": 5.00108e+09, "iterations": 2.99464e+08, "max": 73.247, "min": 16.416, "mean": 16.7001 }, "default": { "duration": 5.04645e+09, "iterations": 3.52608e+08, "max": 70.073, "min": 13.38, "mean": 14.3118 } } - POWER7 with patch "hypot": { "overflow": { "duration": 4.80785e+09, "iterations": 8.00001e+08, "max": 66.262, "min": 5.888, "mean": 6.00981 }, "higher_two500": { "duration": 4.9859e+09, "iterations": 3.39449e+08, "max": 5148.44, "min": 14.539, "mean": 14.6882 }, "subnormal": { "duration": 4.9905e+09, "iterations": 3.28874e+08, "max": 64.905, "min": 14.971, "mean": 15.1745 }, "less_two500": { "duration": 4.99494e+09, "iterations": 3.19755e+08, "max": 103.696, "min": 14.972, "mean": 15.6211 }, "default": { "duration": 5.03951e+09, "iterations": 4.02502e+08, "max": 61.008, "min": 12.368, "mean": 12.5205 } } Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/fpu/e_hypot.c (two60, two500, two600, two1022, twoM500, twoM600, two60factor, pdnum): Remove. (TEST_INFO_NAN, GET_TW0_HIGH_WORD): Remove macro. (__ieee754_hypot): Replace static variables with inline definition, remove ununsed branches. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (libm-sysdep_routines): Remove e_hypot-* objects. (CFLAGS-e_hypot-power7.c, CFLAGS-e_hypotf-power7.c): Remove rule. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c: Remove file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c: Likewise. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
* dl-vdso: Add LINUX_4 HASH CODE to support nds32 vdso mechanismVincent Chen2019-07-081-0/+2
| | | | | | | * sysdeps/unix/sysv/linux/dl-vdso.h: Add LINUX_4 HASH code to support nds32 vdso mechanism. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* riscv: restore ABI compatibility (bug 24484)Andreas Schwab2019-07-041-0/+5
| | | | | The contents of the dynamic section are part of the ABI, thus DL_RO_DYN_SECTION cannot be changed.
* aarch64: new ifunc resolver ABISzabolcs Nagy2019-07-045-1/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing a second argument to the ifunc resolver allows accessing AT_HWCAP2 values from the resolver. AArch64 will start using AT_HWCAP2 on linux because for ilp32 to remain compatible with lp64 ABI no more than 32bit hwcap flags can be in AT_HWCAP which is already used up. Currently the relocation ordering logic does not guarantee that ifunc resolvers can call libc apis or access libc objects, so only the resolver arguments and runtime environment dependent instructions can be used to do the dispatch (this affects ifunc resolvers outside of the libc). Since ifunc resolver is target specific and only supposed to be called by the dynamic linker, the call ABI can be changed in a backward compatible way: Old call ABI passed hwcap as uint64_t, new abi sets the _IFUNC_ARG_HWCAP flag in the hwcap and passes a second argument that's a pointer to an extendible struct. A resolver has to check the _IFUNC_ARG_HWCAP flag before accessing the second argument. The new sys/ifunc.h installed header has the definitions for the new ABI, everything is in the implementation reserved namespace. An alternative approach is to try to support extern calls from ifunc resolvers such as getauxval, but that seems non-trivial https://sourceware.org/ml/libc-alpha/2017-01/msg00468.html * sysdeps/aarch64/Makefile: Install sys/ifunc.h and add tests. * sysdeps/aarch64/dl-irel.h (elf_ifunc_invoke): Update to new ABI. * sysdeps/aarch64/sys/ifunc.h: New file. * sysdeps/aarch64/tst-ifunc-arg-1.c: New file. * sysdeps/aarch64/tst-ifunc-arg-2.c: New file.
* nptl: Remove vfork IFUNC-based forwarder from libpthread [BZ #20188]Florian Weimer2019-07-0235-327/+6
| | | | | | | | | | | | | | | | | | | | | With commit f0b2132b35248c1f4a80f62a2c38cddcc802aa8c ("ld.so: Support moving versioned symbols between sonames [BZ #24741]"), the dynamic linker will find the definition of vfork in libc and binds a vfork reference to that symbol, even if the soname in the version reference says that the symbol should be located in libpthread. As a result, the forwarder (whether it's IFUNC-based or a duplicate of the libc implementation) is no longer necessary. On older architectures, a placeholder symbol is required, to make sure that the GLIBC_2.1.2 symbol version does not go away, or is turned in to a weak symbol definition by the link editor. (The symbol version needs to preserved so that the symbol coverage check in elf/dl-version.c does not fail for old binaries.) mips32 is an outlier: It defined __vfork@@GLIBC_2.2, but the baseline is GLIBC_2.0. Since there are other @@GLIBC_2.2 symbols, the placeholder symbol is not needed there.
* Call _dl_open_check after relocation [BZ #24259]H.J. Lu2019-07-0116-3/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a workaround for [BZ #20839] which doesn't remove the NODELETE object when _dl_open_check throws an exception. Move it after relocation in dl_open_worker to avoid leaving the NODELETE object mapped without relocation. [BZ #24259] * elf/dl-open.c (dl_open_worker): Call _dl_open_check after relocation. * sysdeps/x86/Makefile (tests): Add tst-cet-legacy-5a, tst-cet-legacy-5b, tst-cet-legacy-6a and tst-cet-legacy-6b. (modules-names): Add tst-cet-legacy-mod-5a, tst-cet-legacy-mod-5b, tst-cet-legacy-mod-5c, tst-cet-legacy-mod-6a, tst-cet-legacy-mod-6b and tst-cet-legacy-mod-6c. (CFLAGS-tst-cet-legacy-5a.c): New. (CFLAGS-tst-cet-legacy-5b.c): Likewise. (CFLAGS-tst-cet-legacy-mod-5a.c): Likewise. (CFLAGS-tst-cet-legacy-mod-5b.c): Likewise. (CFLAGS-tst-cet-legacy-mod-5c.c): Likewise. (CFLAGS-tst-cet-legacy-6a.c): Likewise. (CFLAGS-tst-cet-legacy-6b.c): Likewise. (CFLAGS-tst-cet-legacy-mod-6a.c): Likewise. (CFLAGS-tst-cet-legacy-mod-6b.c): Likewise. (CFLAGS-tst-cet-legacy-mod-6c.c): Likewise. ($(objpfx)tst-cet-legacy-5a): Likewise. ($(objpfx)tst-cet-legacy-5a.out): Likewise. ($(objpfx)tst-cet-legacy-mod-5a.so): Likewise. ($(objpfx)tst-cet-legacy-mod-5b.so): Likewise. ($(objpfx)tst-cet-legacy-5b): Likewise. ($(objpfx)tst-cet-legacy-5b.out): Likewise. (tst-cet-legacy-5b-ENV): Likewise. ($(objpfx)tst-cet-legacy-6a): Likewise. ($(objpfx)tst-cet-legacy-6a.out): Likewise. ($(objpfx)tst-cet-legacy-mod-6a.so): Likewise. ($(objpfx)tst-cet-legacy-mod-6b.so): Likewise. ($(objpfx)tst-cet-legacy-6b): Likewise. ($(objpfx)tst-cet-legacy-6b.out): Likewise. (tst-cet-legacy-6b-ENV): Likewise. * sysdeps/x86/tst-cet-legacy-5.c: New file. * sysdeps/x86/tst-cet-legacy-5a.c: Likewise. * sysdeps/x86/tst-cet-legacy-5b.c: Likewise. * sysdeps/x86/tst-cet-legacy-6.c: Likewise. * sysdeps/x86/tst-cet-legacy-6a.c: Likewise. * sysdeps/x86/tst-cet-legacy-6b.c: Likewise. * sysdeps/x86/tst-cet-legacy-mod-5.c: Likewise. * sysdeps/x86/tst-cet-legacy-mod-5a.c: Likewise. * sysdeps/x86/tst-cet-legacy-mod-5b.c: Likewise. * sysdeps/x86/tst-cet-legacy-mod-5c.c: Likewise. * sysdeps/x86/tst-cet-legacy-mod-6.c: Likewise. * sysdeps/x86/tst-cet-legacy-mod-6a.c: Likewise. * sysdeps/x86/tst-cet-legacy-mod-6b.c: Likewise. * sysdeps/x86/tst-cet-legacy-mod-6c.c: Likewise.
* powerpc: Use faster means to access FPSCR when possible in some casesPaul A. Clarke2019-06-305-30/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Using 'mffs' instruction to read the Floating Point Status Control Register (FPSCR) can force a processor flush in some cases, with undesirable performance impact. If the values of the bits in the FPSCR which force the flush are not needed, an instruction that is new to POWER9 (ISA version 3.0), 'mffsl' can be used instead. Cases included: get_rounding_mode, fegetround, fegetmode, fegetexcept. * sysdeps/powerpc/bits/fenvinline.h (__fegetround): Use __fegetround_ISA300() or __fegetround_ISA2() as appropriate. (__fegetround_ISA300) New. (__fegetround_ISA2) New. * sysdeps/powerpc/fpu_control.h (IS_ISA300): New. (_FPU_MFFS): Move implementation... (_FPU_GETCW): Here. (_FPU_MFFSL): Move implementation.... (_FPU_GET_RC_ISA300): Here. New. (_FPU_GET_RC): Use _FPU_GET_RC_ISA300() or _FPU_GETCW() as appropriate. * sysdeps/powerpc/fpu/fenv_libc.h (fegetenv_status_ISA300): New. (fegetenv_status): New. * sysdeps/powerpc/fpu/fegetmode.c (fegetmode): Use fegetenv_status() instead of fegetenv_register(). * sysdeps/powerpc/fpu/fegetexcept.c (__fegetexcept): Likewise. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* Linux: Use mmap instead of malloc in dirent/tst-getdents64Florian Weimer2019-06-281-3/+9
| | | | | malloc dirties the entire allocated memory region due to M_PERTURB in the test harness.
* Replace PREPARE_VERSION macro with inline functionTobias Klauser2019-06-281-9/+9
| | | | | | | | | * sysdeps/unix/sysv/linux/dl-vdso.h (PREPARE_VERSION): Remove macro. (prepare_version_base): New helper inline function. (prepare_version): New macro replacing PREPARE_VERSION. (PREPARE_VERSION_KNOWN): Use prepare_version instead of PREPARE_VERSION. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* io: Remove copy_file_range emulation [BZ #24744]Florian Weimer2019-06-286-28/+5
| | | | | | | | | | The kernel is evolving this interface (e.g., removal of the restriction on cross-device copies), and keeping up with that is difficult. Applications which need the function should run kernels which support the system call instead of relying on the imperfect glibc emulation. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Adjust gedents64 buffer size to int range [BZ #24740]Florian Weimer2019-06-273-0/+55
| | | | | | | | | The kernel interface uses type unsigned int, but there is an internal conversion to int, so INT_MAX is the correct limit. Part of the buffer will always be unused, but this is not a problem. Such huge buffers do not occur in practice anyway. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* x86: Add sysdeps/x86/dl-lookupcfg.hH.J. Lu2019-06-262-31/+0
| | | | | | | | | Since sysdeps/i386/dl-lookupcfg.h and sysdeps/x86_64/dl-lookupcfg.h are identical, we can replace them with sysdeps/x86/dl-lookupcfg.h. * sysdeps/i386/dl-lookupcfg.h: Moved to ... * sysdeps/x86/dl-lookupcfg.h: Here. * sysdeps/x86_64/dl-lookupcfg.h: Removed.
* powerpc: Use generic e_expfAdhemerval Zanella2019-06-267-383/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generic implementation is faster on both power8 and power9: POWER9: - sysdeps/ieee754/flt-32/e_expf.c "expf": { "workload-spec2017.wrf": { "duration": 5.1236e+09, "iterations": 7.53344e+08, "reciprocal-throughput": 5.9436, "latency": 7.65869, "max-throughput": 1.68248e+08, "min-throughput": 1.30571e+08 } } - sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S "expf": { "workload-spec2017.wrf": { "duration": 5.14429e+09, "iterations": 5.29248e+08, "reciprocal-throughput": 8.05372, "latency": 11.3863, "max-throughput": 1.24166e+08, "min-throughput": 8.78249e+07 } } Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (libm-sysdep_routines): Remove e_expf-power8 and expf-ppc64. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S: Remove file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c: Likewise. Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
* powerpc: Refactor powerpc32 lround/lroundf/llround/llroundfAdhemerval Zanella2019-06-2622-547/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patches consolidates all the powerpc llround{f} implementations on the generic sysdeps/powerpc/powerpc32/fpu/s_llround{f}. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/powerpc32/fpu/Makefile [$(subdir) == math] (CFLAGS-s_lround.c): New rule. * sysdeps/powerpc/powerpc32/fpu/s_llround.c (__llround): Add power5+ and fctidz optimization. * sysdeps/powerpc/powerpc32/fpu/s_lround.S: Remove file. * sysdeps/powerpc/powerpc32/fpu/s_lround.c: New file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile (CFLAGS-s_llround-power6.c, CFLAGS-s_llround-power5+.c, CFLAGS-s_llround-ppc32.c, CFLAGS-s_lround-ppc32.c, CFLAGS-s_lround-power5+.c): New rule. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power5+.c: New file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power5+.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power5+.S: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power6.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power5+.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S: Likewise. * sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S: Likewise. * sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S: Likewise. Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
* Linux: Add nds32 specific syscalls to syscall-names.listVincent Chen2019-06-261-0/+2
| | | | | | The nds32 creates two specific syscalls, udftrap and fp_udfiex_crtl, in kernel v5.0 and v5.2, respectively. Add these two syscalls to syscall-names.list.
* S390: Regenerate ULPs.Stefan Liebler2019-06-251-6/+6
| | | | | | | | The update is needed for builds with -O3 and -march>=z13. ChangeLog: * sysdeps/s390/fpu/libm-test-ulps: Regenerated.
* Add missing VDSO_{NAME,HASH}_* macros and use them for PREPARE_VERSION_KNOWNTobias Klauser2019-06-218-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Define all currently used Linux versions used for PREPARE_VERSION{,_KNOWN} in sysdeps/unix/sysv/linux/dl-vdso.h and use them instead of duplicating the versions and precomputed hashes across architecture specific files. * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c (INIT_ARCH): Use PREPARE_VERSION_KNOWN. * sysdeps/unix/sysv/linux/aarch64/init-first.c: Likewise. * sysdeps/unix/sysv/linux/dl-vdso.h (VDSO_NAME_LINUX_2_6_39): New define. (VDSO_HASH_LINUX_2_6_39): Likewise. (VDSO_NAME_LINUX_4_9): Likewise. (VDSO_HASH_LINUX_4_9): Likewise. * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (INIT_ARCH): Likewise. * sysdeps/unix/sysv/linux/powerpc/init-first.c (_libc_vdso_platform_setup): Likewise. * sysdeps/unix/sysv/linux/powerpc/time.c (INIT_ARCH): Likewise. * sysdeps/unix/sysv/linux/s390/init-first.c (_libc_vdso_platform_setup): Likewise. * sysdeps/unix/sysv/linux/x86_64/init-first.c (__vdso_platform_setup): Likewise. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* [powerpc] add 'volatile' to asmPaul A. Clarke2019-06-192-5/+5
| | | | | | | | | | | | | | Add 'volatile' keyword to a few asm statements, to force the compiler to generate the instructions therein. Some instances were implicitly volatile, but adding keyword for consistency. 2019-06-19 Paul A. Clarke <pc@us.ibm.com> * sysdeps/powerpc/fpu/fenv_libc.h (relax_fenv_state): Add 'volatile'. * sysdeps/powerpc/fpu/fpu_control.h (__FPU_MFFS): Likewise. (__FPU_MFFSL): Likewise. (_FPU_SETCW): Likewise.
* powerpc: Fix static-linked version of __ppc_get_timebase_freq [BZ #24640]Stan Shebs2019-06-193-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __ppc_get_timebase_freq() always return 0 when using static linked glibc. This is a minimal example.c to reproduce: /******************************/ #include <inttypes.h> #include <stdint.h> #include <stdio.h> #include <sys/platform/ppc.h> int main() { uint64_t freq = __ppc_get_timebase_freq(); printf("Time Base frequency = %"PRIu64" Hz\n", freq); if (freq == 0) return -1; return 0; } /******************************/ Compile command: gcc -static example.c This bug has been reproduced, fixed and tested on all powerpc platforms (ppc32, ppc64 and ppc64le). The underlying code of __ppc_get_timebase_freq uses __get_timebase_freq that has a different implementation for shared and static version of glibc. In the static version, there is an incorrect sense in the if check for the fd returned when opening /proc/cpuinfo. This solution is mostly a cherry-pick from: commit 4791e4f773d060c1a37b27aac5b03cdfa9327afc Author: Stan Shebs <stanshebs@google.com> Date: Fri May 17 12:25:19 2019 -0700 Subject: Fix sense of a test in the static-linking version of ppc get_clockfreq That is in branch glibc/google/grte/v5-2.27/master and was mentioned for inclusion on master here: https://www.sourceware.org/ml/libc-alpha/2019-05/msg00409.html Adapted from original fix for get_clockfreq. That code was moved to get_timebase_freq. Also added a static-build testcase for __ppc_get_timebase_freq since the underlying function has different implementations for shared and static build. [BZ #24640] * sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c [!SHARED] (__get_timebase_freq): Fix sense of a test in the static-linking version. * sysdeps/unix/sysv/linux/powerpc/Makefile (tests-static): Add test-gettimebasefreq-static. (tests): Likewise. * sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c: New file.
* m68k: Remove vDSO supportAdhemerval Zanella2019-06-179-321/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Although defined in initial TLS/NPTL ABI for m68k and ColdFire [1], kernel support was never pushed upstream. This patch removes the unused m68k vDSO support. Checked with a build against m68k and m68k-coldfire and some basic tests on ARAnyM. * sysdeps/unix/sysv/linux/m68k/Makefile (sysdep_routines, sysdep-rtld-routines): Remove rules. * sysdeps/unix/sysv/linux/m68k/Versions (libc) [GLIBC_PRIVATE]: Remove __vdso_atomic_cmpxchg_32 and __vdso_atomic_barrier. (ld) [GLIBC_PRIVATE]: __rtld___vdso_read_tp, __rtld___vdso_atomic_cmpxchg_32, and __rtld___vdso_atomic_barrier. * sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h (atomic_compare_and_exchange_val_acq, atomic_full_barrier): Remove vDSO path for SHARED. * sysdeps/unix/sysv/linux/m68k/init-first.c: Remove file. * sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c: Likewise. * sysdeps/unix/sysv/linux/m68k/m68k-helpers.S: Likewise. * sysdeps/unix/sysv/linux/m68k/m68k-vdso.c: Likewise. * sysdeps/unix/sysv/linux/m68k/m68k-vdso.h: Likewise. * sysdeps/unix/sysv/linux/m68k/m68k-helpers.c: New file. [1] https://lists.debian.org/debian-68k/2007/11/msg00071.html
* powerpc: Refactor powerpc64 lround/lroundf/llround/llroundfAdhemerval Zanella2019-06-1730-490/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patches consolidates all the powerpc {l}lround{f} implementations on the generic sysdeps/powerpc/fpu/s_{l}lround{f}.c. The IFUNC support is also moved only to powerpc64 only, since for powerpc64le generic implementation resulting in optimized code. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_llround-power8, s_llround-power6x, s_llround-power5+, s_llround-ppc64, and s_llroundf-ppc64. (CFLAGS-s_llround-power8.c, CFLAGS-s_llround-power6x.c, CFLAGS-s_llround-power5+.c): New rule. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power5+.c: New file. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power6x.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-power8.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llround.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llroundf.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_lround.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_lround.c: ... here. * sysdeps/powerpc/powerpc64/fpu/Makefile [$(subdir) == math] (CFLAGS-s_llround.c): New rule. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (libm-sysdep_routines): Remove s_llround-* objects. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S: Remove file. * 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/s_llround.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lround.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lroundf.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llround.c: New file. * sysdeps/powerpc/powerpc64/fpu/s_llroundf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lround.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lroundf.c: Likewise. * sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S: Likewise. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S: Likewise. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
* powerpc: Refactor powerpc32 lrint/lrintf/llrint/llrintfAdhemerval Zanella2019-06-1722-342/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patches consolidates all the powerpc llrint{f} implementations on the generic sysdeps/powerpc/powerpc32/fpu/s_llrint{f}. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cpu and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/fpu/s_lrintf.S: Remove file. * sysdeps/powerpc/powerpc64/fpu/s_lrintf.c: Move to ... * sysdeps/powerpc/fpu/s_lrintf.c: ... here. * sysdeps/powerpc/powerpc32/fpu/Makefile [$(subdir) == math] (CFLAGS-s_lrint.c): New rule. * sysdeps/powerpc/powerpc32/fpu/s_llrint.c (__llrint): Add power4 optimization. * sysdeps/powerpc/powerpc32/fpu/s_llrintf.c (__llrintf): Likewise. * sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Remove file. * sysdeps/powerpc/powerpc32/fpu/s_lrint.c: New file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile (CFLAGS-s_llrintf-power6.c, CFLAGS-s_llrintf-ppc32.c, CFLAGS-s_llrint-power6.c, CFLAGS-s_llrint-ppc32.c, CFLAGS-s_lrint-ppc32.c): New rule. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-power6.S: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-power6.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-power6.c: New file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-ppc32.c: Likewise. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
* powerpc: refactor powerpc64 lrint/lrintf/llrint/llrintfAdhemerval Zanella2019-06-1721-225/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patches consolidates all the powerpc llrint{f} implementations on the generic sysdeps/powerpc/fpu/s_llrint{f}. The IFUNC support is also moved only to powerpc64 only, since for powerpc64le generic implementation resulting in optimized code. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_llrint-power8, s_llrint-power6x, and s_llrint-ppc64. (CFLAGS-s_llrint-power8.c, CFLAGS-s_llrint-power6x.c): New rule. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llrint-power6x.c: New file. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llrint-power8.c: Likewise. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llrint-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_lrint.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_lrint.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llrint.c: ... here. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c: Move to ... * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_llrintf.c: ... here. * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_lrint.c: New file. * sysdeps/powerpc/powerpc64/fpu/Makefile: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (libm-sysdep_routines): Remove s_llrint-* objects. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S: Remove file. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llrint.c: New file. * sysdeps/powerpc/powerpc64/fpu/s_llrintf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lrint.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lrintf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Remove file. * sysdeps/powerpc/powerpc64/fpu/s_llrintf.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_lrint.S: Likewise. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: Likewise. * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: Likewise. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
* Linux: Fix __glibc_has_include use for <sys/stat.h> and statxFlorian Weimer2019-06-141-2/+5
| | | | | | | | | | | | | | | The identifier linux is used as a predefined macro, so the actually used path is 1/stat.h or 1/stat64.h. Using the quote-based version triggers a file lookup for /usr/include/bits/linux/stat.h (or whatever directory is used to store bits/statx.h), but since bits/ is pretty much reserved by glibc, this appears to be acceptable. This is related to GCC PR 80005: incorrect macro expansion of the argument of __has_include. Suggested by Zack Weinberg. Reviewed-by: Carlos O'Donell <carlos@redhat.com>