diff options
author | Matthias Kretz <m.kretz@gsi.de> | 2021-01-28 21:04:03 +0100 |
---|---|---|
committer | Matthias Kretz <m.kretz@gsi.de> | 2021-06-25 17:32:13 +0200 |
commit | 74ebd1297e9cfa9f7d05bfcac5510d4968cc6ba8 (patch) | |
tree | 9bb7e817fc371c9c9faed3f16d5039828ee1e24f /gcc | |
parent | 3c3474679419707710a899a03151cbe79a91c360 (diff) | |
download | gcc-74ebd1297e9cfa9f7d05bfcac5510d4968cc6ba8.zip gcc-74ebd1297e9cfa9f7d05bfcac5510d4968cc6ba8.tar.gz gcc-74ebd1297e9cfa9f7d05bfcac5510d4968cc6ba8.tar.bz2 |
libstdc++: Make use of __builtin_bit_cast for simd
The __bit_cast function was a hack to achieve what __builtin_bit_cast
can do, therefore use __builtin_bit_cast if possible. However,
__builtin_bit_cast cannot be used to cast from/to fixed_size_simd, since
it isn't trivially copyable (in the language sense — in principle it
is). Therefore add __proposed::simd_bit_cast to enable the use case
required in the test framework.
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h (__bit_cast): Implement via
__builtin_bit_cast #if available.
(__proposed::simd_bit_cast): Add overloads for simd and
simd_mask, which use __builtin_bit_cast (or __bit_cast #if not
available), which return an object of the requested type with
the same bits as the argument.
* include/experimental/bits/simd_math.h: Use simd_bit_cast
instead of __bit_cast to allow casts to fixed_size_simd.
(copysign): Remove branch that was only required if __bit_cast
cannot be constexpr.
* testsuite/experimental/simd/tests/bits/test_values.h: Switch
from __bit_cast to __proposed::simd_bit_cast since the former
will not cast fixed_size objects anymore.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions