Fix gcc compiles of AVX-512 SIMD
authorErik Lindahl <erik@kth.se>
Tue, 14 Mar 2017 17:58:04 +0000 (17:58 +0000)
committerErik Lindahl <erik.lindahl@gmail.com>
Tue, 14 Mar 2017 20:04:57 +0000 (21:04 +0100)
A previous change to improve shuffling for AVX-512 was
likely only tested on icc, while gcc requires an explicit
pointer cast. Tested on AVX-512 hardware.

Change-Id: I9f4a35f52a54487ff4f403b135391187b1682f8f

src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h

index cacc497748ba2bf840fd16125d02762ed6b035d8..3e01146c0343e8af9c16b59937bead3b95bafae9 100644 (file)
@@ -440,8 +440,8 @@ gatherLoadTransposeHsimd(const float *        base0,
         idx = _mm256_slli_epi32(idx, 1);
     }
 
-    tmp1 = _mm512_castpd_ps(_mm512_i32gather_pd(idx, base0, sizeof(double)));
-    tmp2 = _mm512_castpd_ps(_mm512_i32gather_pd(idx, base1, sizeof(double)));
+    tmp1 = _mm512_castpd_ps(_mm512_i32gather_pd(idx, reinterpret_cast<const double *>(base0), sizeof(double)));
+    tmp2 = _mm512_castpd_ps(_mm512_i32gather_pd(idx, reinterpret_cast<const double *>(base1), sizeof(double)));
 
     v0->simdInternal_ = _mm512_mask_moveldup_ps(tmp1, 0xAAAA, tmp2);
     v1->simdInternal_ = _mm512_mask_movehdup_ps(tmp2, 0x5555, tmp1);