As the name implies, if a 256-bit SIMD register:
0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 |
How can I effectively get the index of the first non-zero element (i.e. the index of the 2first 1)? The easiest way is to store in memory and check one by one, but it can cost a lot. Are there any nice ideas for this?
source
share