3 ms·
This is indeed fast and simple, since the pshufb instruction allows unpacking of bytes into multiple zero-padded words in one step. This technique uses a preco
by kwillets 9y ago
This is indeed fast and simple, since the pshufb instruction allows unpacking of bytes into multiple zero-padded words in one step. This technique uses a precomputed table of shuffle patterns, so it's a short sequence of instructions to fetch control information for each 4-word sequence and apply the shuffle given.