31 using CanonicalShuffleList =
32 std::array<std::pair<const ShuffleArray, const CanonicalShuffle>,
35 static constexpr CanonicalShuffleList canonical_shuffle_list = {{
60 {{7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8},
62 {{3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12},
64 {{1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14},
66 {{0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23},
68 {{8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31},
70 {{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30},
72 {{1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31},
74 {{0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30},
76 {{1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31},
79 for (
auto& [lanes, canonical] : canonical_shuffle_list) {
80 if (std::equal(lanes.begin(), lanes.end(), shuffle.begin())) {
158 uint8_t* shuffle64x2) {
159 constexpr std::array<std::array<uint8_t, 8>, 4> element_patterns = {
160 {{0, 1, 2, 3, 4, 5, 6, 7},
161 {8, 9, 10, 11, 12, 13, 14, 15},
162 {16, 17, 18, 19, 20, 21, 22, 23},
163 {24, 25, 26, 27, 28, 29, 30, 31}}};
165 for (
unsigned i = 0;
i < 2; ++
i) {
166 uint64_t element = *
reinterpret_cast<const uint64_t*
>(&shuffle[
i * 8]);
167 for (
unsigned j = 0; j < 4; ++j) {
169 *
reinterpret_cast<const uint64_t*
>(element_patterns[j].data());