From e1f722a51df2a4417140efabb84452b48ba04117 Mon Sep 17 00:00:00 2001 From: Erik Lindahl Date: Fri, 11 Jul 2014 10:16:27 +0200 Subject: [PATCH] Make AVX2 check more robust Apparently the GNU assembler version 2.20 supported some parts of AVX2 (in particular the FMA floating-point ops), which caused our cmake test to pass. This patch changes it to test the integer addition instead, which isn't supported in as-2.20 in my tests. Change-Id: I79e516639fc78d1590d306f486eb027962388543 --- cmake/gmxTestSimd.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/gmxTestSimd.cmake b/cmake/gmxTestSimd.cmake index 44bdd202cb..f99a43f6de 100644 --- a/cmake/gmxTestSimd.cmake +++ b/cmake/gmxTestSimd.cmake @@ -231,12 +231,12 @@ elseif(${GMX_SIMD} STREQUAL "AVX2_256") gmx_find_cflag_for_source(CFLAGS_AVX2 "C compiler AVX2 flag" "#include - int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_fmadd_ps(x,x,x);return _mm256_movemask_ps(x);}" + int main(){__m256i x=_mm256_set1_epi32(5);x=_mm256_add_epi32(x,x);return _mm256_movemask_epi8(x);}" SIMD_C_FLAGS "-march=core-avx2" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet gmx_find_cxxflag_for_source(CXXFLAGS_AVX2 "C++ compiler AVX2 flag" "#include - int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_fmadd_ps(x,x,x);return _mm256_movemask_ps(x);}" + int main(){__m256i x=_mm256_set1_epi32(5);x=_mm256_add_epi32(x,x);return _mm256_movemask_epi8(x);}" SIMD_CXX_FLAGS "-march=core-avx2" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet -- 2.22.0