public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: Fix SFINAE for __is_intrinsic_type on ARM
@ 2023-05-24 10:58 Matthias Kretz
  2023-05-24 11:02 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Kretz @ 2023-05-24 10:58 UTC (permalink / raw)
  To: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

OK for master and all branches? (this issue only surfaced because of the new 
test)

------------ 8< -----------------

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__.
---
 libstdc++-v3/include/experimental/bits/simd.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)


--
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                           https://mattkretz.github.io
 GSI Helmholtz Centre for Heavy Ion Research               https://gsi.de
 stdₓ::simd
──────────────────────────────────────────────────────────────────────────

[-- Attachment #2: 0001-libstdc-Fix-SFINAE-for-__is_intrinsic_type-on-ARM.patch --]
[-- Type: text/x-patch, Size: 942 bytes --]

diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h
index b0571ca26c4..d1f388310f9 100644
--- a/libstdc++-v3/include/experimental/bits/simd.h
+++ b/libstdc++-v3/include/experimental/bits/simd.h
@@ -2369,15 +2369,21 @@ struct __intrinsic_type<float, 8, void>
   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 <>                                                                    \

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libstdc++: Fix SFINAE for __is_intrinsic_type on ARM
  2023-05-24 10:58 [PATCH] libstdc++: Fix SFINAE for __is_intrinsic_type on ARM Matthias Kretz
@ 2023-05-24 11:02 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2023-05-24 11:02 UTC (permalink / raw)
  To: Matthias Kretz; +Cc: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 1493 bytes --]

On Wed, 24 May 2023 at 11:59, Matthias Kretz via Libstdc++ <
libstdc++@gcc.gnu.org> wrote:

> OK for master and all branches? (this issue only surfaced because of the
> new
> test)
>

OK.



>
> ------------ 8< -----------------
>
> 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__.
> ---
>  libstdc++-v3/include/experimental/bits/simd.h | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
>
> --
> ──────────────────────────────────────────────────────────────────────────
>  Dr. Matthias Kretz                           https://mattkretz.github.io
>  GSI Helmholtz Centre for Heavy Ion Research               https://gsi.de
>  stdₓ::simd
> ──────────────────────────────────────────────────────────────────────────

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-24 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24 10:58 [PATCH] libstdc++: Fix SFINAE for __is_intrinsic_type on ARM Matthias Kretz
2023-05-24 11:02 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).