Thread (18 messages) flat view 18 messages, 7 authors, 2005-09-17

Re: cpu features testing 32 vs 64 bit

From: Arnd Bergmann <arnd@arndb.de>
Date: 2005-09-08 22:36:39

On Freedag 09 September 2005 00:02, Kumar Gala wrote:
On Sep 8, 2005, at 4:48 PM, Dan Malek wrote:
quoted
If we #define CPU_FTR_xxx as a 0 or all 1's for processors that have
or don't have these features, will the compiler be smart enough to
recognize an always true or false condition and remove the
test (or code as appropriate)?
The compiler is smart enough in this case since cpu_has_feature() is  
an inline function.
I actually wrote a patch that solves the problem in a very generic way,
see http://patchwork.ozlabs.org/linuxppc/patch?id=1048 .
I don't remember exactly if there were serious objections against
the patch at that time, but it looks like a much cleaner solution to me
than defining CPU_FTR_xxx to different values depending on the
configuration.

	Arnd <><
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help