Mesa (master): util: Move _mm_shuffle_epi8() to u_sse.h.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Aug 9 16:32:24 UTC 2010


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Aug  9 16:41:44 2010 +0100

util: Move _mm_shuffle_epi8() to u_sse.h.

It's bound to be useful elsewhere.

---

 src/gallium/auxiliary/util/u_sse.h          |   29 +++++++++++++++++++++++++++
 src/gallium/drivers/llvmpipe/lp_tile_soa.py |   29 +--------------------------
 2 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_sse.h b/src/gallium/auxiliary/util/u_sse.h
index 6145e34..87959ab 100644
--- a/src/gallium/auxiliary/util/u_sse.h
+++ b/src/gallium/auxiliary/util/u_sse.h
@@ -71,6 +71,35 @@ _mm_castps_si128(__m128 a)
 
 #endif /* defined(_MSC_VER) && _MSC_VER < 1500 */
 
+
+#if defined(PIPE_ARCH_SSSE3)
+
+#include <tmmintrin.h>
+
+#else /* !PIPE_ARCH_SSSE3 */
+
+#include <emmintrin.h>
+
+/**
+ * Describe _mm_shuffle_epi8() with gcc extended inline assembly, for cases
+ * where -mssse3 is not supported/enabled.
+ *
+ * MSVC will never get in here as its intrinsics support do not rely on
+ * compiler command line options.
+ */
+static __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_epi8(__m128i a, __m128i mask)
+{
+    __m128i result;
+    __asm__("pshufb %1, %0"
+            : "=x" (result)
+            : "xm" (mask), "0" (a));
+    return result;
+}
+
+#endif /* !PIPE_ARCH_SSSE3 */
+
+
 #endif /* PIPE_ARCH_X86 || PIPE_ARCH_X86_64 */
 
 #endif /* U_SSE_H_ */
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py
index c71ec80..2ba3905 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py
+++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py
@@ -293,34 +293,7 @@ def generate_ssse3():
     print '''
 #if defined(PIPE_ARCH_SSE)
 
-
-#if defined(PIPE_ARCH_SSSE3)
-
-#include <tmmintrin.h>
-
-#else
-
-#include <emmintrin.h>
-
-/**
- * Describe _mm_shuffle_epi8() with gcc extended inline assembly, for cases
- * where -mssse3 is not supported/enabled.
- *
- * MSVC will never get in here as its intrinsics support do not rely on
- * compiler command line options.
- */
-static __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_shuffle_epi8(__m128i a, __m128i mask)
-{
-    __m128i result;
-    __asm__("pshufb %1, %0"
-            : "=x" (result)
-            : "xm" (mask), "0" (a));
-    return result;
-}
-
-#endif
-
+#include "util/u_sse.h"
 
 static void
 lp_tile_b8g8r8a8_unorm_swizzle_4ub_ssse3(uint8_t *dst,




More information about the mesa-commit mailing list