aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)Author
2021-04-12linux: always update select timeout (BZ #27706)Adhemerval Zanella
The timeout should be updated even on failure for time64 support. Checked on i686-linux-gnu.
2021-04-12linux: Normalize and return timeout on select (BZ #27651)Adhemerval Zanella
The commit 2433d39b697, which added time64 support to select, changed the function to use __NR_pselect6 (or __NR_pelect6_time64) on all architectures. However, on architectures where the symbol was implemented with __NR_select the kernel normalizes the passed timeout instead of return EINVAL. For instance, the input timeval { 0, 5000000 } is interpreted as { 5, 0 }. And as indicated by BZ #27651, this semantic seems to be expected and changing it results in some performance issues (most likely the program does not check the return code and keeps issuing select with unormalized tv_usec argument). To avoid a different semantic depending whether which syscall the architecture used to issue, select now always normalize the timeout input. This is a slight change for some ABIs (for instance aarch64). Checked on x86_64-linux-gnu and i686-linux-gnu.
2021-04-12arm: Fix an incorrect check in ____longjmp_chk [BZ #27709]Szabolcs Nagy
An incorrect check in __longjmp_chk could fail on valid code causing FAIL: debug/tst-longjmp_chk2 The original check was altstack_sp + altstack_size - setjmp_sp > altstack_size i.e. sp at setjmp was outside of the altstack range. Here we know that longjmp is called from a signal handler on the altstack (SS_ONSTACK), and that it jumps in the wrong direction (sp decreases), so the check wants to ensure the jump goes to another stack. The check is wrong when altstack_sp == setjmp_sp which can happen when the altstack is a local buffer in the function that calls setjmp, so the patch allows == too. This fixes bug 27709. Note that the generic __longjmp_chk check seems to be different. (it checks if longjmp was on the altstack but does not check setjmp, so it would not catch incorrect longjmp use within the signal handler).
2021-04-12hurd: Export _hurd_libc_proc_initSamuel Thibault
hurd's libdiskfs needs to be able to call _hurd_init + _hurd_libc_proc_init for bootstrap initialization.
2021-04-09powerpc: Update libm test ulpsTulio Magno Quites Machado Filho
Update after commit 43576de04afc6a0896a3ecc094e1581069a0652a.
2021-04-08arm: update libm test ulpsSzabolcs Nagy
Updated after commits 9acda61d94acc5348c2330f2519a14d1a4a37e73 and 43576de04afc6a0896a3ecc094e1581069a0652a.
2021-04-08aarch64: update libm test ulpsSzabolcs Nagy
Update after commit 43576de04afc6a0896a3ecc094e1581069a0652a.
2021-04-07Improve the accuracy of tgamma (BZ #26983)Paul Zimmermann
With this patch, the maximal known error for tgamma is now reduced to 9 ulps for dbl-64, for all rounding modes. Since exhaustive testing is not possible for dbl-64, it might be that there are still cases with an error larger than 9 ulps, but all known cases are fixed (intensive tests were done to find cases with large errors). Tested on x86_64 and powerpc (and by Adhemerval Zanella on aarch64, arm, s390x, sparc, and i686). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-04-06Update hppa libm-test-ulpsJohn David Anglin
2021-04-06m68: Fix build after 9acda61d94acAdhemerval Zanella
The j0f/j1f/y0f/y1f now uses __inv_pio4.
2021-04-06aarch64: free tlsdesc data on dlclose [BZ #27403]Szabolcs Nagy
DL_UNMAP_IS_SPECIAL and DL_UNMAP were not defined. The definitions are now copied from arm, since the same is needed on aarch64. The cleanup of tlsdesc data is handled by the custom _dl_unmap. Fixes bug 27403.
2021-04-05ia64: Update ulpsAdhemerval Zanella
Required after 9acda61d94acc "Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]" and db3f7bb558 "math: Remove slow paths from asin and acos [BZ #15267]".
2021-04-05ia64: Fix build after 9acda61d94acAdhemerval Zanella
The j0f/j1f/y0f/y1f now uses __inv_pio4 and call roundf (which turns to __roundf on ia64).
2021-04-05i386: Update ulpsAdhemerval Zanella
Required after 9acda61d94acc "Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]".
2021-04-02Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]Paul Zimmermann
For j0f/j1f/y0f/y1f, the largest error for all binary32 inputs is reduced to at most 9 ulps for all rounding modes. The new code is enabled only when there is a cancellation at the very end of the j0f/j1f/y0f/y1f computation, or for very large inputs, thus should not give any visible slowdown on average. Two different algorithms are used: * around the first 64 zeros of j0/j1/y0/y1, approximation polynomials of degree 3 are used, computed using the Sollya tool (https://www.sollya.org/) * for large inputs, an asymptotic formula from [1] is used [1] Fast and Accurate Bessel Function Computation, John Harrison, Proceedings of Arith 19, 2009. Inputs yielding the new largest errors are added to auto-libm-test-in, and ulps are regenerated for various targets (thanks Adhemerval Zanella). Tested on x86_64 with --disable-multi-arch and on powerpc64le-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-04-01x86-64: Fix ifdef indentation in strlen-evex.SSunil K Pandey
Fix some indentations of ifdef in file strlen-evex.S which are off by 1 and confusing to read.
2021-04-01Update Nios II libm-test-ulps.Joseph Myers
2021-04-01Update arm libm-tests-ulpsAdhemerval Zanella
Required after db3f7bb558 "math: Remove slow paths from asin and acos [BZ #15267]".
2021-04-01x86_64: Correct THREAD_SETMEM/THREAD_SETMEM_NC for movq [BZ #27591]H.J. Lu
config/i386/constraints.md in GCC has (define_constraint "e" "32-bit signed integer constant, or a symbolic reference known to fit that range (for immediate operands in sign-extending x86-64 instructions)." (match_operand 0 "x86_64_immediate_operand")) Since movq takes a signed 32-bit immediate or a register source operand, use "er", instead of "nr"/"ir", constraint for 32-bit signed integer constant or register on movq. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-04-01powerpc64le: Use ifunc for _Float128 functions also in libcAndreas Schwab
This fixes missing definition of math functions in libc in a static link that are no longer built for libm after commit 4898d9712b ("Avoid adding duplicated symbols into static libraries").
2021-04-01S390: Allow "v" constraint for long double math_opt_barrier and ↵Stefan Liebler
math_force_eval with GCC 11. Starting with GCC 11, long double values can also be processed in vector registers if build with -march >= z14. Then GCC defines the __LONG_DOUBLE_VX__ macro. FYI: GCC commit "IBM Z: Introduce __LONG_DOUBLE_VX__ macro" https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f47df2af313d2ce7f9149149010a142c2237beda
2021-03-31Fix conform linknamespace tests due to gnu_dev_makedevStefan Liebler
If building on s390 / i686 with -Os, various conformance tests are failing with e.g. conform/ISO/assert.h/linknamespace.out: [initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __getcwd -> [libc.a(getcwd.o)] __fstatat64 -> [libc.a(fstatat64.o)] gnu_dev_makedev The usage of gnu_dev_makedev was recently introduced by usage of the makedev makro in commit: 5b980d4809913088729982865188b754939bcd39 linux: Use statx for MIPSn64 This patch is now linking against __gnu_dev_makedev as also done in commit: 8b4a118222c7ed41bc653943b542915946dff1dd Fix -Os gnu_dev_* linknamespace, localplt issues (bug 15105, bug 19463).
2021-03-30Update sparc libm-tests-ulpsAdhemerval Zanella
Required after db3f7bb558 "math: Remove slow paths from asin and acos [BZ #15267]".
2021-03-30Move __isnanf128 to libc.soSiddhesh Poyarekar
All of the isnan functions are in libc.so due to printf_fp, so move __isnanf128 there too for consistency. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2021-03-29fork.h: replace with register-atfork.hSamuel Thibault
UNREGISTER_ATFORK is now defined for all ports in register-atfork.h, so most previous includes of fork.h actually only need register-atfork.h now, and cxa_finalize.c does not need an ifdef UNREGISTER_ATFORK any more. The nptl-specific fork generation counters can then go to pthreadP.h, and fork.h be removed. Checked on x86_64-linux-gnu and i686-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-29x86-64: Use ZMM16-ZMM31 in AVX512 memmove family functionsH.J. Lu
Update ifunc-memmove.h to select the function optimized with AVX512 instructions using ZMM16-ZMM31 registers to avoid RTM abort with usable AVX512VL since VZEROUPPER isn't needed at function exit.
2021-03-29x86-64: Use ZMM16-ZMM31 in AVX512 memset family functionsH.J. Lu
Update ifunc-memset.h/ifunc-wmemset.h to select the function optimized with AVX512 instructions using ZMM16-ZMM31 registers to avoid RTM abort with usable AVX512VL and AVX512BW since VZEROUPPER isn't needed at function exit.
2021-03-29x86: Add string/memory function tests in RTM regionH.J. Lu
At function exit, AVX optimized string/memory functions have VZEROUPPER which triggers RTM abort. When such functions are called inside a transactionally executing RTM region, RTM abort causes severe performance degradation. Add tests to verify that string/memory functions won't cause RTM abort in RTM region.
2021-03-29x86-64: Add AVX optimized string/memory functions for RTMH.J. Lu
Since VZEROUPPER triggers RTM abort while VZEROALL won't, select AVX optimized string/memory functions with xtest jz 1f vzeroall ret 1: vzeroupper ret at function exit on processors with usable RTM, but without 256-bit EVEX instructions to avoid VZEROUPPER inside a transactionally executing RTM region.
2021-03-29x86-64: Add memcmp family functions with 256-bit EVEXH.J. Lu
Update ifunc-memcmp.h to select the function optimized with 256-bit EVEX instructions using YMM16-YMM31 registers to avoid RTM abort with usable AVX512VL, AVX512BW and MOVBE since VZEROUPPER isn't needed at function exit.
2021-03-29x86-64: Add memset family functions with 256-bit EVEXH.J. Lu
Update ifunc-memset.h/ifunc-wmemset.h to select the function optimized with 256-bit EVEX instructions using YMM16-YMM31 registers to avoid RTM abort with usable AVX512VL and AVX512BW since VZEROUPPER isn't needed at function exit.
2021-03-29x86-64: Add memmove family functions with 256-bit EVEXH.J. Lu
Update ifunc-memmove.h to select the function optimized with 256-bit EVEX instructions using YMM16-YMM31 registers to avoid RTM abort with usable AVX512VL since VZEROUPPER isn't needed at function exit.
2021-03-29x86-64: Add strcpy family functions with 256-bit EVEXH.J. Lu
Update ifunc-strcpy.h to select the function optimized with 256-bit EVEX instructions using YMM16-YMM31 registers to avoid RTM abort with usable AVX512VL and AVX512BW since VZEROUPPER isn't needed at function exit.
2021-03-29x86-64: Add ifunc-avx2.h functions with 256-bit EVEXH.J. Lu
Update ifunc-avx2.h, strchr.c, strcmp.c, strncmp.c and wcsnlen.c to select the function optimized with 256-bit EVEX instructions using YMM16-YMM31 registers to avoid RTM abort with usable AVX512VL, AVX512BW and BMI2 since VZEROUPPER isn't needed at function exit. For strcmp/strncmp, prefer AVX2 strcmp/strncmp if Prefer_AVX2_STRCMP is set.
2021-03-29x86: Set Prefer_No_VZEROUPPER and add Prefer_AVX2_STRCMPH.J. Lu
1. Set Prefer_No_VZEROUPPER if RTM is usable to avoid RTM abort triggered by VZEROUPPER inside a transactionally executing RTM region. 2. Since to compare 2 32-byte strings, 256-bit EVEX strcmp requires 2 loads, 3 VPCMPs and 2 KORDs while AVX2 strcmp requires 1 load, 2 VPCMPEQs, 1 VPMINU and 1 VPMOVMSKB, AVX2 strcmp is faster than EVEX strcmp. Add Prefer_AVX2_STRCMP to prefer AVX2 strcmp family functions.
2021-03-29linux: Add y2106 support on utimensat testsAdhemerval Zanella
The tests are refactored to use a common skeleton that handles whether the underlying filesystem supports 64 bit time, skips 64 bit time tests when the TU only supports 32 bit, and also skip 64 bit time tests larger than 32 unsigned int (y2106) if the system does not support it (MIPSn64 on kernels without statx support). Checked on x86_64-linux-gnu and i686-linux-gnu. I also checked on a mips64el-linux-gnu with 4.1.4 and 5.10.0-4-5kc-malta kernel to verify if the y2106 are indeed skipped.
2021-03-29linux: Use statx for MIPSn64Adhemerval Zanella
MIPSn64 kernel ABI for legacy stat uses unsigned 32 bit for second timestamp, which limits the maximum value to y2106. This patch make mips64 use statx as for 32-bit architectures. Thie __cp_stat64_t64_statx is open coded, its usage is solely on fstatat64 and it avoid the need to redefine the name for mips64 (which will call __cp_stat64_statx since its does not use __stat64_t64 internally).
2021-03-29linux: Disable fstatat64 fallback if __ASSUME_STATX is definedAdhemerval Zanella
If the minimum kernel supports statx there is no need to call the fallback stat legacy syscalls. The statx is also called on compat xstat syscall, but different than the fstatat it calls no fallback and it is assumed to be always present. Checked on powerpc-linux-gnu (with and without --enable-kernel=4.11) and on powerpc64-linux-gnu.
2021-03-29linux: Implement fstatat with __fstatat64_time64Adhemerval Zanella
It makes fstatat use __NR_statx, which fix the s390 issue with missing nanoxsecond support on compat stat syscalls (at least on recent kernels) and limits the statx call to only one function (which simplifies the __ASSUME_STATX support). Checked on i686-linux-gnu and on powerpc-linux-gnu.
2021-03-29x86: Properly disable XSAVE related features [BZ #27605]H.J. Lu
1. Support GLIBC_TUNABLES=glibc.cpu.hwcaps=-XSAVE. 2. Disable all features which depend on XSAVE: a. If OSXSAVE is disabled by glibc tunables. Or b. If both XSAVE and XSAVEC aren't usable.
2021-03-26nptl: Remove __libc_allocate_rtsig, __libc_current_sigrtmax, and ↵Adhemerval Zanella
__libc_current_sigrtmin The libc version is identical and built with same flags. Checked on x86_64-linux-gnu.
2021-03-26nptl: Move sigaction to libcAdhemerval Zanella
The libc version is identical and built with same flags. Checked on x86_64-linux-gnu.
2021-03-26nptl: Remove pthread raise implementationAdhemerval Zanella
The Linux version already target the current thread by using tgkill along with getpid and gettid. For arm, libpthread does not do a intra PLT since it will call the raise from libc. Checked on x86_64-linux-gnu.
2021-03-26nptl: Move pthread_kill to libcAdhemerval Zanella
A new 2.34 version is also provided. Checked on x86_64-linux-gnu.
2021-03-26nptl: Remove pwrite from libpthreadAdhemerval Zanella
The libc version is identical and built with same flags, it is also uses as the default version. Checked on x86_64-linux-gnu.
2021-03-26nptl: Remove pread from libpthreadAdhemerval Zanella
The libc version is identical and built with same flags, it is also uses as the default version. Checked on x86_64-linux-gnu.
2021-03-26nptl: Remove open from libpthreadAdhemerval Zanella
The libc version is identical and built with same flags. The libc version is set as the default version. Checked on x86_64-linux-gnu.
2021-03-26nptl: Remove lseek from libpthreadAdhemerval Zanella
The libc version is identical and built with same flags. The libc version is set as the default version. The libpthread compat symbol requires to mask it when building the loader object otherwise ld might complain about a missing versioned symbol (as for alpha). Checked on x86_64-linux-gnu.
2021-03-26nptl: Remove send from libpthreadAdhemerval Zanella
The libc version is identical and built with same flags. Both aarch64 and nios2 also requires to export __send and tt was done previously with the HAVE_INTERNAL_SEND_SYMBOL (which forced the symbol creation). All __send callers are internal to libc and the original issue that required the symbol export was due a missing libc_hidden_def. So a compat symbol is added for __send and the libc_hidden_def is defined regardless. Checked on x86_64-linux-gnu and i686-linux-gnu.
2021-03-26aarch64: Optimize __libc_mtag_tag_zero_regionSzabolcs Nagy
This is a target hook for memory tagging, the original was a naive implementation. Uses the same algorithm as __libc_mtag_tag_region, but with instructions that also zero the memory. This was not benchmarked on real cpu, but expected to be faster than the naive implementation.