]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix condition for supported SIMD types on ARMv8
authorMatthias Kretz <m.kretz@gsi.de>
Thu, 1 Jun 2023 08:40:14 +0000 (10:40 +0200)
committerMatthias Kretz <m.kretz@gsi.de>
Thu, 1 Jun 2023 08:45:10 +0000 (10:45 +0200)
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

PR libstdc++/110050
* include/experimental/bits/simd.h (__vectorized_sizeof): With
__have_neon_a32 only single-precision float works (in addition
to integers).

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

index f94b8361ab068efc09672df2ed84ac09d861b8c1..834fe923065bd7bdfe4af8c6cdb2d5224081b306 100644 (file)
@@ -2808,8 +2808,10 @@ template <typename _Tp>
          return 16;
 
        // ARM:
-       if constexpr (__have_neon_a64
-                     || (__have_neon_a32 && !is_same_v<_Tp, double>) )
+       if constexpr (__have_neon_a64)
+         return 16;
+       if constexpr (__have_neon_a32 and (not is_floating_point_v<_Tp>
+                                            or is_same_v<_Tp, float>))
          return 16;
        if constexpr (__have_neon
                      && sizeof(_Tp) < 8