[Pixman] [PATCH] Use a compile-time constant for the "K" constraint in the MMX detection.

Søren Sandman sandmann at cs.au.dk
Sun Jul 1 14:03:25 PDT 2012


From: Søren Sandmann Pedersen <ssp at redhat.com>

When compiling with -O0, gcc doesn't understand that in

     signed char x = 0;

     ...

     asm ("...",
     	  : "K" (x));

x is constant. Fix this by using an immediate constant instead of a
variable.
---
 configure.ac |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2b9d1ba..36f423e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -351,12 +351,11 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 int main () {
     __m64 v = _mm_cvtsi32_si64 (1);
     __m64 w;
-    signed char x = 0;
 
     /* Some versions of clang will choke on K */
     asm ("pshufw %2, %1, %0\n\t"
         : "=y" (w)
-        : "y" (v), "K" (x)
+        : "y" (v), "K" (5)
     );
 
     return _mm_cvtsi64_si32 (v);
-- 
1.7.10.4



More information about the Pixman mailing list