Initial value:= {
0x00000000u, 0x01000000u, 0x00010000u, 0x01010000u,
0x00000100u, 0x01000100u, 0x00010100u, 0x01010100u,
0x00000001u, 0x01000001u, 0x00010001u, 0x01010001u,
0x00000101u, 0x01000101u, 0x00010101u, 0x01010101u,
}
kSpreadNibble[n] places the 4 bits of nibble n at bit 0 of 4 separate bytes: byte0 = bit3(n), byte1 = bit2(n), byte2 = bit1(n), byte3 = bit0(n).
A 16-entry literal table (C++11-valid, no constexpr loop, ~64 bytes, cache- resident). spreadA/spreadB only depend on one nibble each, so this one table serves both halves.
Definition at line 27 of file bit_spread_lut.hpp.
27 {
28 0x00000000u, 0x01000000u, 0x00010000u, 0x01010000u,
29 0x00000100u, 0x01000100u, 0x00010100u, 0x01010100u,
30 0x00000001u, 0x01000001u, 0x00010001u, 0x01010001u,
31 0x00000101u, 0x01000101u, 0x00010101u, 0x01010101u,
32};
Referenced by spreadA(), and spreadB().