gcc/libstdc++-v3/include
Jakub Jelinek a23225fb4f libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t
The following patch is partial support for std::float{16,32,64,128}_t
and std::bfloat16_t in libstdc++.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html
says that <ostream>, <istream>, <charconv> and <complex>
need changes toom, but that isn't implemented so far.
In <cmath> the only thing missing I'm aware of is
std::nextafter std::float16_t and std::bfloat16_t overloads (I think
we probably need to implement that out of line somewhere, or inline? - might
need inline asm barriers) and std::nexttoward overloads (those are
intentional, you said there is a LWG issue about that).
Also, this patch has the glibc 2.26+ std::float128_t support for platforms
where long double isn't IEEE quad format temporarily disabled
because it depends on
https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603665.html
changes which aren't in yet.

The patch also doesn't include any testcases to cover the <type_traits>
changes, it isn't clear to me where to put that.

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

	PR c++/106652
	* include/std/stdfloat: New file.
	* include/std/numbers (__glibcxx_numbers): Define and use it
	for __float128 explicit instantiations as well as
	_Float{16,32,64,128} and __gnu_cxx::__bfloat16_t.
	* include/std/atomic (atomic<_Float16>, atomic<_Float32>,
	atomic<_Float64>, atomic<_Float128>, atomic<__gnu_cxx::__bfloat16_t>):
	New explicit instantiations.
	* include/std/type_traits (__is_floating_point_helper<_Float16>,
	__is_floating_point_helper<_Float32>,
	__is_floating_point_helper<_Float64>,
	__is_floating_point_helper<_Float128>,
	__is_floating_point_helper<__gnu_cxx::__bfloat16_t>): Likewise.
	* include/std/limits (__glibcxx_concat3_, __glibcxx_concat3,
	__glibcxx_float_n): Define.
	(numeric_limits<_Float16>, numeric_limits<_Float32>,
	numeric_limits<_Float64>, numeric_limits<_Float128>,
	numeric_limits<__gnu_cxx::__bfloat16_t>): New explicit instantiations.
	* include/bits/std_abs.h (abs): New overloads for
	_Float{16,32,64,128} and __gnu_cxx::__bfloat16_t.
	* include/bits/c++config (_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128): Define
	if long double is IEEE quad.
	(__gnu_cxx::__bfloat16_t): New using.
	* include/c_global/cmath (acos, asin, atan, atan2, ceil, cos, cosh,
	exp, fabs, floor, fmod, frexp, ldexp, log, log10, modf, pow, sin,
	sinh, sqrt, tan, tanh, fpclassify, isfinite, isinf, isnan, isnormal,
	signbit, isgreater, isgreaterequal, isless, islessequal,
	islessgreater, isunordered, acosh, asinh, atanh, cbrt, copysign, erf,
	erfc, exp2, expm1, fdim, fma, fmax, fmin, hypot, ilogb, lgamma,
	llrint, llround, log1p, log2, logb, lrint, lround, nearbyint,
	nextafter, remainder, rint, round, scalbln, scalbn, tgamma, trunc,
	lerp): New overloads with _Float{16,32,64,128} or
	__gnu_cxx::__bfloat16_t types.
	* config/os/gnu-linux/os_defines.h (_GLIBCXX_HAVE_FLOAT128_MATH):
	Prepare for definition if glibc 2.26 and later implements *f128 APIs
	but comment out the actual definition for now.
	* include/ext/type_traits.h (__promote<_Float16>, __promote<_Float32>,
	__promote<_Float64>, __promote<_Float128>,
	__promote<__gnu_cxx::__bfloat16_t>): New specializations.
	* include/Makefile.am (std_headers): Add stdfloat.
	* include/Makefile.in: Regenerated.
	* include/precompiled/stdc++.h: Include stdfloat.
	* testsuite/18_support/headers/stdfloat/types_std.cc: New test.
	* testsuite/18_support/headers/limits/synopsis_cxx23.cc: New test.
	* testsuite/26_numerics/headers/cmath/c99_classification_macros_c++23.cc:
	New test.
	* testsuite/26_numerics/headers/cmath/functions_std_c++23.cc: New test.
	* testsuite/26_numerics/numbers/4.cc: New test.
	* testsuite/29_atomics/atomic_float/requirements_cxx23.cc: New test.
2022-10-18 11:37:13 +02:00
..
backward libstdc++: Add preprocessor conditions for freestanding [PR106953] 2022-09-16 21:47:19 +01:00
bits libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t 2022-10-18 11:37:13 +02:00
c Update copyright years. 2022-01-03 10:42:10 +01:00
c_compatibility libstdc++: Add _Exit to <stdlib.h> for freestanding 2022-09-21 08:44:21 +01:00
c_global libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t 2022-10-18 11:37:13 +02:00
c_std libstdc++: Declare std::c8rtomb and std::mbrtoc8 if provided by the C library 2022-01-18 16:31:02 +00:00
debug libstdc++: Add __gnu_debug::basic_string<>::compare overloads 2022-10-12 21:50:21 +02:00
decimal Update copyright years. 2022-01-03 10:42:10 +01:00
experimental libstdc++: Use ///< for inline documentation 2022-10-04 09:43:57 +01:00
ext libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t 2022-10-18 11:37:13 +02:00
parallel Update copyright years. 2022-01-03 10:42:10 +01:00
precompiled libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t 2022-10-18 11:37:13 +02:00
pstl libstdc++: Reduce header dependencies from PSTL headers [PR92546] 2022-03-18 10:16:36 +00:00
std libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t 2022-10-18 11:37:13 +02:00
tr1 libstdc++: Mark headers that must be hosted as such [PR103626] 2022-10-03 15:43:48 +01:00
tr2 Update copyright years. 2022-01-03 10:42:10 +01:00
Makefile.am libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t 2022-10-18 11:37:13 +02:00
Makefile.in libstdc++: Partial library support for std::float{16,32,64,128}_t and std::bfloat16_t 2022-10-18 11:37:13 +02:00