Skip to content

Commit

Permalink
s390: Allow to compile with z17 optimizations
Browse files Browse the repository at this point in the history
Add config and compile options which allow to compile with z17
optimizations if the compiler supports it. Add the
miscellaneous-instruction-extension 4 facility to the list of facilities
for z17.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
  • Loading branch information
Vasily Gorbik authored and Heiko Carstens committed Apr 9, 2025
1 parent 8231a0e commit c51ea98
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ config HAVE_MARCH_Z16_FEATURES
def_bool n
select HAVE_MARCH_Z15_FEATURES

config HAVE_MARCH_Z17_FEATURES
def_bool n
select HAVE_MARCH_Z16_FEATURES

choice
prompt "Processor type"
default MARCH_Z196
Expand Down Expand Up @@ -397,6 +401,14 @@ config MARCH_Z16
Select this to enable optimizations for IBM z16 (3931 and
3932 series).

config MARCH_Z17
bool "IBM z17"
select HAVE_MARCH_Z17_FEATURES
depends on $(cc-option,-march=z17)
help
Select this to enable optimizations for IBM z17 (9175 and
9176 series).

endchoice

config MARCH_Z10_TUNE
Expand All @@ -420,6 +432,9 @@ config MARCH_Z15_TUNE
config MARCH_Z16_TUNE
def_bool TUNE_Z16 || MARCH_Z16 && TUNE_DEFAULT

config MARCH_Z17_TUNE
def_bool TUNE_Z17 || MARCH_Z17 && TUNE_DEFAULT

choice
prompt "Tune code generation"
default TUNE_DEFAULT
Expand Down Expand Up @@ -464,6 +479,10 @@ config TUNE_Z16
bool "IBM z16"
depends on $(cc-option,-mtune=z16)

config TUNE_Z17
bool "IBM z17"
depends on $(cc-option,-mtune=z17)

endchoice

config 64BIT
Expand Down
2 changes: 2 additions & 0 deletions arch/s390/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ mflags-$(CONFIG_MARCH_Z13) := -march=z13
mflags-$(CONFIG_MARCH_Z14) := -march=z14
mflags-$(CONFIG_MARCH_Z15) := -march=z15
mflags-$(CONFIG_MARCH_Z16) := -march=z16
mflags-$(CONFIG_MARCH_Z17) := -march=z17

export CC_FLAGS_MARCH := $(mflags-y)

Expand All @@ -61,6 +62,7 @@ cflags-$(CONFIG_MARCH_Z13_TUNE) += -mtune=z13
cflags-$(CONFIG_MARCH_Z14_TUNE) += -mtune=z14
cflags-$(CONFIG_MARCH_Z15_TUNE) += -mtune=z15
cflags-$(CONFIG_MARCH_Z16_TUNE) += -mtune=z16
cflags-$(CONFIG_MARCH_Z17_TUNE) += -mtune=z17

cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include

Expand Down
4 changes: 4 additions & 0 deletions arch/s390/include/asm/march.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#define MARCH_HAS_Z16_FEATURES 1
#endif

#ifdef CONFIG_HAVE_MARCH_Z17_FEATURES
#define MARCH_HAS_Z17_FEATURES 1
#endif

#endif /* __DECOMPRESSOR */

#endif /* __ASM_S390_MARCH_H */
3 changes: 3 additions & 0 deletions arch/s390/tools/gen_facilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ static struct facility_def facility_defs[] = {
#endif
#ifdef CONFIG_HAVE_MARCH_Z15_FEATURES
61, /* miscellaneous-instruction-extension 3 */
#endif
#ifdef CONFIG_HAVE_MARCH_Z17_FEATURES
84, /* miscellaneous-instruction-extension 4 */
#endif
-1 /* END */
}
Expand Down

0 comments on commit c51ea98

Please sign in to comment.