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

2012-07-01 Thread Søren Sandman
From: Søren Sandmann Pedersen s...@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

___
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman


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

2012-07-01 Thread Matt Turner
On Sun, Jul 1, 2012 at 5:03 PM, Søren Sandman sandm...@cs.au.dk wrote:
 From: Søren Sandmann Pedersen s...@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

Seems like the smart thing to me.
___
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman