Granted, figuring out where to add that dot is quite important but rather non-trivial, and if x86 actually had such it'd be much more readable.
Granted, figuring out where to add that dot is quite important but rather non-trivial, and if x86 actually had such it'd be much more readable.
and-scan (2 instrs with andn): v &~ (v+1)
seg-and-scan (4 instrs with andn): t = (v &~ m) >> 1; (v - t) ^ t
and-scan (2 instrs with andn): v &~ (v+1)
seg-and-scan (4 instrs with andn): t = (v &~ m) >> 1; (v - t) ^ t