util: don't use _fxsave() with MSVC 2010 or older
authorBrian Paul <brianp@vmware.com>
Tue, 10 Sep 2013 15:20:34 +0000 (09:20 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 10 Sep 2013 17:01:37 +0000 (11:01 -0600)
And update _MSC_VER comments in p_config.h

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/util/u_cpu_detect.c
src/gallium/include/pipe/p_config.h

index 2ff40bb00505fbff9b42383965fb287d3d26048c..8ac26cb37705e5d610f852b1601a494c96306dff 100644 (file)
@@ -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));
 }
index 1588a92e41bed07d195eb3b4f8b8b35acab3c5a3..9bccf327d85bd853a7af418d8ade14d205e89131 100644 (file)
 
 /*
  * 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