Kevin Diggs wrote:
Hi,

x86 has bsf and bsr. PPC has cntlzw which I think is equivalent to bsr. Anyone know of a sneaky algorithm to do bsf?

wordsize - 1 - cntlzw(x & ~(x - 1));

-Scott
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to