I\'m a bit confused about both instructions. First let\'s discard the special case when the scanned value is 0 and the undefined/bsr or bitsize/lzcnt result - this difference is
LZCNT
gives the number of leading zero bits. BSR
gives the bit index of the most significant 1 bit. So they do effectively the same thing for the non-zero case, except the result is interpreted differently. Therefore you can just subtract the BSR
result from 31 to get the same behaviour as with LZCNT
, i.e. LZCNT == (31 - BSR)
.