From 6892e7c8a2a14f2a8a70dca71286648574986f07 Mon Sep 17 00:00:00 2001 From: evpobr Date: Thu, 10 May 2018 21:25:14 +0500 Subject: [PATCH] Improve SIMD detection with Visual Studio Visual Studio can use GCC (for Android) and Clang (supported toolset) so they must be checked before native compiler. Signed-off-by: Erik de Castro Lopo --- src/libFLAC/include/private/cpu.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/libFLAC/include/private/cpu.h b/src/libFLAC/include/private/cpu.h index 3fe279b0..676d306b 100644 --- a/src/libFLAC/include/private/cpu.h +++ b/src/libFLAC/include/private/cpu.h @@ -76,21 +76,6 @@ #define FLAC__AVX2_SUPPORTED 1 #define FLAC__FMA_SUPPORTED 1 #endif -#elif defined _MSC_VER - #define FLAC__SSE_TARGET(x) - #define FLAC__SSE_SUPPORTED 1 - #define FLAC__SSE2_SUPPORTED 1 - #if (_MSC_VER >= 1500) /* MS Visual Studio 2008 */ - #define FLAC__SSSE3_SUPPORTED 1 - #define FLAC__SSE4_1_SUPPORTED 1 - #endif - #if (_MSC_FULL_VER >= 160040219) /* MS Visual Studio 2010 SP1 */ - #define FLAC__AVX_SUPPORTED 1 - #endif - #if (_MSC_VER >= 1700) /* MS Visual Studio 2012 */ - #define FLAC__AVX2_SUPPORTED 1 - #define FLAC__FMA_SUPPORTED 1 - #endif #elif defined __clang__ && __has_attribute(__target__) /* clang */ #define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x))) #if __has_builtin(__builtin_ia32_maxps) @@ -119,6 +104,21 @@ #define FLAC__AVX2_SUPPORTED 1 #define FLAC__FMA_SUPPORTED 1 #endif +#elif defined _MSC_VER + #define FLAC__SSE_TARGET(x) + #define FLAC__SSE_SUPPORTED 1 + #define FLAC__SSE2_SUPPORTED 1 + #if (_MSC_VER >= 1500) /* MS Visual Studio 2008 */ + #define FLAC__SSSE3_SUPPORTED 1 + #define FLAC__SSE4_1_SUPPORTED 1 + #endif + #if (_MSC_FULL_VER >= 160040219) /* MS Visual Studio 2010 SP1 */ + #define FLAC__AVX_SUPPORTED 1 + #endif + #if (_MSC_VER >= 1700) /* MS Visual Studio 2012 */ + #define FLAC__AVX2_SUPPORTED 1 + #define FLAC__FMA_SUPPORTED 1 + #endif #else #define FLAC__SSE_TARGET(x) #ifdef __SSE__ -- GitLab