Mesa (master): util: (trivial) fix asm input/output list for fxsave

Roland Scheidegger sroland at kemper.freedesktop.org
Fri Aug 9 15:31:27 UTC 2013


Module: Mesa
Branch: master
Commit: 836098f6b2dd275a2f557780d094cde13471f49d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=836098f6b2dd275a2f557780d094cde13471f49d

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Fri Aug  9 17:29:52 2013 +0200

util: (trivial) fix asm input/output list for fxsave

Otherwise gcc might do very unsafe optimizations, spotted by Uros Bizjak.
Hopefully this time it's finally right?

---

 src/gallium/auxiliary/util/u_cpu_detect.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index 3b36993..87ad780 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -244,7 +244,7 @@ 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));
+   __asm __volatile ("fxsave %0" : "+m" (fxarea));
 #elif (defined(PIPE_CC_MSVC) || defined(PIPE_CC_ICL))
    _fxsave(&fxarea);
 #endif




More information about the mesa-commit mailing list