]> git.ipfire.org Git - people/ms/gcc.git/commit
libstdc++: Small extended float support tweaks
authorJakub Jelinek <jakub@redhat.com>
Mon, 31 Oct 2022 15:47:23 +0000 (16:47 +0100)
committerJakub Jelinek <jakub@redhat.com>
Mon, 31 Oct 2022 15:49:04 +0000 (16:49 +0100)
commitcbf56503d5e2bbafb06a507cb37d30805a1013a0
tree3d61e1c42c25c298261165a927f04cf713fe3191
parent1b07d374765dd811cbb8b3e05764aef3b1754ff2
libstdc++: Small extended float support tweaks

The following patch
1) enables the std::float128_t overloads for x86 with glibc 2.26+
2) makes std::nextafter(std::float16_t, std::float16_t) and
   std::nextafter(std::bfloat16_t, std::bfloat16_t) constexpr
3) adds (small) testsuite coverage for that

2022-10-21  Jakub Jelinek  <jakub@redhat.com>

* config/os/gnu-linux/os_defines.h (_GLIBCXX_HAVE_FLOAT128_MATH):
Uncomment.
* include/c_global/cmath (nextafter(_Float16, _Float16)): Make it constexpr.
If std::__is_constant_evaluated() call __builtin_nextafterf16.
(nextafter(__gnu_cxx::__bfloat16_t, __gnu_cxx::__bfloat16_t)): Similarly
but call __builtin_nextafterf16b.
* testsuite/26_numerics/headers/cmath/nextafter_c++23.cc (test): Add
static assertions to test constexpr nextafter.
libstdc++-v3/config/os/gnu-linux/os_defines.h
libstdc++-v3/include/c_global/cmath
libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc