PowerPC G5, 64-bit long long, bit counting and inline assembler...

Eljay Love-Jensen eljay@adobe.com
Fri Oct 10 11:58:00 GMT 2003


Hi Gordon,

Another solution that may-or-may-not be better (profile to find out) is to do a 2048 sized (11-bit) lookup table and use 3 lookups.  Or 6 lookups for a 64-bit number.

Another solution is the "divide-and-conquer" folding bit-twiddling method.

Note, there is a couple of shortcomings on the "x & (x-1)" trick.  I presume you are aware of those shortcomings.

HTH,
--Eljay




More information about the Gcc-help mailing list