summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorevpobr <evpobr@gmail.com>2018-05-10 21:25:14 +0500
committerErik de Castro Lopo <erikd@mega-nerd.com>2018-06-13 06:21:54 +1000
commit6892e7c8a2a14f2a8a70dca71286648574986f07 (patch)
tree9fa5c418ab8c4243232a75582e68310cbb708560
parent452a44777892086892feb8ed7f1156e9b897b5c3 (diff)
downloadflac-6892e7c8a2a14f2a8a70dca71286648574986f07.tar.gz
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 <erikd@mega-nerd.com>
-rw-r--r--src/libFLAC/include/private/cpu.h30
1 files 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__