Mesa (master): util: don't use _fxsave() with MSVC 2010 or older
Brian Paul
brianp at kemper.freedesktop.org
Tue Sep 10 17:02:26 UTC 2013
Module: Mesa
Branch: master
Commit: 923d3467147dd301d94ed3e6b41295fb2bcd6f47
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=923d3467147dd301d94ed3e6b41295fb2bcd6f47
Author: Brian Paul <brianp at vmware.com>
Date: Tue Sep 10 09:20:34 2013 -0600
util: don't use _fxsave() with MSVC 2010 or older
And update _MSC_VER comments in p_config.h
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
---
src/gallium/auxiliary/util/u_cpu_detect.c | 5 ++++-
src/gallium/include/pipe/p_config.h | 4 ++++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index 2ff40bb..8ac26cb 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -283,8 +283,11 @@ static INLINE boolean sse2_has_daz(void)
fxarea.mxcsr_mask = 0;
#if (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO))
__asm __volatile ("fxsave %0" : "+m" (fxarea));
-#elif (defined(PIPE_CC_MSVC) || defined(PIPE_CC_ICL))
+#elif (defined(PIPE_CC_MSVC) && _MSC_VER >= 1700)) || defined(PIPE_CC_ICL)
+ /* 1700 = Visual Studio 2012 */
_fxsave(&fxarea);
+#else
+ fxarea.mxcsr_mask = 0;
#endif
return !!(fxarea.mxcsr_mask & (1 << 6));
}
diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
index 1588a92..9bccf32 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -58,6 +58,10 @@
/*
* Meaning of _MSC_VER value:
+ * - 1800: Visual Studio 2013
+ * - 1700: Visual Studio 2012
+ * - 1600: Visual Studio 2010
+ * - 1500: Visual Studio 2008
* - 1400: Visual C++ 2005
* - 1310: Visual C++ .NET 2003
* - 1300: Visual C++ .NET 2002
More information about the mesa-commit
mailing list