]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[POWERPC] add Kconfig option for optimizing for cell
authorArnd Bergmann <arnd@arndb.de>
Sat, 15 Sep 2007 00:21:57 +0000 (10:21 +1000)
committerPaul Mackerras <paulus@samba.org>
Sat, 22 Sep 2007 04:49:22 +0000 (14:49 +1000)
Since the PPE on cell is an in-order core, it suffers significantly
from wrong instruction scheduling.  This adds a Kconfig option that
enables passing -mtune=cell to gcc in order to generate object
code that runs well on cell.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/Makefile
arch/powerpc/platforms/Kconfig.cputype

index 6015a92bc2a0cc85635c74ff9c5d9d93b73fd9a0..87aff5372d6eeefa1e4825fb482b749563bffab9 100644 (file)
@@ -92,6 +92,10 @@ else
 endif
 endif
 
+ifeq ($(CONFIG_TUNE_CELL),y)
+       CFLAGS += $(call cc-option,-mtune=cell)
+endif
+
 # No AltiVec instruction when building kernel
 CFLAGS += $(call cc-option,-mno-altivec)
 
index 86eb4cf31f0b0ef667a7eb08cad1511acdc7abb5..4c315be250158fcfc1d1b24804f55ce76f137eb3 100644 (file)
@@ -71,6 +71,18 @@ config POWER4
        depends on PPC64
        def_bool y
 
+config TUNE_CELL
+       bool "Optimize for Cell Broadband Engine"
+       depends on PPC64
+       help
+         Cause the compiler to optimize for the PPE of the Cell Broadband
+         Engine. This will make the code run considerably faster on Cell
+         but somewhat slower on other machines. This option only changes
+         the scheduling of instructions, not the selection of instructions
+         itself, so the resulting kernel will keep running on all other
+         machines. When building a kernel that is supposed to run only
+         on Cell, you should also select the POWER4_ONLY option.
+
 config 6xx
        bool