[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

pixman: Changes to 'upstream-unstable'



 configure.ac        |   37 +++++++++++++++++++++++++++++--------
 pixman/pixman-mmx.c |   49 +++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 74 insertions(+), 12 deletions(-)

New commits:
commit 65f35270e4531621bd2e1ee5cdb31c56c3051c43
Author: Oded Gabbay <oded.gabbay@gmail.com>
Date:   Tue Dec 22 15:30:10 2015 +0200

    Pre-release version bump to 0.33.6
    
    Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>

diff --git a/configure.ac b/configure.ac
index ae4d3c6..3ada8e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@ AC_PREREQ([2.57])
 
 m4_define([pixman_major], 0)
 m4_define([pixman_minor], 33)
-m4_define([pixman_micro], 5)
+m4_define([pixman_micro], 6)
 
 m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
 

commit a566f627dbd6ea8f2cba70a446e62caaa2ecbd26
Author: Oded Gabbay <oded.gabbay@gmail.com>
Date:   Tue Dec 15 14:53:18 2015 +0200

    configura.ac: fix test for SSE2 & SSSE3 assembler support
    
    This patch modifies the SSE2 & SSSE3 tests in configure.ac to use a
    global variable to initialize vector variables. In addition, we now
    return the value of the computation instead of 0.
    
    This is done so gcc 4.9 (and lower) won't optimize the SSE assembly
    instructions (when using -O1 and higher), because then the configure test
    might incorrectly pass even though the assembler doesn't support the
    SSE instructions (the test will pass because the compiler does support
    the intrinsics).
    
    v2: instead of using volatile, use a global variable as input
    
    Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>

diff --git a/configure.ac b/configure.ac
index 3a66909..ae4d3c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -429,10 +429,11 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #include <mmintrin.h>
 #include <xmmintrin.h>
 #include <emmintrin.h>
+int param;
 int main () {
-    __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
+    __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
 	c = _mm_xor_si128 (a, b);
-    return 0;
+    return _mm_cvtsi128_si32(c);
 }]])], have_sse2_intrinsics=yes)
 CFLAGS=$xserver_save_CFLAGS
 
@@ -473,10 +474,11 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #include <xmmintrin.h>
 #include <emmintrin.h>
 #include <tmmintrin.h>
+int param;
 int main () {
-    __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
+    __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
     c = _mm_maddubs_epi16 (a, b);
-    return 0;
+    return _mm_cvtsi128_si32(c);
 }]])], have_ssse3_intrinsics=yes)
 CFLAGS=$xserver_save_CFLAGS
 

commit d24b415f3e2753a588759d028b811e1ce38fea6c
Author: Andrea Canciani <ranma42@gmail.com>
Date:   Sun Oct 11 09:45:57 2015 +0200

    mmx: Improve detection of support for "K" constraint
    
    Older versions of clang emitted an error on the "K" constraint, but at
    least since version 3.7 it is supported. Just like gcc, this
    constraint is only allowed for constants, but apparently clang
    requires them to be known before inlining.
    
    Using the macro definition _mm_shuffle_pi16(A, N) ensures that the "K"
    constraint is always applied to a literal constant, independently from
    the compiler optimizations and allows building pixman-mmx on modern
    clang.
    
    Reviewed-by: Matt Turner <mattst88@gmail.com>
    Signed-off-by: Andrea Canciani <ranma42@gmail.com>

diff --git a/configure.ac b/configure.ac
index 2178126..3a66909 100644
--- a/configure.ac
+++ b/configure.ac
@@ -347,15 +347,27 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #error "Need GCC >= 3.4 for MMX intrinsics"
 #endif
 #include <mmintrin.h>
