fix msvc clz

Reference issue

What does this implement/fix?

_BitScanReverse does not return the leading zeros. It returns the index of the first (MSB to LSB) set bit! _BitScanForward/ctz does the same thing.

For example: 0001000000010000. The number of leading zeros is 3. The index of the first set (MSB to LSB) bit is 12. 16-1-12 == 3. By contrast, the number of trailing zeros is 4. The index of the first set bit (LSB to MSB) is 4.

Clear as mud?

Additional information

Merge request reports

Loading