]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
don't use SSE directly in the tests
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Fri, 30 Oct 2020 08:38:05 +0000 (10:38 +0200)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Fri, 30 Oct 2020 08:38:05 +0000 (10:38 +0200)
unit/internal/simd_utils.cpp

index 623c2c998c30cd009c957b0275fbd4fbca4ba3e6..5c0e0b40317e8824e0d75d98cad48aa2ba25f2ac 100644 (file)
@@ -658,34 +658,41 @@ TEST(SimdUtilsTest, movq) {
 
     char cmp[sizeof(m128)];
     memset(cmp, 0x80, sizeof(m128));
-    simd = set16x8(0x80);
+    simd = set1_16x8(0x80);
     r = movq(simd);
     ASSERT_EQ(0, memcmp(cmp, &simd, sizeof(simd)));
     ASSERT_EQ(0, memcmp(cmp, &r, sizeof(r)));
 
+#if defined(HAVE_SIMD_128_BITS)
+#if defined(ARCH_IA32) || defined(ARCH_X86_64)
     simd = _mm_set_epi64x(~0LL, 0x123456789abcdef);
+#elif defined(ARCH_ARM32) || defined(ARCH_AARCH64)
+    int64x2_t a = { ~0LL, 0x123456789abcdefLL };
+    simd = vreinterpretq_s64_s8(a);
+#endif
+#endif
     r = movq(simd);
     ASSERT_EQ(r, 0x123456789abcdef);
 }
 
 
-TEST(SimdUtilsTest, set16x8) {
+TEST(SimdUtilsTest, set1_16x8) {
     char cmp[sizeof(m128)];
 
     for (unsigned i = 0; i < 256; i++) {
-        m128 simd = set16x8(i);
+        m128 simd = set1_16x8(i);
         memset(cmp, i, sizeof(simd));
         ASSERT_EQ(0, memcmp(cmp, &simd, sizeof(simd)));
     }
 }
 
-TEST(SimdUtilsTest, set4x32) {
+TEST(SimdUtilsTest, set1_4x32) {
     u32 cmp[4] = { 0x12345678, 0x12345678, 0x12345678, 0x12345678 };
-    m128 simd = set4x32(cmp[0]);
+    m128 simd = set1_4x32(cmp[0]);
     ASSERT_EQ(0, memcmp(cmp, &simd, sizeof(simd)));
 }
 
-#if defined(HAVE_AVX2)
+#if defined(HAVE_SIMD_256_BITS)
 TEST(SimdUtilsTest, set32x8) {
     char cmp[sizeof(m256)];