Re: [RFC][PATCH] Faster generic_fls

From: Andrew Morton (akpm@digeo.com)
Date: Wed Apr 30 2003 - 15:55:12 EST


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/



This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:36 EST