diff options
author | Jeff Wallace <jwallace@avistar.com> | 2009-06-23 15:40:35 +0400 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2009-06-23 15:40:35 +0400 |
commit | e261e59cf71a96b6b242e03d61a9cd4a35d5dcb9 (patch) | |
tree | 37494849acce6a88403bd7cd874bd67486fc7d04 | |
parent | 0dd7bfebe55abcac7e9acbca9d2ac2eddeee2b6f (diff) |
This patch simply flips on the _USE_SSE/_USE_SSE2 automatically if the visual
studio compiler options for SSE/SSE2 are specified or if compiling for x86-64.
-rw-r--r-- | win32/config.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/win32/config.h b/win32/config.h index e79c4c2..6366d7b 100644 --- a/win32/config.h +++ b/win32/config.h @@ -1,6 +1,17 @@ // Microsoft version of 'inline'
#define inline __inline
+// In Visual Studio, _M_IX86_FP=1 means /arch:SSE was used, likewise
+// _M_IX86_FP=2 means /arch:SSE2 was used.
+// Also, enable both _USE_SSE and _USE_SSE2 if we're compiling for x86-64
+#if _M_IX86_FP >= 1 || defined(_M_X64)
+#define _USE_SSE
+#endif
+
+#if _M_IX86_FP >= 2 || defined(_M_X64)
+#define _USE_SSE2
+#endif
+
// Visual Studio support alloca(), but it always align variables to 16-bit
// boundary, while SSE need 128-bit alignment. So we disable alloca() when
// SSE is enabled.
|