cpu features testing 32 vs 64 bit

Arnd Bergmann arnd at arndb.de
Fri Sep 9 08:36:39 EST 2005


On Freedag 09 September 2005 00:02, Kumar Gala wrote:
> 
> On Sep 8, 2005, at 4:48 PM, Dan Malek wrote:
> >
> > 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 <><




More information about the Linuxppc-embedded mailing list