gcc/libstdc++-v3/testsuite/26_numerics
Jakub Jelinek 7393fa8b1d libstdc++: Implement std::byteswap for C++23
This patch attempts to implement P1272R4 (except for the std::bit_cast
changes in there which seem quite unrelated to this and will need to be
fixed on the compiler side).
While at least for GCC __builtin_bswap{16,32,64,128} should work fine
in constant expressions, I wonder about other compilers, so I'm using
a fallback implementation for constexpr evaluation always.
If you think that is unnecessary, I can drop the
__cpp_if_consteval >= 202106L &&
if !consteval
  {
and
  }
and reformat.
The fallback implementation is an attempt to make it work even for integral
types that don't have number of bytes divisible by 2 or when __CHAR_BIT__
is e.g. 16.

2021-11-28  Jakub Jelinek  <jakub@redhat.com>

	* include/std/bit (__cpp_lib_byteswap, byteswap): Define.
	* include/std/version (__cpp_lib_byteswap): Define.
	* testsuite/26_numerics/bit/bit.byteswap/byteswap.cc: New test.
	* testsuite/26_numerics/bit/bit.byteswap/version.cc: New test.
2021-11-28 16:33:33 +01:00
..
accumulate Update copyright years. 2021-01-04 10:26:59 +01:00
adjacent_difference Update copyright years. 2021-01-04 10:26:59 +01:00
bit libstdc++: Implement std::byteswap for C++23 2021-11-28 16:33:33 +01:00
complex Update copyright years. 2021-01-04 10:26:59 +01:00
endian Update copyright years. 2021-01-04 10:26:59 +01:00
exclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
gcd libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-10 16:22:54 +01:00
headers libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-10 16:22:54 +01:00
inclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
inner_product Update copyright years. 2021-01-04 10:26:59 +01:00
iota Update copyright years. 2021-01-04 10:26:59 +01:00
lcm libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-10 16:22:54 +01:00
lerp libstdc++: Add additional overload of std::lerp [PR101870] 2021-08-12 19:46:16 +01:00
midpoint libstdc++: Make some #error strings consistent with other tests 2021-08-12 19:46:16 +01:00
numbers Update copyright years. 2021-01-04 10:26:59 +01:00
partial_sum Update copyright years. 2021-01-04 10:26:59 +01:00
pstl/numeric_ops libstdc++: Replace hyphens in effective target keywords 2021-11-24 13:20:26 +00:00
random c++: Add -fimplicit-constexpr 2021-11-15 18:50:07 -05:00
reduce libstdc++: Replace incorrect static assertion in std::reduce [PR95833] 2021-06-18 14:46:58 +01:00
slice Update copyright years. 2021-01-04 10:26:59 +01:00
slice_array Update copyright years. 2021-01-04 10:26:59 +01:00
transform_exclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
transform_inclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
transform_reduce libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
valarray libstdc++: Fix range access for empty std::valarray [PR103022] 2021-11-01 13:26:29 +00:00