4 ms·
There are a few good pages/books on this ("Bit Twiddling Hacks", and Henry Warren's Hacker's Delight). On my wishlist: updated versions of these for modern arc
by glangdale 9y ago
There are a few good pages/books on this ("Bit Twiddling Hacks", and Henry Warren's Hacker's Delight).
On my wishlist: updated versions of these for modern architectures and SIMD. Full disclosure: am Intel employee. That said, modern chips of all strips (x86, ARM64) all can do some amazing things with low-cost SIMD and bit-manipulation instructions. It would be interesting to see what smart folks come up with using these. Obviously you can make the 'bit extract' function really boring with PEXT, but what cool tricks can you do when you start with AVX2 and BMI1/2 as a baseline?