[PATCH 04/11 v3] libstdc++: Make use of __builtin_bit_cast
Jakub Jelinek
jakub@redhat.com
Thu Jun 24 14:08:37 GMT 2021
On Thu, Jun 24, 2021 at 04:01:34PM +0200, Matthias Kretz wrote:
> --- a/libstdc++-v3/include/experimental/bits/simd.h
> +++ b/libstdc++-v3/include/experimental/bits/simd.h
> @@ -1598,7 +1598,9 @@ template <typename _To, typename _From>
> _GLIBCXX_SIMD_INTRINSIC constexpr _To
> __bit_cast(const _From __x)
> {
> - // TODO: implement with / replace by __builtin_bit_cast ASAP
> +#if __has_builtin(__builtin_bit_cast)
Shouldn't that use #if _GLIBCXX_HAS_BUILTIN(__builtin_bit_cast) in
c++config to define a new macro and use that macro here?
Though it is true that c++config already uses
#if __has_builtin(__builtin_is_constant_evaluated)
and so would fail miserably for compilers that don't support __has_builtin
Jakub
More information about the Libstdc++
mailing list