base/asm-common.h: Reverse the order of `SHUF' arguments.
[catacomb] / base / asm-common.h
index d81e409..d6a8b01 100644 (file)
@@ -1,6 +1,6 @@
 /// -*- mode: asm; asm-comment-char: ?/ -*-
 ///
-/// Fancy SIMD implementation of Salsa20
+/// Common definitions for asesembler source files
 ///
 /// (c) 2015 Straylight/Edgeware
 ///
@@ -217,11 +217,11 @@ 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))
+// Permutations for SIMD instructions.  SHUF(A, B, C, D) is an immediate,
+// suitable for use in `pshufd' or `shufpd', which copies element A
+// (0 <= A < 4) of the source to element 0 of the destination, element B to
+// element 1, element C to element 2, and element D to element 3.
+#define SHUF(a, b, c, d) ((a) + 4*(b) + 16*(c) + 64*(d))
 
 // Map register names to their individual pieces.