32 #include <m4ri/misc.h>
38 #define __M4RI_MIX32(a, b) (((((a) >> 32) ^ (a)) << 32) | \
39 ((((b) << 32) ^ (b)) >> 32))
45 #define __M4RI_MIX16(a, b) (((((a) << 16) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xFFFF0000FFFF0000ull)) | \
46 ((((b) >> 16) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x0000FFFF0000FFFFull)));
51 #define __M4RI_MIX8(a, b) (((((a) << 8) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xFF00FF00FF00FF00ull)) | \
52 ((((b) >> 8) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x00FF00FF00FF00FFull)));
57 #define __M4RI_MIX4(a, b) (((((a) << 4) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xF0F0F0F0F0F0F0F0ull)) | \
58 ((((b) >> 4) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x0F0F0F0F0F0F0F0Full)));
63 #define __M4RI_MIX2(a, b) (((((a) << 2) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xCCCCCCCCCCCCCCCCull)) | \
64 ((((b) >> 2) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x3333333333333333ull)));
69 #define __M4RI_MIX1(a, b) (((((a) << 1) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xAAAAAAAAAAAAAAAAull)) | \
70 ((((b) >> 1) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x5555555555555555ull)));
79 word a0, a1, b0, b1, c0, c1;
127 #endif // M4RI_PARITY_H
static word m4ri_parity64_helper(word *buf)
See parity64.
Definition: parity.h:77
#define __M4RI_MIX4(a, b)
Step for mixing two 64-bit words to compute their parity.
Definition: parity.h:57
static word m4ri_parity64(word *buf)
Computes parity of each of buf[0], buf[1], ..., buf[63]. Returns single word whose bits are the parit...
Definition: parity.h:112
#define __M4RI_MIX32(a, b)
Step for mixing two 64-bit words to compute their parity.
Definition: parity.h:38
#define __M4RI_MIX8(a, b)
Step for mixing two 64-bit words to compute their parity.
Definition: parity.h:51
#define __M4RI_MIX16(a, b)
Step for mixing two 64-bit words to compute their parity.
Definition: parity.h:45
#define __M4RI_MIX2(a, b)
Step for mixing two 64-bit words to compute their parity.
Definition: parity.h:63
#define __M4RI_MIX1(a, b)
Step for mixing two 64-bit words to compute their parity.
Definition: parity.h:69
uint64_t word
A word is the typical packed data structure to represent packed bits.
Definition: misc.h:87