Better AVX2 detection for GCC compilers

This commit is contained in:
Ilya Maykov 2016-08-03 16:49:21 -07:00
parent 2f4f718cd9
commit 534e0774e3

View File

@ -398,10 +398,15 @@ AS_IF([test "x$EMSCRIPTEN" = "x" -a "$host_os" != "pnacl"], [
#endif
#pragma GCC target("avx2")
#include <immintrin.h>
]], [[ __m256i x = _mm256_abs_epi8(_mm256_setzero_si256()); ]])],
]], [[
__m256i x = _mm256_abs_epi8(_mm256_setzero_si256());
#ifdef __GNUC__
__asm__ __volatile__ ("vpermq $1,%ymm1,%ymm2");
#endif
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_AVX2INTRIN_H], [1], [AVX2 is available])
AX_CHECK_COMPILE_FLAG([-mavx2], [CFLAGS_AVX="-mavx2"])
AX_CHECK_COMPILE_FLAG([-mavx2], [CFLAGS_AVX2="-mavx2"])
AC_MSG_CHECKING(if _mm256_broadcastsi128_si256 is correctly defined)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef __native_client__