Skip to content

Commit

Permalink
Assume Clang supports x86 intrinsics up to FMA
Browse files Browse the repository at this point in the history
This mirrors behaviour for GCC
  • Loading branch information
ktmf01 committed Oct 7, 2022
1 parent 8fbeff2 commit 90c0562
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions src/libFLAC/include/private/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,14 @@
#elif defined __clang__ && __has_attribute(__target__) /* clang */
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
#define FLAC__FAST_MATH_TARGET(x) __attribute__ ((__target__ (x)))
#if __has_builtin(__builtin_ia32_maxps)
#define FLAC__SSE_SUPPORTED 1
#endif
#if __has_builtin(__builtin_ia32_pmuludq128)
#define FLAC__SSE2_SUPPORTED 1
#endif
#if __has_builtin(__builtin_ia32_pabsd128)
#define FLAC__SSSE3_SUPPORTED 1
#endif
#if __has_builtin(__builtin_ia32_pmuldq128)
#define FLAC__SSE4_1_SUPPORTED 1
#endif
#define FLAC__SSE_SUPPORTED 1
#define FLAC__SSE2_SUPPORTED 1
#define FLAC__SSSE3_SUPPORTED 1
#define FLAC__SSE4_1_SUPPORTED 1
#ifdef FLAC__USE_AVX
#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
#define FLAC__AVX_SUPPORTED 1
#define FLAC__AVX2_SUPPORTED 1
#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)))
Expand Down

0 comments on commit 90c0562

Please sign in to comment.