News for hackers. Stuff that matters.
Re:Bit Twiddling Hacks (2005) by jhallenworld on Sunday July 03, 2016 @10:03PM (#12028572)
My favorite is the elementary x&-x (isolate least significant set bit). This is basically a priority arbiter using the carry chain, and in hardware (HDL), since the carry chain is already heavily optimized, is faster than priority arbiters using basic gates.

Next favorite is "compress selected bits", because I figured out the inverse, which Henry Warren then published as "expand" in the 2nd edition: http://www.hackersdelight.org/hdcodetxt/expand.c.txt

There are no comments on this comment yet.