Re: [PATCH] x86: always_inline wrapper for x86's test_bit

From: Andi Kleen
Date: Sun Apr 13 2008 - 12:59:53 EST


Alexander van Heukelum <heukelum@xxxxxxxxxxxxx> writes:

> On x86, test_bit is currently implemented as a preprocessor macro. It
> uses gcc's __builtin_constant_p to determine if the bit position is
> known at compile time and defers to one of two functions depending
> on that. This changes the same logic to an __always_inline wrapper
> instead.

Some old gccs didn't support __builtin_constant_p in inline properly,
that is why it was always written in macros.

Please double check with the oldest still supported gcc (3.2) if it
really generates the expected code for the constant/non constant case.

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