Bit interleaving
- Insert m bits of zeros before every n bits of a register
- This essentially implements (-m+n)↑(l n)⍴x
- We can interleave two registers by m-to-n interleaving one, n-to-m interleaving and shifting the other, then or-ing them together
- Interleaving can be performed with BMI2's pdep instruction, which works like APL expand
- When BMI2 isn't available, there is a slower but still viable method using masks and shifts