]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
clang 15 (but not 16) fails on ppc64le with -Wdeprecate-lax-vec-conv-all
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Wed, 4 Oct 2023 17:09:45 +0000 (20:09 +0300)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Wed, 4 Oct 2023 17:09:45 +0000 (20:09 +0300)
src/util/arch/ppc64el/simd_utils.h
src/util/supervector/arch/ppc64el/impl.cpp
unit/internal/simd_utils.cpp

index 119d0946f9ce3de564886bdf9366b053591dfcba..4f0e6cc7a596e7637054a75cf525ca32a77c2d73 100644 (file)
@@ -43,6 +43,9 @@
 
 #include <string.h> // for memcpy
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecate-lax-vec-conv-all"
+
 typedef __vector unsigned long long int  uint64x2_t;
 typedef __vector   signed long long int   int64x2_t;
 typedef __vector unsigned int            uint32x4_t;
@@ -124,8 +127,8 @@ static really_really_inline
 m128 rshift_m128(m128 a, unsigned b) {
     if (b == 0) return a;
     m128 sl = (m128) vec_splats((uint8_t) b << 3);
-    m128 result = (m128) vec_sro((uint8x16_t) a, (uint8x16_t) sl);
-    return result;
+    uint8x16_t result = vec_sro((uint8x16_t) a, (uint8x16_t) sl);
+    return (m128) result;
 }
 
 static really_really_inline
@@ -420,4 +423,6 @@ m128 set2x64(u64a hi, u64a lo) {
     return (m128) v;
 }
 
+#pragma clang diagnostic pop
+
 #endif // ARCH_PPC64EL_SIMD_UTILS_H
index 494bcbd699443b473066ea97cd3d2ad53e9331e4..e7baeddeba25f210e16af8b1c7b8023a8ad304bd 100644 (file)
@@ -158,18 +158,21 @@ really_inline SuperVector<16>::SuperVector(uint32_t const other)
     u.u32x4[0] = vec_splats(static_cast<uint32_t>(other));
 }
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecate-lax-vec-conv-all"
 template<>
 template<>
 really_inline SuperVector<16>::SuperVector(int64_t const other)
 {
-    u.s64x2[0] = (int64x2_t) vec_splats(static_cast<ulong64_t>(other));
+    u.s64x2[0] = static_cast<int64x2_t>(vec_splats(static_cast<ulong64_t>(other)));
 }
+#pragma clang diagnostic pop
 
 template<>
 template<>
 really_inline SuperVector<16>::SuperVector(uint64_t const other)
 {
-    u.u64x2[0] = (uint64x2_t) vec_splats(static_cast<ulong64_t>(other));
+    u.u64x2[0] = static_cast<uint64x2_t>(vec_splats(static_cast<ulong64_t>(other)));
 }
 
 // Constants
@@ -266,6 +269,9 @@ really_inline SuperVector<16> SuperVector<16>::eq(SuperVector<16> const &b) cons
     return (*this == b);
 }
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecate-lax-vec-conv-all"
+
 template <>
 really_inline typename SuperVector<16>::comparemask_type
 SuperVector<16>::comparemask(void) const {
@@ -273,9 +279,10 @@ SuperVector<16>::comparemask(void) const {
     uint8x16_t bitmask = vec_gb(u.u8x16[0]);
     bitmask = (uint8x16_t) vec_perm(vec_splat_u8(0), bitmask, perm);
     u32 ALIGN_ATTR(16) movemask;
-    vec_ste((uint32x4_t) bitmask, 0, &movemask);
+    vec_ste(static_cast<uint32x4_t>(bitmask), 0, &movemask);
     return movemask;
 }
+#pragma clang diagnostic pop
 
 template <>
 really_inline typename SuperVector<16>::comparemask_type
index c5cfec7b63f30aedbac052be5e7d20fc19034804..1979344290d8f01c2b16315e71b8a2b088153bf8 100644 (file)
@@ -673,8 +673,11 @@ TEST(SimdUtilsTest, movq) {
     int64x2_t a = { 0x123456789abcdefLL, ~0LL };
     simd = vreinterpretq_s32_s64(a);
 #elif defined(ARCH_PPC64EL)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecate-lax-vec-conv-all"
     int64x2_t a = {0x123456789abcdefLL, ~0LL };
-    simd = (m128) a;
+    simd = static_cast<m128>(a);
+#pragma clang diagnostic pop
 #endif
 #endif
     r = movq(simd);