Re: [PATCH] Introduce a boolean "single_bit_set" function.

From: H. Peter Anvin
Date: Mon Jun 29 2009 - 14:51:17 EST


Petr Tesarik wrote:
>
> Ok, then my only concern is that the hweight* functions return the exact
> weight, which might be much less efficient if all we need is to know
> whether it's 1.
>
> Theoretically, gcc should be able to optimize things out, but I'm not
> all that optimistic about how well it does it.
>

I can almost guarantee it won't in this case.

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