_bit_scan_reverse
Classification
Other, Bit Manipulation, CPUID Test: None
Header File
Instruction
BSR r32, r32
Synopsis
_bit_scan_reverse(int a);
Description
Set "dst" to the index of the highest set bit in 32-bit integer "a". If no bits are set in "a" then "dst" is undefined.
Operation
tmp := 31
IF a == 0
// dst is undefined
ELSE
DO WHILE ((tmp > 0) AND a[tmp] == 0)
tmp := tmp - 1
OD
FI
dst := tmp