Alexander van Heukelum writes: > Powerpc would pick up an optimized version via this chain: generic fls64 > -> > powerpc __fls --> __ilog2 --> asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" > (x)).
Why wouldn't powerpc continue to use the fls64 that I have in there now? > However, the generic version of fls64 first tests the argument for zero. > From > your code I derive that the count-leading-zeroes instruction for > argument zero > is defined as cntlzl(0) == BITS_PER_LONG. That is correct. If the argument is 0 then all of the zero bits are leading zeroes. :) Regards, Paul. _______________________________________________ Linuxppc-dev mailing list [email protected] https://ozlabs.org/mailman/listinfo/linuxppc-dev
