glibc:nsz/mathvec

Last commit made on 2019-07-16
Get this branch:
git clone -b nsz/mathvec https://git.launchpad.net/glibc

Branch merges

Branch information

Name:
nsz/mathvec
Repository:
lp:glibc

Recent commits

9179115... by Szabolcs Nagy <email address hidden>

aarch64: add vector sin, cos, log and pow abi symbols

Add simple assembly implementations that fall back to scalar code,
similar to the vector exp code.

2019-07-15 Szabolcs Nagy <email address hidden>

 * sysdeps/aarch64/fpu/Makefile: Add functions.
 * sysdeps/aarch64/fpu/Versions: Add symbols.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_cos.S: New file.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_log.S: New file.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_pow.S: New file.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_sin.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_cosf.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_logf.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_powf.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_sinf.S: New file.
 * sysdeps/aarch64/fpu/test-double-vlen2-wrappers.c: Add wrappers.
 * sysdeps/aarch64/fpu/test-float-vlen4-wrappers.c: Add wrappers.
 * sysdeps/aarch64/libm-test-ulps: Update.
 * sysdeps/unix/sysv/linux/aarch64/libmvec.abilist: Update.

80792b6... by Szabolcs Nagy <email address hidden>

Aarch64: Add simd exp/expf ABI symbols

The implementation is in assembly and just calls the scalar math code.
This ensures that old compiler without vector call abi support can
build libmvec. The abi is supported since GCC 9.1, the specification is

https://developer.arm.com/tools-and-software/server-and-hpc/arm-architecture-tools/arm-compiler-for-hpc/vector-function-abi

Vector functions require a STO_AARCH64_VARIANT_PCS marking in the
dynamic symbol table for lazy bound calls to work. This will be
missing in libmvec, which works because the marking only affects
the behaviour if there are calls to the symbols in the binary.

Testing requires vector call abi support, which is detected.

Header declarations are not added yet, so the symbols will not be used
by the compiler: they are just added so the abi is in place which
enables backporting later. Currently we cannot add correct declarations
that only declare the specific symbols we provide: the OpenMP pragma
mechanism would declare both AdvSIMD and SVE variants.

2019-07-15 Steve Ellcey <email address hidden>
     Szabolcs Nagy <email address hidden>

 * sysdeps/aarch64/configure.ac (build_mathvec): Enable.
 (test-mathvec): Enable if ABI is supported.
 * sysdeps/aarch64/configure: Regenerate.
 * sysdeps/aarch64/fpu/Makefile
 (libmvec-support): Add libmvec_double_vlen2_exp,
 libmvec_float_vlen4_expf to list.
 (libmvec_nonshared.a): Use make-dummy-lib.
 (libmvec-tests): Add double-vlen2, float-vlen4 to list.
 (double-vlen2-funcs): Add new vector function name.
 (float-vlen4-funcs): Add new vector function name.
 * sysdeps/aarch64/fpu/Versions: New file.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2.h: New file.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_exp.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4.h: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_expf.S: New file.
 * sysdeps/aarch64/fpu/test-double-vlen2-wrappers.c: New file.
 * sysdeps/aarch64/fpu/test-float-vlen4-wrappers.c: New file.
 * sysdeps/aarch64/libm-test-ulps (exp_vlen2): New entry.
 (exp_vlen4): Likewise.
 * sysdeps/unix/sysv/linux/aarch64/libmvec.abilist: New file.

1ff1373... by Mike Crowe

nptl: Remove futex_supports_exact_relative_timeouts

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 <email address hidden>

65dd7e9... by Mike Crowe

Update NEWS for new _clockwait and _clocklock functions

 * NEWS: Mention recently-added pthread_cond_clockwait,
 pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock and
 sem_clockwait functions.

Reviewed-by: Adhemerval Zanella <email address hidden>

9d20e22... by Mike Crowe

nptl: Add POSIX-proposed pthread_mutex_clocklock

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 <email address hidden>

5921309... by Mike Crowe

nptl: Rename lll_timedlock to lll_clocklock and add clockid parameter

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 <email address hidden>

e996fa7... by Mike Crowe

nptl: Add POSIX-proposed pthread_rwlock_clockrdlock & pthread_rwlock_clockwrlock

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 <email address hidden>

600b4be... by Mike Crowe

nptl: pthread_rwlock: Move timeout validation into _full functions

As recommended by the comments in the implementations of
pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock, let's move
the timeout validity checks into the corresponding pthread_rwlock_rdlock_full
and pthread_rwlock_wrlock_full functions. Since these functions may be
called with abstime == NULL, an extra check for that is necessary too.

 * nptl/pthread_rwlock_common.c (__pthread_rwlock_rdlock_full):
 Check validity of abstime parameter.
 (__pthread_rwlock_rwlock_full): Likewise.
 * nptl/pthread_rwlock_timedrdlock.c
 * (pthread_rwlock_timedrdlock):
 Remove check for validity of abstime parameter.
 * nptl/pthread_rwlock_timedwrlock.c
 * (pthread_rwlock_timedwrlock):
 Likewise.

Reviewed-by: Adhemerval Zanella <email address hidden>

afe4de7... by Mike Crowe

nptl: Add POSIX-proposed pthread_cond_clockwait

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 <email address hidden>

6615f77... by Mike Crowe

nptl: Add POSIX-proposed sem_clockwait

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 <email address hidden>