about summary refs log tree commit diff
path: root/sysdeps/s390/fpu
Commit message (Collapse)AuthorAgeFilesLines
* s390x: Regenerate ULPs.Stefan Liebler2024-06-191-0/+60
| | | | | | | | Needed due to: - "Implement C23 log10p1" commit ID 55eb99e9a9d840ba452b128be14d6529c2dde039 - "Implement C23 exp2m1, exp10m1" commit ID 7ec903e028271d029818378fd60ddaf6b76b89ac
* Implement C23 logp1Joseph Myers2024-06-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | C23 adds various <math.h> function families originally defined in TS 18661-4. Add the logp1 functions (aliases for log1p functions - the name is intended to be more consistent with the new log2p1 and log10p1, where clearly it would have been very confusing to name those functions log21p and log101p). As aliases rather than new functions, the content of this patch is somewhat different from those actually adding new functions. Tests are shared with log1p, so this patch *does* mechanically update all affected libm-test-ulps files to expect the same errors for both functions. The vector versions of log1p on aarch64 and x86_64 are *not* updated to have logp1 aliases (and thus there are no corresponding header, tests, abilist or ulps changes for vector functions either). It would be reasonable for such vector aliases and corresponding changes to other files to be made separately. For now, the log1p tests instead avoid testing logp1 in the vector case (a Makefile change is needed to avoid problems with grep, used in generating the .c files for vector function tests, matching more than one ALL_RM_TEST line in a file testing multiple functions with the same inputs, when it assumes that the .inc file only has a single such line). Tested for x86_64 and x86, and with build-many-glibcs.py.
* s390x: Regenerate ULPs.Stefan Liebler2024-05-241-0/+20
| | | | | | Needed due to: "Implement C23 log2p1" commit ID 79c52daf4740b00bef43e4f5a4281b3480459b38
* Refer to C23 in place of C2X in glibcJoseph Myers2024-02-011-1/+1
| | | | | | | | | | | | | | | WG14 decided to use the name C23 as the informal name of the next revision of the C standard (notwithstanding the publication date in 2024). Update references to C2X in glibc to use the C23 name. This is intended to update everything *except* where it involves renaming files (the changes involving renaming tests are intended to be done separately). In the case of the _ISOC2X_SOURCE feature test macro - the only user-visible interface involved - support for that macro is kept for backwards compatibility, while adding _ISOC23_SOURCE. Tested for x86_64.
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-0141-41/+41
|
* s390: Fix undefined behaviour in feenableexcept, fedisableexcept [BZ #30960]Stefan Liebler2023-10-192-2/+4
| | | | | | | | | | | | | | | | | If feenableexcept or fedisableexcept gets excepts=FE_INVALID=0x80 as input, we have a signed left shift: 0x80 << 24 which is not representable as int and thus is undefined behaviour according to C standard. This patch casts excepts as unsigned int before shifting, which is defined. For me, the observed undefined behaviour is that the shift is done with "unsigned"-instructions, which is exactly what we want. Furthermore, I don't get any exception-flags. After the fix, the code is using the same instruction sequence as before.
* S390: Fix _FPU_SETCW/GETCW when compiling with Clang [BZ #30130]Andreas Arnez2023-02-281-2/+2
| | | | | | | | The _FPU_SETCW and _FPU_GETCW macros are defined with inline assemblies. They use the sfpc and efpc instructions, respectively. But both contain a spurious second operand that leads to a compile error with Clang. Removing this operand works both with gcc/gas (since binutils 2.18) as well as with clang/llvm.
* s390x: Regenerate ULPs.Stefan Liebler2023-02-281-0/+1
| | | | | | | | | Needed due to recent commits: - "added pair of inputs for hypotf in binary32" commit ID cf7ffdd8a5f6da55397e10b3860062944312824c - "update auto-libm-test-out-hypot" commit ID 3efbf11fdf15ed991d2c41743921c524a867e145
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-0641-41/+41
|
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-0141-41/+41
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* S390: update libm test ulpsStefan Liebler2021-10-061-1/+1
| | | | | | | | | | | Update after commit 6bbf7298323bf31bc43494b2201465a449778e10. Fixed inaccuracy of j0f (BZ #28185) See also e.g. commit c75b106145c30e6c7bcf87f384a5c68ce56406e9 aarch64: update libm test ulps
* Remove "Contributed by" linesSiddhesh Poyarekar2021-09-0317-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | We stopped adding "Contributed by" or similar lines in sources in 2012 in favour of git logs and keeping the Contributors section of the glibc manual up to date. Removing these lines makes the license header a bit more consistent across files and also removes the possibility of error in attribution when license blocks or files are copied across since the contributed-by lines don't actually reflect reality in those cases. Move all "Contributed by" and similar lines (Written by, Test by, etc.) into a new file CONTRIBUTED-BY to retain record of these contributions. These contributors are also mentioned in manual/contrib.texi, so we just maintain this additional record as a courtesy to the earlier developers. The following scripts were used to filter a list of files to edit in place and to clean up the CONTRIBUTED-BY file respectively. These were not added to the glibc sources because they're not expected to be of any use in future given that this is a one time task: https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* s390x: Update math: redirect roundeven functionStefan Liebler2021-06-293-1/+3
| | | | | | | | | | | | | After recent commit 447954a206837b5f153869cfeeeab44631c3fac9 "math: redirect roundeven function", building on s390x fails with: Error: symbol `__roundevenl' is already defined Similar to aarch64/riscv fix, this patch redirects target specific functions for s390x: commit 3213ed770cbc5821920d16caa93c85e92dd7b9f6 "Update math: redirect roundeven function"
* s390: Update ulpsStefan Liebler2021-04-151-3/+3
| | | | | Required after 9acda61d94acc "Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]".
* s390: Update ulpsAdhemerval Zanella2021-04-131-1/+1
| | | | | Required after 43576de04afc6 "Improve the accuracy of tgamma (BZ #26983)"
* Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]Paul Zimmermann2021-04-021-34/+34
| | | | | | | | | | | | | | | | | | | | | | | 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>
* S390: Allow "v" constraint for long double math_opt_barrier and ↵Stefan Liebler2021-04-011-2/+19
| | | | | | | | | | | 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
* s390x: Regenerate ULPs.Stefan Liebler2021-03-121-1/+3
| | | | | | | Updates needed after recent commit: db3f7bb5586392d9809fc6397c7184983aed6008 "math: Remove slow paths from asin and acos [BZ #15267]" Compre to the required ulps update for x86_64.
* s390x: Regenerate ulpsArjun Shankar2021-03-031-15/+17
| | | | For new test cases in commit 5a051454a9b5.
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-0241-41/+41
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* s390x: Regenerate ulpsFlorian Weimer2020-12-221-10/+12
| | | | | For new inputs added in commit cad5ad81d2f7f58a7ad0d8afa8c1b710, as seen on a z13 system.
* S390: Regenerate ULPs.Stefan Liebler2020-08-121-1/+1
| | | | | | Updates needed after new j0 test: commit 9bfc225078219521439ec8b0f665915e769d40c2 math: Regenerate auto-libm-test-out-j0
* S390: Regenerate ULPs.Stefan Liebler2020-06-241-0/+2
| | | | Updates needed after recent exp10f commits.
* s390: Use sqrt{f} builtinAdhemerval Zanella2020-06-223-60/+4
| | | | Checked on s390x-linux-gnu.
* s390x: Use fma{f} builtinAdhemerval Zanella2020-06-223-64/+4
| | | | Checked on s390x-linux-gnu.
* math: Decompose math-use-builtins.hAdhemerval Zanella2020-06-227-119/+90
| | | | | | | | | | | Each symbol definitions are moved on a separated file and it cover all symbol type definitions (float, double, long double, and float128). It allows to set support for architectures without the boiler place of copying default values. Checked with a build on the affected ABIs.
* ieee754: provide gcc builtins based generic fma functionsVineet Gupta2020-06-031-0/+5
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* ieee754: provide gcc builtins based generic sqrt functionsVineet Gupta2020-06-031-0/+3
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* S390: Regenerate ULPs.Stefan Liebler2020-04-031-15/+19
| | | | | | Updates needed after recent commit a9d42c09a327540a99f2eac25a98fd2ad6d0b540 math: Add inputs that yield larger errors for float type (x86_64)
* math: Remove inline math testsAdhemerval Zanella2020-03-191-817/+0
| | | | | | | | | | | | | With mathinline removal there is no need to keep building and testing inline math tests. The gen-libm-tests.py support to generate ULP_I_* is removed and all libm-test-ulps files are updated to longer have the i{float,double,ldouble} entries. The support for no-test-inline is also removed from both gen-auto-libm-tests and the auto-libm-test-out-* were regenerated. Checked on x86_64-linux-gnu and i686-linux-gnu.
* S390: Fix non-ascii character in fenv.h.Stefan Liebler2020-02-121-2/+2
| | | | | | | | | | | | | | | | | The comment "isn't" contained a non-ascii character which leads to an error if compiled with -finput-charset=ascii: error: failure to convert ascii to UTF-8 This is observable in GCC testsuite: FAIL: 17_intro/headers/c++1998/charset.cc (test for excess errors) FAIL: 17_intro/headers/c++2011/charset.cc (test for excess errors) FAIL: 17_intro/headers/c++2014/charset.cc (test for excess errors) FAIL: 17_intro/headers/c++2017/charset.cc (test for excess errors) FAIL: 17_intro/headers/c++2020/charset.cc (test for excess errors) Also rewrite the comment above. Reported-by: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* Add libm_alias_finite for _finite symbolsWilco Dijkstra2020-01-033-3/+6
| | | | | | | | | | | | | | | | | | | This patch adds a new macro, libm_alias_finite, to define all _finite symbol. It sets all _finite symbol as compat symbol based on its first version (obtained from the definition at built generated first-versions.h). The <fn>f128_finite symbols were introduced in GLIBC 2.26 and so need special treatment in code that is shared between long double and float128. It is done by adding a list, similar to internal symbol redifinition, on sysdeps/ieee754/float128/float128_private.h. Alpha also needs some tricky changes to ensure we still emit 2 compat symbols for sqrt(f). Passes buildmanyglibc. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-0146-46/+46
|
* S390: Implement roundtoint and converttoint and define TOINT_INTRINSICS.Stefan Liebler2019-12-111-0/+53
| | | | | | | This patch implements roundtoint and convertoint for s390 by using the load-fp-integer and convert-to-fixed instructions. Both functions are using "round to nearest with ties away from zero" rounding mode and do not raise inexact exceptions.
* S390: Implement math-barriers math_opt_barrier and math_force_eval.Stefan Liebler2019-12-111-0/+46
| | | | | This patch implements the s390 specific math barriers in order to omit the store and load from stack if possible.
* S390: Use libc_fe* macros in fe* functions.Stefan Liebler2019-12-119-124/+27
| | | | | | | | | | | This patch updates the s390 specific functions fegetround, fesetround, feholdexcept, fesetenv, feupdateenv, fegetexceptflag, fetestexcept, fesetexceptflag, fetestexceptflag. Now those functions are using the libc_fe* macros if possible. Furthermore fegetexceptflag is now returning the exception from dxc field shifted to the usual exception-flags. Thus a special fetestexceptflag implementation is not needed anymore.
* S390: Implement libc_fe* macros.Stefan Liebler2019-12-111-0/+250
| | | | | | | | This patch provides the s390 specific implementation for libc_feholdexcept, libc_fesetround, libc_feholdexcept_setround, libc_fetestexcept, libc_fesetenv, libc_feupdateenv_test, libc_feupdateenv, libc_feholdsetround_ctx, libc_feresetround_ctx, libc_feholdsetround_noex_ctx and libc_feresetround_noex_ctx.
* S390: Use convert-to-fixed instruction for llround functions.Stefan Liebler2019-12-113-0/+127
| | | | | | If compiled with z196 zarch support, the convert-to-fixed instruction is used to implement llround, llroundf, llroundl. Otherwise the common-code implementation is used.
* S390: Use convert-to-fixed instruction for lround functions.Stefan Liebler2019-12-113-0/+142
| | | | | | If compiled with z196 zarch support, the convert-to-fixed instruction is used to implement lround, lroundf, lroundl. Otherwise the common-code implementation is used.
* S390: Use convert-to-fixed instruction for llrint functions.Stefan Liebler2019-12-113-0/+151
| | | | | | If compiled with z196 zarch support, the convert-to-fixed instruction is used to implement llrint, llrintf, llrintl. Otherwise the common-code implementation is used.
* S390: Use convert-to-fixed instruction for lrint functions.Stefan Liebler2019-12-113-0/+166
| | | | | | If compiled with z196 zarch support, the convert-to-fixed instruction is used to implement lrint, lrintf, lrintl. Otherwise the common-code implementation is used.
* S390: Use load-fp-integer instruction for roundeven functions.Stefan Liebler2019-12-113-0/+116
| | | | | | If compiled with z196 zarch support, the load-fp-integer instruction is used to implement roundeven, roundevenf, roundevenl. Otherwise the common-code implementation is used.
* Use GCC builtins for copysign functions if desired.Stefan Liebler2019-12-111-0/+7
| | | | | | | | | | | | This patch is always using the corresponding GCC builtin for copysignf, copysign, and is using the builtin for copysignl, copysignf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. Altough the long double version is enabled by default we still need the macro and the alternative implementation as the _Float128 version of the builtin is not available with all supported GCC versions. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use GCC builtins for round functions if desired.Stefan Liebler2019-12-111-0/+11
| | | | | | | | | | | | This patch is using the corresponding GCC builtin for roundf, round, roundl and roundf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use GCC builtins for trunc functions if desired.Stefan Liebler2019-12-111-0/+11
| | | | | | | | | | | | This patch is using the corresponding GCC builtin for truncf, trunc, truncl and truncf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use GCC builtins for ceil functions if desired.Stefan Liebler2019-12-111-0/+11
| | | | | | | | | | | | This patch is using the corresponding GCC builtin for ceilf, ceil, ceill and ceilf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use GCC builtins for floor functions if desired.Stefan Liebler2019-12-111-0/+11
| | | | | | | | | | | | This patch is using the corresponding GCC builtin for floorf, floor, floorl and floorf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use GCC builtins for rint functions if desired.Stefan Liebler2019-12-111-0/+11
| | | | | | | | | | | | This patch is using the corresponding GCC builtin for rintf, rint, rintl and rintf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use GCC builtins for nearbyint functions if desired.Stefan Liebler2019-12-111-0/+49
| | | | | | | | | | | | This patch is using the corresponding GCC builtin for nearbyintf, nearbyint, nearbintl and nearbyintf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* S390: Fp comparison are now raising FE_INVALID with gcc 10.Stefan Liebler2019-11-061-5/+7
| | | | | | | The s390 gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77918 "S390: Floating point comparisons don't raise invalid for unordered operands." is fixed with gcc 10. Thus we conditionally set FIX_COMPARE_INVALID to 0 or 1.