The documentation says for BitScanReverse "Search the mask data from most significant bit (MSB) to least significant bit (LSB) for a set bit (1)", so it seems for me that it corresponds to count leading zeroes.
Hence this issue so that you can check that.
Arguably BitScanReverse is not a very good name, so it is easy to get confused!
Thanks for reporting this! I've started a feature internally to switch the two functions around. This issue will be closed automatically once that gets pushed.
Hello,
While googling for implementing clz in OCaml I stepped on your code and on the Microsoft documentation for the clz/ctz functions equivalent:
https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64?view=msvc-170
The documentation says for BitScanReverse "Search the mask data from most significant bit (MSB) to least significant bit (LSB) for a set bit (1)", so it seems for me that it corresponds to count leading zeroes.
Hence this issue so that you can check that.
Arguably BitScanReverse is not a very good name, so it is easy to get confused!
Bests Matthieu Lemerre