+#include <stdint.h>
+
+/* Check support for block expressions */
+#define _mm_shuffle_pi16(A, N)						\
+    ({									\
+	__m64 ret;							\
+									\
+	/* Some versions of clang will choke on K */ 			\
+	asm ("pshufw %2, %1, %0\n\t"					\
+	     : "=y" (ret)						\
+	     : "y" (A), "K" ((const int8_t)N)				\
+	);								\
+									\
+	ret;								\
+    })
+
 int main () {
     __m64 v = _mm_cvtsi32_si64 (1);
     __m64 w;
 
-    /* Some versions of clang will choke on K */
-    asm ("pshufw %2, %1, %0\n\t"
-        : "=y" (w)
-        : "y" (v), "K" (5)
-    );
+    w = _mm_shuffle_pi16(v, 5);
 
     /* Some versions of clang will choke on this */
     asm ("pmulhuw %1, %0\n\t"
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 05c48a4..dec3974 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -89,21 +89,7 @@ _mm_mulhi_pu16 (__m64 __A, __m64 __B)
     return __A;
 }
 
-#  ifdef __OPTIMIZE__
-extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_shuffle_pi16 (__m64 __A, int8_t const __N)
-{
-    __m64 ret;
-
-    asm ("pshufw %2, %1, %0\n\t"
-	: "=y" (ret)
-	: "y" (__A), "K" (__N)
-    );
-
-    return ret;
-}
-#  else
-#   define _mm_shuffle_pi16(A, N)					\
+# define _mm_shuffle_pi16(A, N)						\
     ({									\
 	__m64 ret;							\
 									\
@@ -114,7 +100,6 @@ _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
 									\
 	ret;								\
     })
-#  endif
 # endif
 #endif
 

commit 312e381523662aacc2f0ea90eb9ae0634ac5b327
Author: Matt Turner <mattst88@gmail.com>
Date:   Wed Nov 18 14:16:24 2015 -0800

    Revert "mmx: Use MMX2 intrinsics from xmmintrin.h directly."
    
    This reverts commit 7de61d8d14e84623b6fa46506eb74f938287f536.
    
    Newer versions of gcc allow inclusion of xmmintrin.h without -msse, but
    still won't allow usage of the intrinsics.
    
    Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=564024

diff --git a/configure.ac b/configure.ac
index 8370844..2178126 100644
--- a/configure.ac
+++ b/configure.ac
@@ -347,14 +347,21 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #error "Need GCC >= 3.4 for MMX intrinsics"
 #endif
 #include <mmintrin.h>
-#include <xmmintrin.h>
 int main () {
     __m64 v = _mm_cvtsi32_si64 (1);
     __m64 w;
 
-    /* Test some intrinsics from xmmintrin.h */
-    w = _mm_shuffle_pi16(v, 5);
-    w = _mm_mulhi_pu16(w, w);
+    /* Some versions of clang will choke on K */
+    asm ("pshufw %2, %1, %0\n\t"
+        : "=y" (w)
+        : "y" (v), "K" (5)
+    );
+
+    /* Some versions of clang will choke on this */
+    asm ("pmulhuw %1, %0\n\t"
+	: "+y" (w)
+	: "y" (v)
+    );
 
     return _mm_cvtsi64_si32 (v);
 }]])], have_mmx_intrinsics=yes)
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 88c3a39..05c48a4 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -40,9 +40,6 @@
 #else
 #include <mmintrin.h>
 #endif
-#ifdef USE_X86_MMX
-#include <xmmintrin.h>
-#endif
 #include "pixman-private.h"
 #include "pixman-combine32.h"
 #include "pixman-inlines.h"
@@ -62,7 +59,66 @@ _mm_empty (void)
 }
 #endif
 
-#ifndef _MM_SHUFFLE
+#ifdef USE_X86_MMX
+# if (defined(__SUNPRO_C) || defined(_MSC_VER) || defined(_WIN64))
+#  include <xmmintrin.h>
+# else
+/* We have to compile with -msse to use xmmintrin.h, but that causes SSE
+ * instructions to be generated that we don't want. Just duplicate the
+ * functions we want to use.  */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_pi8 (__m64 __A)
+{
+    int ret;
+
+    asm ("pmovmskb %1, %0\n\t"
+	: "=r" (ret)
+	: "y" (__A)
+    );
+
+    return ret;
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_pu16 (__m64 __A, __m64 __B)
+{
+    asm ("pmulhuw %1, %0\n\t"
+	: "+y" (__A)
+	: "y" (__B)
+    );
+    return __A;
+}
+
+#  ifdef __OPTIMIZE__
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_pi16 (__m64 __A, int8_t const __N)
+{
+    __m64 ret;
+
+    asm ("pshufw %2, %1, %0\n\t"
+	: "=y" (ret)
+	: "y" (__A), "K" (__N)
+    );
+
+    return ret;
+}
+#  else
+#   define _mm_shuffle_pi16(A, N)					\
+    ({									\
+	__m64 ret;							\
+									\
+	asm ("pshufw %2, %1, %0\n\t"					\
+	     : "=y" (ret)						\
+	     : "y" (A), "K" ((const int8_t)N)				\
+	);								\
+									\
+	ret;								\
+    })
+#  endif
+# endif
+#endif
+
+#ifndef _MSC_VER
 #define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \
  (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0))
 #endif

commit 3a50806cbeb713b7d1d07a06c6b503d9e43aefe8
Author: Oded Gabbay <oded.gabbay@gmail.com>
Date:   Fri Oct 23 18:33:55 2015 +0300

    Post-release version bump to 0.33.5
    
    Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>

diff --git a/configure.ac b/configure.ac
index dcacff1..8370844 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@ AC_PREREQ([2.57])
 
 m4_define([pixman_major], 0)
 m4_define([pixman_minor], 33)
-m4_define([pixman_micro], 4)
+m4_define([pixman_micro], 5)
 
 m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
 


Reply to: