From 951be75292043995589bcb780b1e9702e4ea8c14 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 13 Apr 2017 17:35:11 +0100 Subject: [PATCH] Half precision conversion working on AVX512 now too --- lib/simd/Grid_avx512.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/simd/Grid_avx512.h b/lib/simd/Grid_avx512.h index 0c4061fb..9156f113 100644 --- a/lib/simd/Grid_avx512.h +++ b/lib/simd/Grid_avx512.h @@ -347,8 +347,8 @@ namespace Optimization { #ifdef USE_FP16 __m256i ha = _mm512_cvtps_ph(a,0); __m256i hb = _mm512_cvtps_ph(b,0); - h =(__m512i) _mm512_castps256_ps512(ha); - h =(__m512i) _mm512_insertf64x4((__m512d)h,(__m512d)hb,1); + h =(__m512i) _mm512_castps256_ps512((__m256)ha); + h =(__m512i) _mm512_insertf64x4((__m512d)h,(__m256d)hb,1); #else assert(0); #endif @@ -356,8 +356,8 @@ namespace Optimization { } static inline void HtoS (__m512i h,__m512 &sa,__m512 &sb) { #ifdef USE_FP16 - sa = _mm512_cvtph_ps(_mm512_extractf256_ps(h,0)); - sb = _mm512_cvtph_ps(_mm512_extractf256_ps(h,1)); + sa = _mm512_cvtph_ps((__m256i)_mm512_extractf64x4_pd((__m512d)h,0)); + sb = _mm512_cvtph_ps((__m256i)_mm512_extractf64x4_pd((__m512d)h,1)); #else assert(0); #endif