From 11b76f4cb4e0be4ab9ccbfc0a18ee9edeea39aa5 Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Wed, 24 Dec 2014 19:40:16 +0100 Subject: [PATCH] util: improve fxsave detection Also drops double set fxarea.mxcsr_mask in case of unsupported CC. Signed-off-by: David Heidelberg --- src/gallium/auxiliary/util/u_cpu_detect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c index 5d9db59..13b7a89 100644 --- a/src/gallium/auxiliary/util/u_cpu_detect.c +++ b/src/gallium/auxiliary/util/u_cpu_detect.c @@ -281,13 +281,13 @@ static INLINE boolean sse2_has_daz(void) } PIPE_ALIGN_VAR(16) fxarea; fxarea.mxcsr_mask = 0; -#if (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO)) +#if (defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 408)) + __builtin_ia32_fxsave(&fxarea); +#elif (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO)) __asm __volatile ("fxsave %0" : "+m" (fxarea)); #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)); } -- 2.1.3