All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] add Kconfig option for optimizing for cell
Date: Sat, 15 Sep 2007 02:21:57 +0200	[thread overview]
Message-ID: <200709150221.57825.arnd@arndb.de> (raw)

Since the PPE on cell is an in-order core, it suffers significantly
from wrong instruction scheduling. This adds an 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>
---
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6015a92..87aff53 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -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)
 
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 86eb4cf..4c315be 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -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
 

             reply	other threads:[~2007-09-15  0:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-15  0:21 Arnd Bergmann [this message]
2007-09-14 23:07 ` [PATCH] add Kconfig option for optimizing for cell Josh Boyer
2007-09-15  1:02   ` Arnd Bergmann
2007-09-14 23:36     ` Josh Boyer
2007-09-15  0:50 ` Segher Boessenkool
2007-09-15  1:02   ` Arnd Bergmann
2007-09-15 13:13 ` David Woodhouse
2007-09-15 13:30   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200709150221.57825.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.