Verified Commit b358381a authored by tmkk's avatar tmkk Committed by Ralph Giles
Browse files

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
parent 313ab585
Pipeline #2600 passed with stage
in 35 minutes and 11 seconds
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment