Re: [RFC][PATCH] Faster generic_fls

Andrew Morton (akpm@digeo.com)
Wed, 30 Apr 2003 13:55:12 -0700


Daniel Phillips <dphillips@sistina.com> wrote:
>
> +static inline unsigned fls8(unsigned n)
> +{
> + return n & 0xf0?
> + n & 0xc0? (n >> 7) + 7: (n >> 5) + 5:
> + n & 0x0c? (n >> 3) + 3: n - ((n + 1) >> 2);
> +}

return fls_table[n];

That'll be faster in benchmarks, possibly slower in real world. As usual.

-
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/