]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
fix movq and load_m128_from_u64a and resp. test for NEON
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Thu, 3 Dec 2020 17:27:38 +0000 (19:27 +0200)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Thu, 3 Dec 2020 17:27:38 +0000 (19:27 +0200)
src/util/arch/arm/simd_utils.h
unit/internal/simd_utils.cpp

index 232ca76f40f1d5a03f6749fab468e95a4e1556b4..c918eced2a6015f72bfb5e58b46f90904df33d54 100644 (file)
@@ -151,13 +151,13 @@ static really_inline u32 movd(const m128 in) {
 }
 
 static really_inline u64a movq(const m128 in) {
-    return vgetq_lane_u64((uint64x2_t) in, 1);
+    return vgetq_lane_u64((uint64x2_t) in, 0);
 }
 
 /* another form of movq */
 static really_inline
 m128 load_m128_from_u64a(const u64a *p) {
-    return (m128) vdupq_n_u64(*p);
+    return (m128) vsetq_lane_u64(*p, zeroes128(), 0);
 }
 
 static really_inline u32 extract32from128(const m128 in, unsigned imm) {
index 5c0e0b40317e8824e0d75d98cad48aa2ba25f2ac..bc1426b1946e796aa7a7b507673046a48a6e3ea6 100644 (file)
@@ -667,7 +667,7 @@ TEST(SimdUtilsTest, movq) {
 #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 };
+    int64x2_t a = { 0x123456789abcdefLL, ~0LL };
     simd = vreinterpretq_s64_s8(a);
 #endif
 #endif