Re: [RFC][PATCH] Faster generic_fls

Alan Cox (alan@lxorguk.ukuu.org.uk)
30 Apr 2003 21:25:50 +0100


On Mer, 2003-04-30 at 17:16, Linus Torvalds wrote:
> Clearly you're not going to make _one_ load to get fls, since having a
> 4GB lookup array for a 32-bit fls would be "somewhat" wasteful.

It ought to be basically the same as ffs because if I remember rightly

ffs(x^(x-1)) == fls(x)

Been a long time so I may have it wrong

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/