From 9c5c05201a312892ae675b142d32fbb35d1f19b9 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 9 Sep 2016 21:44:07 -0700 Subject: [PATCH] AVX2 Adler-32 actually requires gcc 4.9+ --- common/compiler_gcc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/compiler_gcc.h b/common/compiler_gcc.h index 1964330..917de16 100644 --- a/common/compiler_gcc.h +++ b/common/compiler_gcc.h @@ -40,9 +40,13 @@ (COMPILER_SUPPORTS_TARGET_FUNCTION_ATTRIBUTE && \ (GCC_PREREQ(4, 7) || __has_builtin(__builtin_ia32_pdep_di))) +/* + * Note: AVX2 support was added in gcc 4.7, but AVX2 intrinsics don't work in + * __attribute__((target("avx2"))) functions until gcc 4.9. + */ #define COMPILER_SUPPORTS_AVX2_TARGET \ (COMPILER_SUPPORTS_TARGET_FUNCTION_ATTRIBUTE && \ - (GCC_PREREQ(4, 7) || __has_builtin(__builtin_ia32_pmaddwd256))) + (GCC_PREREQ(4, 9) || __has_builtin(__builtin_ia32_pmaddwd256))) /* Newer gcc supports __BYTE_ORDER__. Older gcc doesn't. */ #ifdef __BYTE_ORDER__