aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-12-13or1k: Update libm-test-ulpsStafford Horne1-0/+27
Pick up new functions cospi, "Imaginary part of csin", exp10m1, exp2m1, log10p1, log2p1, sinpi and tanpi.
2024-12-13nptl: Add <thread_pointer.h> for or1kMichael Jeanson1-0/+30
This will be required by the rseq extensible ABI implementation on all Linux architectures exposing the '__rseq_size' and '__rseq_offset' symbols to set the initial value of the 'cpu_id' field which can be used by applications to test if rseq is available and registered. As long as the symbols are exposed it is valid for an application to perform this test even if rseq is not yet implemented in libc for this architecture. Compile tested with build-many-glibcs.py but I don't have access to any hardware to run the tests. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Stafford Horne <shorne@gmail.com>
2024-12-12Implement C23 atan2piJoseph Myers51-2/+14869
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the atan2pi functions (atan2(y,x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-12Clear CXX and TEST_CXX if C++ link test failsH.J. Lu2-12/+2
Since the C++ compiler is used only for testing, use TEST_CXX as the C++ compiler if available. If C++ link test fails, clear both CXX and TEST_CXX so that the C++ compiler isn't used for glibc build nor test. Tested for m68k-linux-gnu-coldfire build and native build on x86-64. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-12math: Remove __XXX math functions from installed math.h [BZ #32418]H.J. Lu5-36/+67
Since libm doesn't export __XXX math functions, don't declare them in the installed math.h by adding <bits/mathcalls-macros.h> to declare __XXX math functions internally for glibc build. This fixes BZ #32418. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-11Optimize bsearch() implementation for performanceKuan-Wei Chiu1-11/+9
Optimize the bsearch() function to improve binary search performance. Although the code size grew by 8 bytes, the new implementation achieves a 15% reduction in execution time on my x86 machine, according to the bench-bsearch benchmark results. Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-11benchtests: Add benchmark test for bsearchKuan-Wei Chiu2-0/+138
Introduce a benchmark test for the bsearch function to evaluate its performance. Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-11Implement C23 atanpiJoseph Myers51-2/+1832
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the atanpi functions (atan(x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-11powerpc64: Fix dl-trampoline.S big-endian / non-ROP build failurePeter Bergner1-1/+5
Fix a big-endian / non-ROP build failure caused by commit 4d9a4c02 when building dl-trampoline.S. Reported-by: Joseph Myers <josmyers@redhat.com>
2024-12-11powerpc: Use correct procedure call standard for getrandom vDSO call (bug 32440)Florian Weimer3-6/+49
A plain indirect function call does not work on POWER because success and failure are signaled through a flag register, and not via the usual Linux negative return value convention. This has potential security impact, in two ways: the return value could be out of bounds (EAGAIN is 11 on powerpc6le), and no random bytes have been written despite the non-error return value. Fixes commit 461cab1de747f3842f27a5d24977d78d561d45f9 ("linux: Add support for getrandom vDSO"). Reported-by: Ján Stanček <jstancek@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-12-11Add TEST_CC and TEST_CXX supportH.J. Lu8-136/+682
Support testing glibc build with a different C compiler or a different C++ compiler with $ ../glibc-VERSION/configure TEST_CC="gcc-6.4.1" TEST_CXX="g++-6.4.1" 1. Add LIBC_TRY_CC_AND_TEST_CC_OPTION, LIBC_TRY_CC_AND_TEST_CC_COMMAND and LIBC_TRY_CC_AND_TEST_LINK to test both CC and TEST_CC. 2. Add check and xcheck targets to Makefile.in and override build compiler options with ones from TEST_CC and TEST_CXX. Tested on Fedora 41/x86-64: 1. Building with GCC 14.2.1 and testing with GCC 6.4.1 and GCC 11.2.1. 2. Building with GCC 15 and testing with GCC 6.4.1. Support for GCC versions older than GCC 6.2 may need to change the test sources. Other targets may need to update configure.ac under sysdeps and modify Makefile.in to override target build compiler options. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-10powerpc64le: ROP changes for the dl-trampoline functionsPeter Bergner1-9/+31
Add ROP protection for the _dl_runtime_resolve and _dl_profile_resolve functions.
2024-12-11malloc: Add tcache path for callocWangyang Guo2-38/+132
This commit add tcache support in calloc() which can largely improve the performance of small size allocation, especially in multi-thread scenario. tcache_available() and tcache_try_malloc() are split out as a helper function for better reusing the code. Also fix tst-safe-linking failure after enabling tcache. In previous, calloc() is used as a way to by-pass tcache in memory allocation and trigger safe-linking check in fastbins path. With tcache enabled, it needs extra workarounds to bypass tcache. Result of bench-calloc-thread benchmark Test Platform: Xeon-8380 Ratio: New / Original time_per_iteration (Lower is Better) Threads# | Ratio -----------|------ 1 thread | 0.656 4 threads | 0.470 Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-10Implement C23 asinpiJoseph Myers51-2/+2921
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the asinpi functions (asin(x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-10malloc: add indirection for malloc(-like) functions in tests [BZ #32366]Sam James9-2/+53
GCC 15 introduces allocation dead code removal (DCE) for PR117370 in r15-5255-g7828dc070510f8. This breaks various glibc tests which want to assert various properties of the allocator without doing anything obviously useful with the allocated memory. Alexander Monakov rightly pointed out that we can and should do better than passing -fno-malloc-dce to paper over the problem. Not least because GCC 14 already does such DCE where there's no testing of malloc's return value against NULL, and LLVM has such optimisations too. Handle this by providing malloc (and friends) wrappers with a volatile function pointer to obscure that we're calling malloc (et. al) from the compiler. Reviewed-by: Paul Eggert <eggert@cs.ucla.edu>
2024-12-09Implement C23 acospiJoseph Myers51-2/+3632
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the acospi functions (acos(x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-09powerpc64le: ROP changes for the *context and setjmp functionsSachin Monga5-12/+60
Add ROP protection for the getcontext, setcontext, makecontext, swapcontext and __sigsetjmp_symbol functions. Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
2024-12-09nptl: Add <thread_pointer.h> for m68kMichael Jeanson1-0/+30
This will be required by the rseq extensible ABI implementation on all Linux architectures exposing the '__rseq_size' and '__rseq_offset' symbols to set the initial value of the 'cpu_id' field which can be used by applications to test if rseq is available and registered. As long as the symbols are exposed it is valid for an application to perform this test even if rseq is not yet implemented in libc for this architecture. Compile tested with build-many-glibcs.py but I don't have access to any hardware to run the tests. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Arjun Shankar <arjun@redhat.com>
2024-12-09nptl: Add <thread_pointer.h> for RISC-VMichael Jeanson1-0/+40
This will be required by the rseq extensible ABI implementation on all Linux architectures exposing the '__rseq_size' and '__rseq_offset' symbols to set the initial value of the 'cpu_id' field which can be used by applications to test if rseq is available and registered. As long as the symbols are exposed it is valid for an application to perform this test even if rseq is not yet implemented in libc for this architecture. Both code paths tested on a Visionfive 2 with Debian sid. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-12-09nptl: add RSEQ_SIG for RISC-VMichael Jeanson1-0/+44
Enable RSEQ for RISC-V, support was added in Linux 5.18. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-12-09AArch64: Improve codegen in users of ADVSIMD expm1 helperPierre Blanchard5-162/+135
Add inline helper for expm1 and rearrange operations so MOV is not necessary in reduction or around the special-case handler. Reduce memory access by using more indexed MLAs in polynomial. Speedup on Neoverse V1 for expm1 (19%), sinh (8.5%), and tanh (7.5%).
2024-12-09AArch64: Improve codegen in users of ADVSIMD log1p helperPierre Blanchard4-127/+93
Add inline helper for log1p and rearrange operations so MOV is not necessary in reduction or around the special-case handler. Reduce memory access by using more indexed MLAs in polynomial. Speedup on Neoverse V1 for log1p (3.5%), acosh (7.5%) and atanh (10%).
2024-12-09AArch64: Improve codegen in AdvSIMD logsPierre Blanchard3-106/+140
Remove spurious ADRP and a few MOVs. Reduce memory access by using more indexed MLAs in polynomial. Align notation so that algorithms are easier to compare. Speedup on Neoverse V1 for log10 (8%), log (8.5%), and log2 (10%). Update error threshold in AdvSIMD log (now matches SVE log).
2024-12-09AArch64: Improve codegen in AdvSIMD powPierre Blanchard1-53/+62
Remove spurious ADRP. Improve memory access by shuffling constants and using more indexed MLAs. A few more optimisation with no impact on accuracy - force fmas contraction - switch from shift-aided rint to rint instruction Between 1 and 5% throughput improvement on Neoverse V1 depending on benchmark.
2024-12-09s390x: Regenerated ULPs.Stefan Liebler1-0/+60
Needed after: "Implement C23 cospi" commit 0ae0af68d8fa3bf6cbe1e4f1de5929ff71de67b3 and "Implement C23 sinpi" commit 776938e8b8dcf2b59998979e91cc0f9db7d771a8 and "Implement C23 tanpi"
2024-12-09htl: move pthread_condattr_setpshared into libc.gfleury7-6/+14
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-8-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_setclock into libc.gfleury7-6/+16
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-7-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_init into libc.gfleury10-11/+12
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-6-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_getpshared into libc.gfleury7-5/+15
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-5-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_getclock into libc.gfleury7-6/+14
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-4-gfleury@disroot.org>
2024-12-09htl: move __pthread_default_condattr into libc.gfleury4-1/+4
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-3-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_destroy into libc.gfleury9-9/+9
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-2-gfleury@disroot.org>
2024-12-08math: Add sinpi,cospi,tanpi sparc64 ulpsAndreas K. Hüttel1-0/+61
Linux catbus 6.1.112 #1 SMP Sun Oct 13 10:52:08 PDT 2024 sparc64 sun4v UltraSparc T5 (Niagara5) GNU/Linux gcc (Gentoo 13.3.1_p20240614 p17) 13.3.1 20240614 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-12-08math: Add tanpi aarch64 ulpsAndreas K. Hüttel1-0/+20
Linux dola 5.15.169-gentoo-dist #1 SMP Wed Oct 23 06:25:30 -00 2024 aarch64 GNU/Linux Vendor ID: ARM Model name: Neoverse-N1 gcc (Gentoo Hardened 13.3.1_p20241025 p1) 13.3.1 20241024 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-12-07math: Exclude internal math symbols for tests [BZ #32414]H.J. Lu2-1/+6
Since internal tests don't have access to internal symbols in libm, exclude them for internal tests. Also make tst-strtod5 and tst-strtod5i depend on $(libm) to support older versions of GCC which can't inline copysign family functions. This fixes BZ #32414. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
2024-12-06Remove AC_SUBST(libc_cv_mtls_descriptor)H.J. Lu2-3/+0
Remove AC_SUBST(libc_cv_mtls_descriptor) since there is no @libc_cv_mtls_descriptor@ and there is LIBC_CONFIG_VAR([have-mtls-descriptor], [$libc_cv_mtls_descriptor]) Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-05Implement C23 tanpiJoseph Myers51-2/+9618
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the tanpi functions (tan(pi*x)). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-05Fix typo in elf/Makefile:postclean-generatedJoseph Myers1-1/+1
The postclean-generated setting in elf/Makefile lists $(objpfx)/dso-sort-tests-2.generated-makefile twice and $(objpfx)/dso-sort-tests-1.generated-makefile not at all, which looks like a typo; fix it to list each once. Tested for x86_64.
2024-12-05math: xfail some sinpi tests for ibm128-libgccAdhemerval Zanella2-254/+254
On powerpc math/test-ibm128-sinpi shows: testing long double (without inline functions) Failure: sinpi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): Exception "Invalid operation" set Failure: sinpi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): Exception "Overflow" set Failure: sinpi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): errno set to 33, expected 0 (unchanged) Failure: Test: sinpi_downward (-0xf.ffffffffffffbffffffffffffcp+1020) Result: is: qNaN should be: -0.00000000000000000000000000000000e+00 -0x0.000000000000000000000000000p+0 Failure: Test: sinpi_downward (0x3.fffffffffffffffcp+108) Result: is: 2.97479253223185882765417834495004e-15 0x1.acb679186c7b49a36c9ec63e110p-49 should be: 0.00000000000000000000000000000000e+00 0x0.000000000000000000000000000p+0 difference: 2.97479253223185882765417834495004e-15 0x1.acb679186c7b49a36c9ec63e110p-49 ulp : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321 max.ulp : 4.0000 Failure: Test: sinpi_downward (0x3.ffffffffffffffffffffffffffp+108) Result: is: 2.63250110604328276654475674742669e-15 0x1.7b6225fa8503a5a8c514f5c0208p-49 should be: 0.00000000000000000000000000000000e+00 0x0.000000000000000000000000000p+0 difference: 2.63250110604328276654475674742669e-15 0x1.7b6225fa8503a5a8c514f5c0208p-49 ulp : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321 max.ulp : 4.0000 Failure: Test: sinpi_towardzero (-0x3.fffffffffffffffcp+108) Result: is: -1.71856472474338625450766636956702e-14 -0x1.3596cf230d8f69346d93d8c3100p-46 should be: -0.00000000000000000000000000000000e+00 -0x0.000000000000000000000000000p+0 difference: 1.71856472474338625450766636956702e-14 0x1.3596cf230d8f69346d93d8c3100p-46 ulp : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321 max.ulp : 3.0000 Failure: Test: sinpi_towardzero (-0x3.ffffffffffffffffffffffffffp+108) Result: is: -9.73792846364428462525599942305655e-15 -0x1.5ed8897ea140e96a31453d6e580p-47 should be: -0.00000000000000000000000000000000e+00 -0x0.000000000000000000000000000p+0 difference: 9.73792846364428462525599942305655e-15 0x1.5ed8897ea140e96a31453d6e580p-47 ulp : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321 max.ulp : 3.0000 Failure: Test: sinpi_towardzero (0x3.fffffffffffffffcp+108) Result: is: 1.71856472474338625450766636956702e-14 0x1.3596cf230d8f69346d93d8c3100p-46 should be: 0.00000000000000000000000000000000e+00 0x0.000000000000000000000000000p+0 difference: 1.71856472474338625450766636956702e-14 0x1.3596cf230d8f69346d93d8c3100p-46 ulp : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321 max.ulp : 3.0000 Failure: Test: sinpi_towardzero (0x3.ffffffffffffffffffffffffffp+108) Result: is: 9.73792846364428462525599942305655e-15 0x1.5ed8897ea140e96a31453d6e580p-47 should be: 0.00000000000000000000000000000000e+00 0x0.000000000000000000000000000p+0 difference: 9.73792846364428462525599942305655e-15 0x1.5ed8897ea140e96a31453d6e580p-47 ulp : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321 max.ulp : 3.0000 Failure: Test: sinpi_upward (-0x3.fffffffffffffffcp+108) Result: is: -1.71856472474338625450766636956709e-14 -0x1.3596cf230d8f69346d93d8c3110p-46 should be: -0.00000000000000000000000000000000e+00 -0x0.000000000000000000000000000p+0 difference: 1.71856472474338625450766636956710e-14 0x1.3596cf230d8f69346d93d8c3110p-46 ulp : inf max.ulp : 4.0000 Failure: Test: sinpi_upward (-0x3.ffffffffffffffffffffffffffp+108) Result: is: -9.73792846364428462525599942305708e-15 -0x1.5ed8897ea140e96a31453d6e598p-47 should be: -0.00000000000000000000000000000000e+00 -0x0.000000000000000000000000000p+0 difference: 9.73792846364428462525599942305709e-15 0x1.5ed8897ea140e96a31453d6e598p-47 ulp : inf max.ulp : 4.0000 Failure: sinpi_upward (0xf.ffffffffffffbffffffffffffcp+1020): Exception "Invalid operation" set Failure: sinpi_upward (0xf.ffffffffffffbffffffffffffcp+1020): Exception "Overflow" set Failure: sinpi_upward (0xf.ffffffffffffbffffffffffffcp+1020): errno set to 33, expected 0 (unchanged) Failure: Test: sinpi_upward (0xf.ffffffffffffbffffffffffffcp+1020) Result: is: qNaN should be: 0.00000000000000000000000000000000e+00 0x0.000000000000000000000000000p+0
2024-12-05math: xfail some cospi tests for ibm128-libgccAdhemerval Zanella2-402/+402
On powerpc math/test-ibm128-cospi shows: testing long double (without inline functions) Failure: cospi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): Exception "Invalid operation" set Failure: cospi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): Exception "Overflow" set Failure: cospi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): errno set to 33, expected 0 (unchanged) Failure: Test: cospi_downward (-0xf.ffffffffffffbffffffffffffcp+1020) Result: is: qNaN should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 Failure: Test: cospi_downward (0x3.fffffffffffffffcp+108) Result: is: 9.99999999999999999999999999995574e-01 0x1.ffffffffffffffffffffffff4c8p-1 should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 difference: 4.42501664022411309598141492088312e-30 0x1.670000000000000000000000000p-98 ulp : 179.5000 max.ulp : 4.0000 Failure: Test: cospi_downward (0x3.ffffffffffffffffffffffffffp+108) Result: is: 9.99999999999999999999999999996524e-01 0x1.ffffffffffffffffffffffff730p-1 should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 difference: 3.47591836363008326759542899077727e-30 0x1.1a0000000000000000000000000p-98 ulp : 141.0000 max.ulp : 4.0000 Failure: Test: cospi_towardzero (-0x3.fffffffffffffffcp+108) Result: is: 9.99999999999999999999999999852310e-01 0x1.ffffffffffffffffffffffe8990p-1 should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 difference: 1.47689552599346303944427057331536e-28 0x1.767000000000000000000000000p-93 ulp : 5991.0000 max.ulp : 4.0000 Failure: Test: cospi_towardzero (-0x3.ffffffffffffffffffffffffffp+108) Result: is: 9.99999999999999999999999999952569e-01 0x1.fffffffffffffffffffffff87c0p-1 should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 difference: 4.74302619264133348003801799876275e-29 0x1.e10000000000000000000000000p-95 ulp : 1924.0000 max.ulp : 4.0000 Failure: Test: cospi_towardzero (0x3.fffffffffffffffcp+108) Result: is: 9.99999999999999999999999999852310e-01 0x1.ffffffffffffffffffffffe8990p-1 should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 difference: 1.47689552599346303944427057331536e-28 0x1.767000000000000000000000000p-93 ulp : 5991.0000 max.ulp : 4.0000 Failure: Test: cospi_towardzero (0x3.ffffffffffffffffffffffffffp+108) Result: is: 9.99999999999999999999999999952569e-01 0x1.fffffffffffffffffffffff87c0p-1 should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 difference: 4.74302619264133348003801799876275e-29 0x1.e10000000000000000000000000p-95 ulp : 1924.0000 max.ulp : 4.0000 Failure: Test: cospi_upward (-0x3.fffffffffffffffcp+108) Result: is: 9.99999999999999999999999999852323e-01 0x1.ffffffffffffffffffffffe899bp-1 should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 difference: 1.47673235656615530277812119019587e-28 0x1.766568e20369c00000000000000p-93 ulp : 5990.3382 max.ulp : 4.0000 Failure: Test: cospi_upward (-0x3.ffffffffffffffffffffffffffp+108) Result: is: 9.99999999999999999999999999952583e-01 0x1.fffffffffffffffffffffff87cbp-1 should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0 difference: 4.74136253815267677203679334037676e-29 0x1.e0d4cf1e9076600000000000000p-95 ulp : 1923.3252 max.ulp : 4.0000 Failure: cospi_upward (0xf.ffffffffffffbffffffffffffcp+1020): Exception "Invalid operation" set Failure: cospi_upward (0xf.ffffffffffffbffffffffffffcp+1020): Exception "Overflow" set Failure: cospi_upward (0xf.ffffffffffffbffffffffffffcp+1020): errno set to 33, expected 0 (unchanged) Failure: Test: cospi_upward (0xf.ffffffffffffbffffffffffffcp+1020) Result: is: qNaN should be: 1.00000000000000000000000000000000e+00 0x1.000000000000000000000000000p+0
2024-12-05powerpc: Update ulpsAdhemerval Zanella1-0/+48
From 'Implement C23 cospi' (0ae0af68d8fa3bf6cbe1e4f1de5929ff71de67b3) and 'Implement C23 sinpi' (776938e8b8dcf2b59998979e91cc0f9db7d771a8).
2024-12-05AArch64: Update libm-test-ulpsWilco Dijkstra1-0/+40
Add sinpi/cospi.
2024-12-05i686: Update libm-test-ulpsH.J. Lu1-4/+4
Update i686 libm-test-ulps to fix FAIL: math/test-float64x-cospi FAIL: math/test-float64x-sinpi FAIL: math/test-ldouble-cospi FAIL: math/test-ldouble-sinpi when building glibc with GCC 7.4. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-05x86-64: Update libm-test-ulpsH.J. Lu1-5/+5
Update x86-64 libm-test-ulps to fix FAIL: math/test-float64x-cospi FAIL: math/test-float64x-exp2m1 FAIL: math/test-float64x-sinpi FAIL: math/test-ldouble-cospi FAIL: math/test-ldouble-exp2m1 FAIL: math/test-ldouble-sinpi when building glibc with GCC 7.4. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-05Use M_LIT in place of M_MLIT for literalsJoseph Myers2-2/+2
This should fix the reported issue building cospi and sinpi with GCC 6. Tested for x86_64 (not with GCC 6).
2024-12-05Add further test of TLSJoseph Myers11-0/+381
Add an additional test of TLS variables, with different alignment, accessed from different modules. The idea of the alignment test is similar to tst-tlsalign and the same code is shared for setting up test variables, but unlike the tst-tlsalign code, there are multiple threads and variables are accessed from multiple objects to verify that they get a consistent notion of the address of an object within a thread. Threads are repeatedly created and shut down to verify proper initialization in each new thread. The test is also repeated with TLS descriptors when supported. (However, only initial-exec TLS is covered in this test.) Tested for x86_64.
2024-12-05hurd: Protect against servers returning bogus read/write lengthsSergey Bugaev2-8/+14
There already was a branch checking for this case in _hurd_fd_read () when the data is returned out-of-line. Do the same for inline data, as well as for _hurd_fd_write (). It's also not possible for the length to be negative, since it's stored in an unsigned integer. Not verifying the returned length can confuse the callers who assume the returned length is always reasonable. This manifested as libzstd test suite failing on writes to /dev/zero, even though the write () call appeared to succeed. In fact, the zero store backing /dev/zero was returning a larger written length than the size actually submitted to it, which is a separate bug to be fixed on the Hurd side. With this patch, EGRATUITOUS is now propagated to the caller. Reported-by: Diego Nieto Cid <dnietoc@gmail.com> Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-ID: <20241204112915.540032-1-bugaevc@gmail.com>
2024-12-05Fix and sort variables in MakefilesH.J. Lu6-65/+65
Fix variables in Makefiles: 1. There is a tab, not a space, between "variable" and =, +=, :=. 2. The last entry doesn't have a trailing \. and sort them. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-04Implement C23 sinpiJoseph Myers51-2/+10429
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the sinpi functions (sin(pi*x)). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-04Implement C23 cospiJoseph Myers51-1/+9778
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the cospi functions (cos(pi*x)). Tested for x86_64 and x86, and with build-many-glibcs.py.