zoo
zoo copied to clipboard
Plural right shift
Now is correct. Godbolt for your amusement. https://godbolt.org/z/T51GPhT8M
Generate the smallest mask required to blit out the overflow using (2^shift_size - 1) which basially transforms shift size into a tally representation of itself in binary. Such that 2 -> 11; 3 -> 111; 4 -> 1111; etc. This then only requires the lane index mask and a shift, then or'ing it all back into the result.