]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Use intrinsic to get correct movq everywhere
authorMatthew Barr <matthew.barr@intel.com>
Mon, 6 Mar 2017 22:58:24 +0000 (09:58 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 05:16:03 +0000 (15:16 +1000)
The real trick here is that _mm_set_epi64x() (note the 'x') takes a 64-bit
value - not a ptr to a 128-bit value like the non-x - so compilers don't
twist themselves in knots with alignment or whatever confuses them.

src/util/simd_utils.h

index c6d43f57e68d847ccd4a952b5669215a93349fc6..484b47c0f8903d1de0fd3f186a90863eff57662f 100644 (file)
@@ -180,9 +180,7 @@ static really_inline u64a movq(const m128 in) {
 /* another form of movq */
 static really_inline
 m128 load_m128_from_u64a(const u64a *p) {
-    m128 out;
-    __asm__ ("vmovq\t%1,%0" : "=x"(out) :"m"(*p));
-    return out;
+    return _mm_set_epi64x(0LL, *p);
 }
 
 #define rshiftbyte_m128(a, count_immed) _mm_srli_si128(a, count_immed)