Doing it by table lookup results in questions such as "am I wasting too much cache space on this?" and "is a 64K table causing cache misses".
Here are a few of the scalar intrinsics for bit counting.
popcnt() - population count leadz() - leading zero trailz() - trailing zero poppar() - parity
Edited to fix formatting.
TFTFY :-)
Doing it by table lookup results in questions such as "am I wasting too much cache space on this?" and "is a 64K table causing cache misses".