Commit 25c6cbe2 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

cpu.h: Another CPP fixup

CPP is minefield. We should simplify CPP wherever possible and work
to minimise nesting.
parent c4bdd6fd
......@@ -55,6 +55,9 @@
#endif
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#if FLAC__HAS_X86INTRIN
/* SSE intrinsics support by ICC/MSVC/GCC */
......@@ -88,8 +91,7 @@
#define FLAC__AVX2_SUPPORTED 1
#define FLAC__FMA_SUPPORTED 1
#endif
#elif defined __GNUC__ && defined __clang__
#if defined __clang__ && __has_attribute(__target__) /* clang */
#elif defined __clang__ && __has_attribute(__target__) /* clang */
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
#if __has_builtin(__builtin_ia32_maxps)
#define FLAC__SSE_SUPPORTED 1
......@@ -106,18 +108,18 @@
#if __has_builtin(__builtin_ia32_pabsd256)
#define FLAC__AVX2_SUPPORTED 1
#endif
#elif defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */
#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
#define FLAC__SSE2_SUPPORTED 1
#define FLAC__SSSE3_SUPPORTED 1
#define FLAC__SSE4_1_SUPPORTED 1
#ifdef FLAC__USE_AVX
#ifdef FLAC__USE_AVX
#define FLAC__AVX_SUPPORTED 1
#define FLAC__AVX2_SUPPORTED 1
#define FLAC__FMA_SUPPORTED 1
#endif
#else /* older GCC and clang */
#endif
#else
#define FLAC__SSE_TARGET(x)
#ifdef __SSE__
#define FLAC__SSE_SUPPORTED 1
......@@ -140,7 +142,6 @@
#ifdef __FMA__
#define FLAC__FMA_SUPPORTED 1
#endif
#endif
#endif /* compiler version */
#endif /* intrinsics support */
......
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