| ... | ... | @@ -58,32 +58,32 @@ in 8 registers `s0`, `s1`, … `s7`, the following |
|
|
|
|
|
|
|
```
|
|
|
|
// Transpose to 2 nybble streams
|
|
|
|
lo_nybble0 = hsimd::packl(s0, s1);
|
|
|
|
lo_nybble1 = hsimd::packl(s2, s3);
|
|
|
|
lo_nybble3 = hsimd::packl(s4, s5);
|
|
|
|
lo_nybble4 = hsimd::packl(s6, s7);
|
|
|
|
hi_nybble0 = hsimd::packh(s0, s1);
|
|
|
|
hi_nybble1 = hsimd::packh(s2, s3);
|
|
|
|
hi_nybble3 = hsimd::packh(s4, s5);
|
|
|
|
hi_nybble4 = hsimd::packh(s6, s7);
|
|
|
|
lo_nybble0 = hsimd::packl<8>(s0, s1);
|
|
|
|
lo_nybble1 = hsimd::packl<8>(s2, s3);
|
|
|
|
lo_nybble3 = hsimd::packl<8>(s4, s5);
|
|
|
|
lo_nybble4 = hsimd::packl<8>(s6, s7);
|
|
|
|
hi_nybble0 = hsimd::packh<8>(s0, s1);
|
|
|
|
hi_nybble1 = hsimd::packh<8>(s2, s3);
|
|
|
|
hi_nybble3 = hsimd::packh<8>(s4, s5);
|
|
|
|
hi_nybble4 = hsimd::packh<8>(s6, s7);
|
|
|
|
// Transpose 2 nybble streams to 4 bit-pair streams.
|
|
|
|
bit01pair_0 = hsimd::packl(lo_nybble0, lo_nybble1);
|
|
|
|
bit01pair_1 = hsimd::packl(lo_nybble2, lo_nybble3);
|
|
|
|
bit23pair_0 = hsimd::packh(lo_nybble0, lo_nybble1);
|
|
|
|
bit23pair_1 = hsimd::packh(lo_nybble2, lo_nybble3);
|
|
|
|
bit45pair_0 = hsimd::packl(hi_nybble0, hi_nybble1);
|
|
|
|
bit45pair_1 = hsimd::packl(hi_nybble2, hi_nybble3);
|
|
|
|
bit67pair_0 = hsimd::packh(hi_nybble0, hi_nybble1);
|
|
|
|
bit67pair_1 = hsimd::packh(hi_nybble2, hi_nybble3);
|
|
|
|
bit01pair_0 = hsimd::packl<4>(lo_nybble0, lo_nybble1);
|
|
|
|
bit01pair_1 = hsimd::packl<4>(lo_nybble2, lo_nybble3);
|
|
|
|
bit23pair_0 = hsimd::packh<4>(lo_nybble0, lo_nybble1);
|
|
|
|
bit23pair_1 = hsimd::packh<4>(lo_nybble2, lo_nybble3);
|
|
|
|
bit45pair_0 = hsimd::packl<4>(hi_nybble0, hi_nybble1);
|
|
|
|
bit45pair_1 = hsimd::packl<4>(hi_nybble2, hi_nybble3);
|
|
|
|
bit67pair_0 = hsimd::packh<4>(hi_nybble0, hi_nybble1);
|
|
|
|
bit67pair_1 = hsimd::packh<4>(hi_nybble2, hi_nybble3);
|
|
|
|
// Transpose 4 bit-pairs streams to 8 bit streams.
|
|
|
|
bit0 = hsimd::packl(bit01pair_0, bit01pair_1);
|
|
|
|
bit1 = hsimd::packh(bit01pair_0, bit01pair_1);
|
|
|
|
bit2 = hsimd::packl(bit23pair_0, bit23pair_1);
|
|
|
|
bit3 = hsimd::packh(bit23pair_0, bit23pair_1);
|
|
|
|
bit4 = hsimd::packl(bit45pair_0, bit45pair_1);
|
|
|
|
bit5 = hsimd::packh(bit45pair_0, bit45pair_1);
|
|
|
|
bit6 = hsimd::packl(bit67pair_0, bit67pair_1);
|
|
|
|
bit7 = hsimd::packh(bit67pair_0, bit67pair_1);
|
|
|
|
bit0 = hsimd::packl<2>(bit01pair_0, bit01pair_1);
|
|
|
|
bit1 = hsimd::packh<2>(bit01pair_0, bit01pair_1);
|
|
|
|
bit2 = hsimd::packl<2>(bit23pair_0, bit23pair_1);
|
|
|
|
bit3 = hsimd::packh<2>(bit23pair_0, bit23pair_1);
|
|
|
|
bit4 = hsimd::packl<2>(bit45pair_0, bit45pair_1);
|
|
|
|
bit5 = hsimd::packh<2>(bit45pair_0, bit45pair_1);
|
|
|
|
bit6 = hsimd::packl<2>(bit67pair_0, bit67pair_1);
|
|
|
|
bit7 = hsimd::packh<2>(bit67pair_0, bit67pair_1);
|
|
|
|
```
|
|
|
|
|
|
|
|
Overall, transposition requires 8 pack operations for each of the three transposition steps, for a total
|
| ... | ... | |