chiark / gitweb /
base/asm-common.h, *-x86ish-*.S: Centralize SSE shuffling constants.
[catacomb] / base / asm-common.h
index 0d32ccf90952bd5272236a75d4e12bf214078b85..20a1d6a87398ebc935eeb6414d0c844b8a83a287 100644 (file)
@@ -170,6 +170,12 @@ name:
 #  define INTADDR__1(addr, got) addr
 #endif
 
+// Permutations for SIMD instructions.  SHUF(D, C, B, A) is an immediate,
+// suitable for use in `pshufd' or `shufpd', which copies element D
+// (0 <= D < 4) of the source to element 3 of the destination, element C to
+// element 2, element B to element 1, and element A to element 0.
+#define SHUF(d, c, b, a) (64*(d) + 16*(c) + 4*(b) + (a))
+
 #endif
 
 ///--------------------------------------------------------------------------