summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmkk <tmkk@mac.com>2021-04-25 15:09:09 +0900
committerRalph Giles <giles@thaumas.net>2021-07-24 22:15:17 -0700
commitb358381a102a2c1c153ee4cf95dfc04af62faa1a (patch)
treea7d7362d589df4d6b74c7cb0d1f7ee300770b597
parent313ab5852fe7cc8ce43c2c4925cc04623c532722 (diff)
downloadflac-b358381a102a2c1c153ee4cf95dfc04af62faa1a.tar.gz
cpu.h: detect AVX/FMA intrinsics availability on clang
Previously the FLAC__AVX2_SUPPORTED macro is defined, but actually AVX2 functions are not used when built with clang because flac only uses them when FLAC__AVX_SUPPORTED macro is set. Signed-off-by: NotTsunami
-rw-r--r--src/libFLAC/include/private/cpu.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libFLAC/include/private/cpu.h b/src/libFLAC/include/private/cpu.h
index fc31350e..0b50839f 100644
--- a/src/libFLAC/include/private/cpu.h
+++ b/src/libFLAC/include/private/cpu.h
@@ -90,9 +90,15 @@
#if __has_builtin(__builtin_ia32_pmuldq128)
#define FLAC__SSE4_1_SUPPORTED 1
#endif
+ #if __has_builtin(__builtin_ia32_maxps256)
+ #define FLAC__AVX_SUPPORTED 1
+ #endif
#if __has_builtin(__builtin_ia32_pabsd256)
#define FLAC__AVX2_SUPPORTED 1
#endif
+ #if __has_builtin(__builtin_ia32_vfmaddps)
+ #define FLAC__FMA_SUPPORTED 1
+ #endif
#elif defined __GNUC__ && !defined __clang__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
#define FLAC__SSE_SUPPORTED 1