linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* cpu features testing 32 vs 64 bit
@ 2005-09-08 21:02 Becky Bruce
  2005-09-08 21:08 ` Pantelis Antoniou
  0 siblings, 1 reply; 18+ messages in thread
From: Becky Bruce @ 2005-09-08 21:02 UTC (permalink / raw)
  To: linuxppc64-dev, linuxppc-embedded, linuxppc-dev

So,

in include/asm-ppc64/cacheflush.h is the following:

static inline void flush_icache_range(unsigned long start, unsigned 
long stop)
{
         if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
                 __flush_icache_range(start, stop);
}

On the 32-bit side, we don't need the feature test - 
CPU_FTR_COHERENT_CACHE is only defined in 64-bit land, and has bits set 
in the upper 32.

There's a couple of ways to deal with merging this:

1) The ever-so-popular #ifdef __powerpc64__around the cpu_has_feature 
test
2) No ifdef in the code itself, but #define CPU_FTR_WHATEVER to be 0 
when !__powerpc64__ in cputable.h so that the cpu_has_feature test will 
always fail for 32-bit.

I'd like to get some opinions on this.  Do folks feel like the 
performance hit of doing the compare is enough to justify going with 
method 1?  Should we be using likely/unlikely with the feature test?

This is just one code example - I suspect there will be others as we 
continue the merge, and the importance of performance may differ 
depending on where in the code we are.

Thanks!
-B

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-09-17  0:36 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08 21:02 cpu features testing 32 vs 64 bit Becky Bruce
2005-09-08 21:08 ` Pantelis Antoniou
2005-09-08 21:20   ` Kumar Gala
2005-09-08 21:48     ` Dan Malek
2005-09-08 22:02       ` Kumar Gala
2005-09-08 22:20         ` Dan Malek
2005-09-08 22:36         ` Arnd Bergmann
2005-09-09  0:08           ` David Gibson
2005-09-09  4:23           ` [PATCH] powerpc: merge include/asm/cputable.h Arnd Bergmann
2005-09-14 19:11             ` Kumar Gala
2005-09-14 23:58               ` Arnd Bergmann
2005-09-15 17:44                 ` Kumar Gala
2005-09-15 22:56                   ` Arnd Bergmann
2005-09-16  2:22                     ` Kumar Gala
2005-09-16  3:11                       ` Arnd Bergmann
2005-09-16 21:40                         ` Kumar Gala
2005-09-17  0:36                           ` Arnd Bergmann
2005-09-09 22:19     ` cpu features testing 32 vs 64 bit Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).