]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix SFINAE for __is_intrinsic_type on ARM
authorMatthias Kretz <m.kretz@gsi.de>
Wed, 24 May 2023 10:50:46 +0000 (12:50 +0200)
committerMatthias Kretz <m.kretz@gsi.de>
Thu, 25 May 2023 07:03:39 +0000 (09:03 +0200)
On ARM NEON doesn't support double, so __is_intrinsic_type_v<double,
whatever> should say false (instead of being ill-formed).

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

PR libstdc++/109261
* include/experimental/bits/simd.h (__intrinsic_type):
Specialize __intrinsic_type<double, 8> and
__intrinsic_type<double, 16> in any case, but provide the member
type only with __aarch64__.

(cherry picked from commit aa8b363171a95b8f867a74f29c75f9577e9087e1)

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

index 224153ffbaf5b0f3950cff5dfa5c0c4c75138305..b7c756436e1a18ce03a9f2b9f01ca60d7bc9dfc1 100644 (file)
@@ -2369,15 +2369,21 @@ template <>
   struct __intrinsic_type<float, 16, void>
   { using type = float32x4_t; };
 
-#if _GLIBCXX_SIMD_HAVE_NEON_A64
 template <>
   struct __intrinsic_type<double, 8, void>
-  { using type = float64x1_t; };
+  {
+#if _GLIBCXX_SIMD_HAVE_NEON_A64
+   using type = float64x1_t;
+#endif
+  };
 
 template <>
   struct __intrinsic_type<double, 16, void>
-  { using type = float64x2_t; };
+  {
+#if _GLIBCXX_SIMD_HAVE_NEON_A64
+    using type = float64x2_t;
 #endif
+  };
 
 #define _GLIBCXX_SIMD_ARM_INTRIN(_Bits, _Np)                                   \
 template <>                                                                    \