From abdc839367e3f9a27e864907b2bf6b6a9d232b89 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 3 Apr 2016 10:41:28 +0200 Subject: [PATCH] Workaround for old gcc versions missing _mm256_broadcastsi128_si256() Some old gcc versions define vbroadcasti128 as _mm_broadcastsi128_si256() not _mm256_broadcastsi128_si256(). Detect this, and use _mm_broadcastsi128_si256() in that case. --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 656bec2a..782a4b4e 100644 --- a/configure.ac +++ b/configure.ac @@ -379,7 +379,17 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[ ]], [[ __m256i x = _mm256_abs_epi8(_mm256_setzero_si256()); ]])], [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_AVX="-mavx2"]) + AC_MSG_CHECKING(if _mm256_broadcastsi128_si256 is correctly defined) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#pragma GCC target("avx2") +#include + ]], [[ __m256i y = _mm256_broadcastsi128_si256(_mm_setzero_si128()); ]])], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE([_mm256_broadcastsi128_si256], [_mm_broadcastsi128_si256], + [Define to the local name of _mm256_broadcastsi128_si256])]) + ], [AC_MSG_RESULT(no)]) CFLAGS="$oldcflags"