If you enjoy these bit twiddling hacks, I recommend "Hacker's Delight," by Henry Warren.<p>Author's website: <a href="http://www.hackersdelight.org" rel="nofollow">http://www.hackersdelight.org</a><p>2nd edition on Amazon: <a href="https://www.amazon.com/Hackers-Delight-2nd-Henry-Warren/dp/0321842685" rel="nofollow">https://www.amazon.com/Hackers-Delight-2nd-Henry-Warren/dp/0...</a>
A perennial: <a href="https://hn.algolia.com/?query=Bit%20Twiddling%20Hacks&sort=byDate&dateRange=all&type=story&storyText=false&prefix&page=0" rel="nofollow">https://hn.algolia.com/?query=Bit%20Twiddling%20Hacks&sort=b...</a>
My favourite bit twiddling hacks:<p>Bitwise parallel "SIMD within a register" Life, by Thomas Rokicki: <a href="https://fanf.livejournal.com/93032.html" rel="nofollow">https://fanf.livejournal.com/93032.html</a><p>Popcount for radix trees, as seen in Phil Bagwell's HAMTs and my qp tries: <a href="https://dotat.at/prog/qp/README.html" rel="nofollow">https://dotat.at/prog/qp/README.html</a>