Commit 55ac540c by Andreas Krebbel Committed by Andreas Krebbel

S/390 Add -march/-mtune=z13 option.

gcc/
	* common/config/s390/s390-common.c (processor_flags_table): Add
	z13.
	* config.gcc: Add z13.
	* config/s390/s390-opts.h (enum processor_type): Add
	PROCESSOR_2964_Z13.
	* config/s390/s390.c (s390_adjust_priority): Check for
	PROCESSOR_2964_Z13.
	(s390_reorg): Likewise.
	(s390_sched_reorder): Likewise.
	(s390_sched_variable_issue): Likewise.
	(s390_loop_unroll_adjust): Likewise.
	(s390_option_override): Likewise. Default to -mvx when available.
	* config/s390/s390.h (enum processor_flags): Add PF_Z13 and PF_VX.
	(TARGET_CPU_Z13, TARGET_CPU_VX, TARGET_Z13, TARGET_VX)
	(TARGET_VX_ABI): Define macros.
	macros.
	(TARGET_DEFAULT): Add MASK_OPT_VX.
	* config/s390/s390.md ("cpu" attribute): Add z13.
	("cpu_facility" attribute): Add vec.
	* config/s390/s390.opt (processor_type): Add z13.
	(mvx): New options.
	* doc/invoke.texi: Add z13 option for -march.

