Skip to content

Commit 1db9e05

Browse files
heicarstMartin Schwidefsky
authored andcommitted
s390: allow to set gcc -mtune flag
Add a new Kconfig choice group which allows to configure how gcc should tune the generated code (via -mtune option). By default the -mtune parameter will match the -march parameter. This is a rather large patch, but I wouldn't know how to make this shorter unfortunately. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent b226635 commit 1db9e05

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

arch/s390/Kconfig

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,67 @@ config MARCH_ZEC12
238238

239239
endchoice
240240

241+
config MARCH_G5_TUNE
242+
def_bool TUNE_G5 || MARCH_G5 && TUNE_DEFAULT
243+
244+
config MARCH_Z900_TUNE
245+
def_bool TUNE_Z900 || MARCH_Z900 && TUNE_DEFAULT
246+
247+
config MARCH_Z990_TUNE
248+
def_bool TUNE_Z990 || MARCH_Z990 && TUNE_DEFAULT
249+
250+
config MARCH_Z9_109_TUNE
251+
def_bool TUNE_Z9_109 || MARCH_Z9_109 && TUNE_DEFAULT
252+
253+
config MARCH_Z10_TUNE
254+
def_bool TUNE_Z10 || MARCH_Z10 && TUNE_DEFAULT
255+
256+
config MARCH_Z196_TUNE
257+
def_bool TUNE_Z196 || MARCH_Z196 && TUNE_DEFAULT
258+
259+
config MARCH_ZEC12_TUNE
260+
def_bool TUNE_ZEC12 || MARCH_ZEC12 && TUNE_DEFAULT
261+
262+
choice
263+
prompt "Tune code generation"
264+
default TUNE_DEFAULT
265+
help
266+
Cause the compiler to tune (-mtune) the generated code for a machine.
267+
This will make the code run faster on the selected machine but
268+
somewhat slower on other machines.
269+
This option only changes how the compiler emits instructions, not the
270+
selection of instructions itself, so the resulting kernel will run on
271+
all other machines.
272+
273+
config TUNE_DEFAULT
274+
bool "Default"
275+
help
276+
Tune the generated code for the target processor for which the kernel
277+
will be compiled.
278+
279+
config TUNE_G5
280+
bool "System/390 model G5 and G6"
281+
282+
config TUNE_Z900
283+
bool "IBM zSeries model z800 and z900"
284+
285+
config TUNE_Z990
286+
bool "IBM zSeries model z890 and z990"
287+
288+
config TUNE_Z9_109
289+
bool "IBM System z9"
290+
291+
config TUNE_Z10
292+
bool "IBM System z10"
293+
294+
config TUNE_Z196
295+
bool "IBM zEnterprise 114 and 196"
296+
297+
config TUNE_ZEC12
298+
bool "IBM zBC12 and zEC12"
299+
300+
endchoice
301+
241302
config 64BIT
242303
def_bool y
243304
prompt "64 bit kernel"

arch/s390/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ cflags-$(CONFIG_MARCH_Z10) += -march=z10
4343
cflags-$(CONFIG_MARCH_Z196) += -march=z196
4444
cflags-$(CONFIG_MARCH_ZEC12) += -march=zEC12
4545

46+
cflags-$(CONFIG_MARCH_G5_TUNE) += -mtune=g5
47+
cflags-$(CONFIG_MARCH_Z900_TUNE) += -mtune=z900
48+
cflags-$(CONFIG_MARCH_Z990_TUNE) += -mtune=z990
49+
cflags-$(CONFIG_MARCH_Z9_109_TUNE) += -mtune=z9-109
50+
cflags-$(CONFIG_MARCH_Z10_TUNE) += -mtune=z10
51+
cflags-$(CONFIG_MARCH_Z196_TUNE) += -mtune=z196
52+
cflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12
53+
4654
#KBUILD_IMAGE is necessary for make rpm
4755
KBUILD_IMAGE :=arch/s390/boot/image
4856

0 commit comments

Comments
 (0)