What’s a fast way to space-out bits within a word?
This is known as Morton number, which is a specific case of parallel expand which is in turn the reverse of compress right in the following questions What’s the fastest way to pack 32 0/1 values into the bits of a single 32-bit variable? Shift masked bits to the lsb One general solution might be … Read more