From-SVN: r223393
parent 9e8ea2fc
2015-05-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com> 2015-05-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* common/config/s390/s390-common.c (processor_flags_table): Add
z13.
* config.gcc: Add z13.
* config/s390/s390-opts.h (enum processor_type): Add
PROCESSOR_2964_Z13.
* config/s390/s390.c (s390_adjust_priority): Check for
PROCESSOR_2964_Z13.
(s390_reorg): Likewise.
(s390_sched_reorder): Likewise.
(s390_sched_variable_issue): Likewise.
(s390_loop_unroll_adjust): Likewise.
(s390_option_override): Likewise. Default to -mvx when available.
* config/s390/s390.h (enum processor_flags): Add PF_Z13 and PF_VX.
(TARGET_CPU_Z13, TARGET_CPU_VX, TARGET_Z13, TARGET_VX)
(TARGET_VX_ABI): Define macros.
macros.
(TARGET_DEFAULT): Add MASK_OPT_VX.
* config/s390/s390.md ("cpu" attribute): Add z13.
("cpu_facility" attribute): Add vec.
* config/s390/s390.opt (processor_type): Add z13.
(mvx): New options.
* doc/invoke.texi: Add z13 option for -march.
2015-05-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/predicates.md (shift_count_or_setmem_operand): Add * config/s390/predicates.md (shift_count_or_setmem_operand): Add
mode check to make sure that only scalar integer values are mode check to make sure that only scalar integer values are
accepted. accepted.
......
...@@ -42,7 +42,10 @@ EXPORTED_CONST int processor_flags_table[] = ...@@ -42,7 +42,10 @@ EXPORTED_CONST int processor_flags_table[] =
/* z196 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT /* z196 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196, | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196,
/* zEC12 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT /* zEC12 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX,
/* z13 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
| PF_Z13 | PF_VX
}; };
/* Change optimizations to be performed, depending on the /* Change optimizations to be performed, depending on the
......
...@@ -4090,7 +4090,7 @@ case "${target}" in ...@@ -4090,7 +4090,7 @@ case "${target}" in
for which in arch tune; do for which in arch tune; do
eval "val=\$with_$which" eval "val=\$with_$which"
case ${val} in case ${val} in
"" | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12) "" | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13)
# OK # OK
;; ;;
*) *)
......
...@@ -35,6 +35,7 @@ enum processor_type ...@@ -35,6 +35,7 @@ enum processor_type
PROCESSOR_2097_Z10, PROCESSOR_2097_Z10,
PROCESSOR_2817_Z196, PROCESSOR_2817_Z196,
PROCESSOR_2827_ZEC12, PROCESSOR_2827_ZEC12,
PROCESSOR_2964_Z13,
PROCESSOR_max PROCESSOR_max
}; };
......
...@@ -5851,7 +5851,8 @@ s390_adjust_priority (rtx_insn *insn, int priority) ...@@ -5851,7 +5851,8 @@ s390_adjust_priority (rtx_insn *insn, int priority)
&& s390_tune != PROCESSOR_2094_Z9_109 && s390_tune != PROCESSOR_2094_Z9_109
&& s390_tune != PROCESSOR_2097_Z10 && s390_tune != PROCESSOR_2097_Z10
&& s390_tune != PROCESSOR_2817_Z196 && s390_tune != PROCESSOR_2817_Z196
&& s390_tune != PROCESSOR_2827_ZEC12) && s390_tune != PROCESSOR_2827_ZEC12
&& s390_tune != PROCESSOR_2964_Z13)
return priority; return priority;
switch (s390_safe_attr_type (insn)) switch (s390_safe_attr_type (insn))
...@@ -11455,7 +11456,8 @@ s390_reorg (void) ...@@ -11455,7 +11456,8 @@ s390_reorg (void)
/* Walk over the insns and do some >=z10 specific changes. */ /* Walk over the insns and do some >=z10 specific changes. */
if (s390_tune == PROCESSOR_2097_Z10 if (s390_tune == PROCESSOR_2097_Z10
|| s390_tune == PROCESSOR_2817_Z196 || s390_tune == PROCESSOR_2817_Z196
|| s390_tune == PROCESSOR_2827_ZEC12) || s390_tune == PROCESSOR_2827_ZEC12
|| s390_tune == PROCESSOR_2964_Z13)
{ {
rtx_insn *insn; rtx_insn *insn;
bool insn_added_p = false; bool insn_added_p = false;
...@@ -11704,7 +11706,8 @@ s390_sched_reorder (FILE *file, int verbose, ...@@ -11704,7 +11706,8 @@ s390_sched_reorder (FILE *file, int verbose,
if (reload_completed && *nreadyp > 1) if (reload_completed && *nreadyp > 1)
s390_z10_prevent_earlyload_conflicts (ready, nreadyp); s390_z10_prevent_earlyload_conflicts (ready, nreadyp);
if (s390_tune == PROCESSOR_2827_ZEC12 if ((s390_tune == PROCESSOR_2827_ZEC12
|| s390_tune == PROCESSOR_2964_Z13)
&& reload_completed && reload_completed
&& *nreadyp > 1) && *nreadyp > 1)
{ {
...@@ -11787,7 +11790,8 @@ s390_sched_variable_issue (FILE *file, int verbose, rtx_insn *insn, int more) ...@@ -11787,7 +11790,8 @@ s390_sched_variable_issue (FILE *file, int verbose, rtx_insn *insn, int more)
{ {
last_scheduled_insn = insn; last_scheduled_insn = insn;
if (s390_tune == PROCESSOR_2827_ZEC12 if ((s390_tune == PROCESSOR_2827_ZEC12
|| s390_tune == PROCESSOR_2964_Z13)
&& reload_completed && reload_completed
&& recog_memoized (insn) >= 0) && recog_memoized (insn) >= 0)
{ {
...@@ -11867,7 +11871,8 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop) ...@@ -11867,7 +11871,8 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
if (s390_tune != PROCESSOR_2097_Z10 if (s390_tune != PROCESSOR_2097_Z10
&& s390_tune != PROCESSOR_2817_Z196 && s390_tune != PROCESSOR_2817_Z196
&& s390_tune != PROCESSOR_2827_ZEC12) && s390_tune != PROCESSOR_2827_ZEC12
&& s390_tune != PROCESSOR_2964_Z13)
return nunroll; return nunroll;
/* Count the number of memory references within the loop body. */ /* Count the number of memory references within the loop body. */
...@@ -11998,6 +12003,22 @@ s390_option_override (void) ...@@ -11998,6 +12003,22 @@ s390_option_override (void)
if (!(target_flags_explicit & MASK_OPT_HTM) && TARGET_CPU_HTM && TARGET_ZARCH) if (!(target_flags_explicit & MASK_OPT_HTM) && TARGET_CPU_HTM && TARGET_ZARCH)
target_flags |= MASK_OPT_HTM; target_flags |= MASK_OPT_HTM;
if (target_flags_explicit & MASK_OPT_VX)
{
if (TARGET_OPT_VX)
{
if (!TARGET_CPU_VX)
error ("hardware vector support not available on %s",
s390_arch_string);
if (TARGET_SOFT_FLOAT)
error ("hardware vector support not available with -msoft-float");
}
}
else if (TARGET_CPU_VX)
/* Enable vector support if available and not explicitly disabled
by user. E.g. with -m31 -march=z13 -mzarch */
target_flags |= MASK_OPT_VX;
if (TARGET_HARD_DFP && !TARGET_DFP) if (TARGET_HARD_DFP && !TARGET_DFP)
{ {
if (target_flags_explicit & MASK_HARD_DFP) if (target_flags_explicit & MASK_HARD_DFP)
...@@ -12037,6 +12058,7 @@ s390_option_override (void) ...@@ -12037,6 +12058,7 @@ s390_option_override (void)
s390_cost = &z196_cost; s390_cost = &z196_cost;
break; break;
case PROCESSOR_2827_ZEC12: case PROCESSOR_2827_ZEC12:
case PROCESSOR_2964_Z13:
s390_cost = &zEC12_cost; s390_cost = &zEC12_cost;
break; break;
default: default:
...@@ -12064,7 +12086,8 @@ s390_option_override (void) ...@@ -12064,7 +12086,8 @@ s390_option_override (void)
if (s390_tune == PROCESSOR_2097_Z10 if (s390_tune == PROCESSOR_2097_Z10
|| s390_tune == PROCESSOR_2817_Z196 || s390_tune == PROCESSOR_2817_Z196
|| s390_tune == PROCESSOR_2827_ZEC12) || s390_tune == PROCESSOR_2827_ZEC12
|| s390_tune == PROCESSOR_2964_Z13)
{ {
maybe_set_param_value (PARAM_MAX_UNROLLED_INSNS, 100, maybe_set_param_value (PARAM_MAX_UNROLLED_INSNS, 100,
global_options.x_param_values, global_options.x_param_values,
......
...@@ -35,7 +35,9 @@ enum processor_flags ...@@ -35,7 +35,9 @@ enum processor_flags
PF_Z10 = 32, PF_Z10 = 32,
PF_Z196 = 64, PF_Z196 = 64,
PF_ZEC12 = 128, PF_ZEC12 = 128,
PF_TX = 256 PF_TX = 256,
PF_Z13 = 512,
PF_VX = 1024
}; };
/* This is necessary to avoid a warning about comparing different enum /* This is necessary to avoid a warning about comparing different enum
...@@ -64,6 +66,10 @@ enum processor_flags ...@@ -64,6 +66,10 @@ enum processor_flags
(s390_arch_flags & PF_ZEC12) (s390_arch_flags & PF_ZEC12)
#define TARGET_CPU_HTM \ #define TARGET_CPU_HTM \
(s390_arch_flags & PF_TX) (s390_arch_flags & PF_TX)
#define TARGET_CPU_Z13 \
(s390_arch_flags & PF_Z13)
#define TARGET_CPU_VX \
(s390_arch_flags & PF_VX)
/* These flags indicate that the generated code should run on a cpu /* These flags indicate that the generated code should run on a cpu
providing the respective hardware facility when run in providing the respective hardware facility when run in
...@@ -82,7 +88,15 @@ enum processor_flags ...@@ -82,7 +88,15 @@ enum processor_flags
#define TARGET_ZEC12 \ #define TARGET_ZEC12 \
(TARGET_ZARCH && TARGET_CPU_ZEC12) (TARGET_ZARCH && TARGET_CPU_ZEC12)
#define TARGET_HTM (TARGET_OPT_HTM) #define TARGET_HTM (TARGET_OPT_HTM)
#define TARGET_Z13 \
(TARGET_ZARCH && TARGET_CPU_Z13)
#define TARGET_VX \
(TARGET_ZARCH && TARGET_CPU_VX && TARGET_OPT_VX && TARGET_HARD_FLOAT)
/* Use the ABI introduced with IBM z13:
- pass vector arguments <= 16 bytes in VRs
- align *all* vector types to 8 bytes */
#define TARGET_VX_ABI TARGET_VX
#define TARGET_AVOID_CMP_AND_BRANCH (s390_tune == PROCESSOR_2817_Z196) #define TARGET_AVOID_CMP_AND_BRANCH (s390_tune == PROCESSOR_2817_Z196)
...@@ -115,7 +129,8 @@ enum processor_flags ...@@ -115,7 +129,8 @@ enum processor_flags
while (0) while (0)
#ifdef DEFAULT_TARGET_64BIT #ifdef DEFAULT_TARGET_64BIT
#define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP | MASK_OPT_HTM) #define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP \
| MASK_OPT_HTM | MASK_OPT_VX)
#else #else
#define TARGET_DEFAULT 0 #define TARGET_DEFAULT 0
#endif #endif
......
...@@ -324,11 +324,11 @@ ...@@ -324,11 +324,11 @@
;; distinguish between g5 and g6, but there are differences between the two ;; distinguish between g5 and g6, but there are differences between the two
;; CPUs could in theory be modeled. ;; CPUs could in theory be modeled.
(define_attr "cpu" "g5,g6,z900,z990,z9_109,z9_ec,z10,z196,zEC12" (define_attr "cpu" "g5,g6,z900,z990,z9_109,z9_ec,z10,z196,zEC12,z13"
(const (symbol_ref "s390_tune_attr"))) (const (symbol_ref "s390_tune_attr")))
(define_attr "cpu_facility" (define_attr "cpu_facility"
"standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12" "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vec"
(const_string "standard")) (const_string "standard"))
(define_attr "enabled" "" (define_attr "enabled" ""
...@@ -369,6 +369,10 @@ ...@@ -369,6 +369,10 @@
(and (eq_attr "cpu_facility" "zEC12") (and (eq_attr "cpu_facility" "zEC12")
(match_test "TARGET_ZEC12")) (match_test "TARGET_ZEC12"))
(const_int 1)
(and (eq_attr "cpu_facility" "vec")
(match_test "TARGET_VX"))
(const_int 1)] (const_int 1)]
(const_int 0))) (const_int 0)))
......
...@@ -76,6 +76,9 @@ Enum(processor_type) String(z196) Value(PROCESSOR_2817_Z196) ...@@ -76,6 +76,9 @@ Enum(processor_type) String(z196) Value(PROCESSOR_2817_Z196)
EnumValue EnumValue
Enum(processor_type) String(zEC12) Value(PROCESSOR_2827_ZEC12) Enum(processor_type) String(zEC12) Value(PROCESSOR_2827_ZEC12)
EnumValue
Enum(processor_type) String(z13) Value(PROCESSOR_2964_Z13)
mbackchain mbackchain
Target Report Mask(BACKCHAIN) Target Report Mask(BACKCHAIN)
Maintain backchain pointer Maintain backchain pointer
...@@ -118,6 +121,10 @@ mhtm ...@@ -118,6 +121,10 @@ mhtm
Target Report Mask(OPT_HTM) Target Report Mask(OPT_HTM)
Use hardware transactional execution instructions Use hardware transactional execution instructions
mvx
Target Report Mask(OPT_VX)
Use hardware vector facility instructions and enable the vector ABI
mpacked-stack mpacked-stack
Target Report Mask(PACKED_STACK) Target Report Mask(PACKED_STACK)
Use packed stack layout Use packed stack layout
......
...@@ -20450,7 +20450,8 @@ The default is to not print debug information. ...@@ -20450,7 +20450,8 @@ The default is to not print debug information.
Generate code that runs on @var{cpu-type}, which is the name of a system Generate code that runs on @var{cpu-type}, which is the name of a system
representing a certain processor type. Possible values for representing a certain processor type. Possible values for
@var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990}, @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
@samp{z9-109}, @samp{z9-ec}, @samp{z10}, @samp{z196}, and @samp{zEC12}. @samp{z9-109}, @samp{z9-ec}, @samp{z10}, @samp{z196}, @samp{zEC12},
and @samp{z13}.
When generating code using the instructions available on z/Architecture, When generating code using the instructions available on z/Architecture,
the default is @option{-march=z900}. Otherwise, the default is the default is @option{-march=z900}. Otherwise, the default is
@option{-march=g5}. @option{-march=g5}.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment