And especially to Marco,
because you have an Intel-Machine, the branchless version
may be significantly faster. Perhaps you want to have a try ?
Code: Select all
ULONG bsf64(BTB_T bb)
{
ULONG id; //=64 to have 64 as return value
_BitScanForward(&id,(UI_32)(bb>>32));
id+=32;
_BitScanForward(&id,(UI_32)bb);
return(id);
}