]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
rework load_m128_from_u64a()
authorAlex Coyte <a.coyte@intel.com>
Mon, 29 Aug 2016 05:07:22 +0000 (15:07 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 28 Oct 2016 03:44:16 +0000 (14:44 +1100)
src/util/simd_utils.h

index dc8922fd861b03f93d5c6367c501538dd3f1e87d..b7cb1c0ff467d172bc9106dcc20e6903c7791250 100644 (file)
@@ -176,7 +176,15 @@ static really_inline u64a movq(const m128 in) {
 /* another form of movq */
 static really_inline
 m128 load_m128_from_u64a(const u64a *p) {
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+    /* unfortunately _mm_loadl_epi64() is best avoided as it seems to cause
+     * trouble on some older compilers, possibly because it is misdefined to
+     * take an m128 as its parameter */
+    return _mm_set_epi64((__m64)0ULL, (__m64)*p);
+#else
+    /* ICC doesn't like casting to __m64 */
     return _mm_loadl_epi64((const m128 *)p);
+#endif
 }
 
 #define rshiftbyte_m128(a, count_immed) _mm_srli_si128(a, count_immed)