]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: simd: map 64-bit long double to double on sse [PR124657]
authorAlexandre Oliva <oliva@adacore.com>
Wed, 29 Apr 2026 01:31:27 +0000 (22:31 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 29 Apr 2026 01:31:27 +0000 (22:31 -0300)
When long double is as wide as double on x86 (-mlong-double-64), make
the __intrinsic_type a vector of double.

for  libstdc++-v3/ChangeLog

PR libstdc++/124657
* include/experimental/bits/simd.h (__intrinsic_type::type):
Map long double to double.

libstdc++-v3/include/experimental/bits/simd.h

index b96818af6e6ffa86e6bdc23b0a872ab41ed38e88..8c30c8af268812c834e613d7291385d1f9b5ad41 100644 (file)
@@ -2477,7 +2477,8 @@ template <typename _Tp, size_t _Bytes>
     static constexpr size_t _S_VBytes = _Bytes <= 16 ? 16 : _Bytes <= 32 ? 32 : 64;
 
     using type [[__gnu__::__vector_size__(_S_VBytes)]]
-      = conditional_t<is_integral_v<_Tp>, long long int, _Tp>;
+      = conditional_t<is_integral_v<_Tp>, long long int,
+                     conditional_t<is_same_v<_Tp, long double>, double, _Tp> >;
   };
 #endif // _GLIBCXX_SIMD_HAVE_SSE