M4RI  20140914
Macros | Functions
parity.h File Reference

Compute the parity of 64 words in parallel. More...

#include <m4ri/misc.h>

Go to the source code of this file.

Macros

#define __M4RI_MIX32(a, b)
 Step for mixing two 64-bit words to compute their parity. More...
 
#define __M4RI_MIX16(a, b)
 Step for mixing two 64-bit words to compute their parity. More...
 
#define __M4RI_MIX8(a, b)
 Step for mixing two 64-bit words to compute their parity. More...
 
#define __M4RI_MIX4(a, b)
 Step for mixing two 64-bit words to compute their parity. More...
 
#define __M4RI_MIX2(a, b)
 Step for mixing two 64-bit words to compute their parity. More...
 
#define __M4RI_MIX1(a, b)
 Step for mixing two 64-bit words to compute their parity. More...
 

Functions

static word m4ri_parity64_helper (word *buf)
 See parity64.
 
static word m4ri_parity64 (word *buf)
 Computes parity of each of buf[0], buf[1], ..., buf[63]. Returns single word whose bits are the parities of buf[0], ..., buf[63]. More...
 

Detailed Description

Compute the parity of 64 words in parallel.

Author
David Harvey

Macro Definition Documentation

#define __M4RI_MIX1 (   a,
 
)
Value:
(((((a) << 1) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xAAAAAAAAAAAAAAAAull)) | \
((((b) >> 1) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x5555555555555555ull)));
#define __M4RI_CONVERT_TO_WORD(i)
Explicit conversion macro.
Definition: misc.h:135

Step for mixing two 64-bit words to compute their parity.

#define __M4RI_MIX16 (   a,
 
)
Value:
(((((a) << 16) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xFFFF0000FFFF0000ull)) | \
((((b) >> 16) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x0000FFFF0000FFFFull)));
#define __M4RI_CONVERT_TO_WORD(i)
Explicit conversion macro.
Definition: misc.h:135

Step for mixing two 64-bit words to compute their parity.

#define __M4RI_MIX2 (   a,
 
)
Value:
(((((a) << 2) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xCCCCCCCCCCCCCCCCull)) | \
((((b) >> 2) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x3333333333333333ull)));
#define __M4RI_CONVERT_TO_WORD(i)
Explicit conversion macro.
Definition: misc.h:135

Step for mixing two 64-bit words to compute their parity.

#define __M4RI_MIX32 (   a,
 
)
Value:
(((((a) >> 32) ^ (a)) << 32) | \
((((b) << 32) ^ (b)) >> 32))

Step for mixing two 64-bit words to compute their parity.

#define __M4RI_MIX4 (   a,
 
)
Value:
(((((a) << 4) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xF0F0F0F0F0F0F0F0ull)) | \
((((b) >> 4) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x0F0F0F0F0F0F0F0Full)));
#define __M4RI_CONVERT_TO_WORD(i)
Explicit conversion macro.
Definition: misc.h:135

Step for mixing two 64-bit words to compute their parity.

#define __M4RI_MIX8 (   a,
 
)
Value:
(((((a) << 8) ^ (a)) & __M4RI_CONVERT_TO_WORD(0xFF00FF00FF00FF00ull)) | \
((((b) >> 8) ^ (b)) & __M4RI_CONVERT_TO_WORD(0x00FF00FF00FF00FFull)));
#define __M4RI_CONVERT_TO_WORD(i)
Explicit conversion macro.
Definition: misc.h:135

Step for mixing two 64-bit words to compute their parity.

Function Documentation

static word m4ri_parity64 ( word buf)
inlinestatic

Computes parity of each of buf[0], buf[1], ..., buf[63]. Returns single word whose bits are the parities of buf[0], ..., buf[63].

Parameters
bufbuffer of words of length 64