config.gcc: Added z9-109 switch.

2005-08-16  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
	    Andreas Krebbel  <krebbel1@de.ibm.com>

	* config.gcc: Added z9-109 switch.
	* config/s390/2084.md ("x_int", "x_agen", "x_lr", "x_la", "x_larl",
	"x_load", "x_store", "x_branch", "x_call", "x_mul_hi", "x_mul_sidi",
	"x_div", "x_sem", "x_cs", "x_vs", "x_stm", "x_lm", "x_other",
	"x_fsimpdf", "x_fsimpsf", "x_fdivdf", "x_fdivsf", "x_floaddf",
	"x_floadsf", "x_fstore_df", "x_fstoresf", "x_ftoi", "x_itof"): Enable
	for "z9_109" cpu attribute.
	* config/s390/s390.c (z9_109_cost): New processor cost structure.
	(CONST_OK_FOR_Os, CONST_OK_FOR_Op, CONST_OK_FOR_On): New macros.
	(s390_handle_arch_option): Added z9-109 switch.
	(override_options): Set respective cost function for z9-109.
	(s390_const_ok_for_constraint_p): New constraints Os, Op, On.
	(legitimate_reload_constant_p): Accept extended immediates.
	(print_operand): Three new output modifiers added: k, m and o.
	(s390_adjust_priority, s390_issue_rate): Handle Z9_109 like Z990.
	(s390_output_mi_thunk): Use extended immediate when possible.
	* config/s390/s390.h (processor_flags): Added PF_EXTIMM.
	(TARGET_CPU_EXTIMM, TARGET_EXTIMM): New macros.
	(CONSTRAINT_LEN): Added length of O constraint.
	(CLZ_DEFINED_VALUE_AT_ZERO): Definition added.
	* config/s390/s390.md ("cpu"): New value z9_109 added.
	("*tstdi_extimm", "*tstdi_ccconly_extimm", "*tstsi_extimm",
	"*tstsi_cconly_extimm", "*movdi_64extimm", "*extendhidi2_extimm",
	"*extendqidi2_extimm", "*extendhisi2_extimm", "*extendqisi2_extimm",
	"*zero_extend<mode>si2_extimm", "*anddi3_extimm", "*iordi3_extimm",
	"*xordi3_extimm", "clzdi2", "clztidi2"): New patterns.
	("*tstdi", "*tstsi", "*movdi_64", "*extendhisi2", "*extendqisi2",
	"*zero_extend<mode>si2_64", "zero_extendqihi2", "*zero_extendqihi2_64",
	"*anddi3", "*iordi3", "*xordi3"): Disable for TARGET_EXTIMM.
	("*cmpdi_cct", "*cmpsi_cct", "*cmpdi_ccs", "*cmpsi_ccs", "*cmpdi_ccu",
	"*cmpsi_ccu", "*movsi_zarch", "*adddi3_imm_cc", "*adddi3_carry1_cc",
	"*adddi3_carry2_cc", "*adddi3_cc", "*adddi3_64", "*addsi3_imm_cc",
	"*addsi3_carry1_cc", "*addsi3_carry2_cc", "*addsi3_cc", "addsi3",
	"*andsi3_cc", "*andsi3_cconly", "*andsi3_zarch", "*iorsi3_cc",
	"*iorsi3_cconly", "*iorsi3_zarch", "*xorsi3_cc", "*xorsi3_cconly",
	"*xorsi3", "*xorhi3", "*xorqi3"): Added instruction using extended
	immediates.
	("extend<mode>di2", "extend<mode>si2", "zero_extend<mode>di2",
	"zero_extend<mode>si2"): Allow memory operands and don't manually emit
	insns for TARGET_EXTIMM.

From-SVN: r103211
This commit is contained in:
Ulrich Weigand 2005-08-17 11:11:05 +00:00 committed by Andreas Krebbel
parent 33d2e547c2
commit ec24698eaa
5 changed files with 578 additions and 203 deletions

View File

@ -2657,7 +2657,7 @@ case "${target}" in
for which in arch tune; do
eval "val=\$with_$which"
case ${val} in
"" | g5 | g6 | z900 | z990)
"" | g5 | g6 | z900 | z990 | z9-109)
# OK
;;
*)

View File

@ -62,69 +62,69 @@
;;
(define_insn_reservation "x_int" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(and (eq_attr "type" "integer")
(eq_attr "atype" "reg")))
"x-e1-st,x-wr-st")
(define_insn_reservation "x_agen" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(and (eq_attr "type" "integer")
(eq_attr "atype" "agen")))
"x-e1-st,x-wr-st")
(define_insn_reservation "x_lr" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "lr"))
"x-e1-st,x-wr-st")
(define_insn_reservation "x_la" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "la"))
"x-e1-st,x-wr-st")
(define_insn_reservation "x_larl" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "larl"))
"x-e1-st,x-wr-st")
(define_insn_reservation "x_load" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "load"))
"x-e1-st+x-mem,x-wr-st")
(define_insn_reservation "x_store" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "store"))
"x-e1-st+x_store_tok,x-wr-st")
(define_insn_reservation "x_branch" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "branch"))
"x_e1_r,x_wr_r")
(define_insn_reservation "x_call" 5
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "jsr"))
"x-e1-np*5,x-wr-np")
(define_insn_reservation "x_mul_hi" 2
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "imulhi"))
"x-e1-np*2,x-wr-np")
(define_insn_reservation "x_mul_sidi" 4
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "imulsi,imuldi"))
"x-e1-np*4,x-wr-np")
(define_insn_reservation "x_div" 10
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "idiv"))
"x-e1-np*10,x-wr-np")
(define_insn_reservation "x_sem" 17
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "sem"))
"x-e1-np+x-mem,x-e1-np*16,x-wr-st")
@ -133,27 +133,27 @@
;;
(define_insn_reservation "x_cs" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "cs"))
"x-e1-np,x-wr-np")
(define_insn_reservation "x_vs" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "vs"))
"x-e1-np*10,x-wr-np")
(define_insn_reservation "x_stm" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "stm"))
"(x-e1-np+x_store_tok)*10,x-wr-np")
(define_insn_reservation "x_lm" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "lm"))
"x-e1-np*10,x-wr-np")
(define_insn_reservation "x_other" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "other"))
"x-e1-np,x-wr-np")
@ -162,52 +162,52 @@
;;
(define_insn_reservation "x_fsimpdf" 6
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "fsimpdf,fmuldf"))
"x_e1_t,x-wr-fp")
(define_insn_reservation "x_fsimpsf" 6
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "fsimpsf,fmulsf"))
"x_e1_t,x-wr-fp")
(define_insn_reservation "x_fdivdf" 36
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "fdivdf,fsqrtdf"))
"x_e1_t*30,x-wr-fp")
(define_insn_reservation "x_fdivsf" 36
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "fdivsf,fsqrtsf"))
"x_e1_t*30,x-wr-fp")
(define_insn_reservation "x_floaddf" 6
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "floaddf"))
"x_e1_t,x-wr-fp")
(define_insn_reservation "x_floadsf" 6
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "floadsf"))
"x_e1_t,x-wr-fp")
(define_insn_reservation "x_fstoredf" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "fstoredf"))
"x_e1_t,x-wr-fp")
(define_insn_reservation "x_fstoresf" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "fstoresf"))
"x_e1_t,x-wr-fp")
(define_insn_reservation "x_ftoi" 1
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "ftoi"))
"x_e1_t*3,x-wr-fp")
(define_insn_reservation "x_itof" 7
(and (eq_attr "cpu" "z990")
(and (eq_attr "cpu" "z990,z9_109")
(eq_attr "type" "itof"))
"x_e1_t*3,x-wr-fp")

View File

@ -153,6 +153,36 @@ struct processor_costs z990_cost =
COSTS_N_INSNS (31), /* DSGR */
};
static const
struct processor_costs z9_109_cost =
{
COSTS_N_INSNS (4), /* M */
COSTS_N_INSNS (2), /* MGHI */
COSTS_N_INSNS (2), /* MH */
COSTS_N_INSNS (2), /* MHI */
COSTS_N_INSNS (4), /* ML */
COSTS_N_INSNS (4), /* MR */
COSTS_N_INSNS (5), /* MS */
COSTS_N_INSNS (6), /* MSG */
COSTS_N_INSNS (4), /* MSGF */
COSTS_N_INSNS (4), /* MSGFR */
COSTS_N_INSNS (4), /* MSGR */
COSTS_N_INSNS (4), /* MSR */
COSTS_N_INSNS (1), /* multiplication in DFmode */
COSTS_N_INSNS (66), /* SQDBR */
COSTS_N_INSNS (38), /* SQEBR */
COSTS_N_INSNS (1), /* MADBR */
COSTS_N_INSNS (1), /* MAEBR */
COSTS_N_INSNS (40), /* DDBR */
COSTS_N_INSNS (37), /* DDR */
COSTS_N_INSNS (26), /* DDBR */
COSTS_N_INSNS (28), /* DER */
COSTS_N_INSNS (30), /* DLGR */
COSTS_N_INSNS (23), /* DLR */
COSTS_N_INSNS (23), /* DR */
COSTS_N_INSNS (24), /* DSGFR */
COSTS_N_INSNS (24), /* DSGR */
};
extern int reload_completed;
@ -272,6 +302,12 @@ struct machine_function GTY(())
CONST_OK_FOR_CONSTRAINT_P((x), 'J', "J")
#define CONST_OK_FOR_K(x) \
CONST_OK_FOR_CONSTRAINT_P((x), 'K', "K")
#define CONST_OK_FOR_Os(x) \
CONST_OK_FOR_CONSTRAINT_P((x), 'O', "Os")
#define CONST_OK_FOR_Op(x) \
CONST_OK_FOR_CONSTRAINT_P((x), 'O', "Op")
#define CONST_OK_FOR_On(x) \
CONST_OK_FOR_CONSTRAINT_P((x), 'O', "On")
/* Set the has_landing_pad_p flag in struct machine_function to VALUE. */
@ -1207,6 +1243,8 @@ s390_handle_arch_option (const char *arg,
{"z900", PROCESSOR_2064_Z900, PF_IEEE_FLOAT | PF_ZARCH},
{"z990", PROCESSOR_2084_Z990, PF_IEEE_FLOAT | PF_ZARCH
| PF_LONG_DISPLACEMENT},
{"z9-109", PROCESSOR_2094_Z9_109, PF_IEEE_FLOAT | PF_ZARCH
| PF_LONG_DISPLACEMENT | PF_EXTIMM},
};
size_t i;
@ -1293,14 +1331,14 @@ override_options (void)
if (TARGET_64BIT && !TARGET_ZARCH)
error ("64-bit ABI not supported in ESA/390 mode");
/* Set processor cost function. */
if (s390_tune == PROCESSOR_2084_Z990)
if (s390_tune == PROCESSOR_2094_Z9_109)
s390_cost = &z9_109_cost;
else if (s390_tune == PROCESSOR_2084_Z990)
s390_cost = &z990_cost;
else
s390_cost = &z900_cost;
if (TARGET_BACKCHAIN && TARGET_PACKED_STACK && TARGET_HARD_FLOAT)
error ("-mbackchain -mpacked-stack -mhard-float are not supported "
"in combination");
@ -1876,6 +1914,28 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value,
break;
case 'O':
if (!TARGET_EXTIMM)
return 0;
switch (str[1])
{
case 's':
return trunc_int_for_mode (value, SImode) == value;
case 'p':
return value == 0
|| s390_single_part (GEN_INT (value), DImode, SImode, 0) == 1;
case 'n':
return value == -1
|| s390_single_part (GEN_INT (value), DImode, SImode, -1) == 1;
default:
gcc_unreachable ();
}
break;
case 'P':
return legitimate_reload_constant_p (GEN_INT (value));
@ -2307,9 +2367,9 @@ legitimate_reload_constant_p (rtx op)
&& DISP_IN_RANGE (INTVAL (op)))
return true;
/* Accept l(g)hi operands. */
/* Accept l(g)hi/l(g)fi operands. */
if (GET_CODE (op) == CONST_INT
&& CONST_OK_FOR_K (INTVAL (op)))
&& (CONST_OK_FOR_K (INTVAL (op)) || CONST_OK_FOR_Os (INTVAL (op))))
return true;
/* Accept lliXX operands. */
@ -2319,6 +2379,12 @@ legitimate_reload_constant_p (rtx op)
&& s390_single_part (op, word_mode, HImode, 0) >= 0)
return true;
if (TARGET_EXTIMM
&& GET_CODE (op) == CONST_INT
&& trunc_int_for_mode (INTVAL (op), word_mode) == INTVAL (op)
&& s390_single_part (op, word_mode, SImode, 0) >= 0)
return true;
/* Accept larl operands. */
if (TARGET_CPU_ZARCH
&& larl_operand (op, VOIDmode))
@ -4115,6 +4181,14 @@ print_operand (FILE *file, rtx x, int code)
else if (code == 'j')
fprintf (file, HOST_WIDE_INT_PRINT_DEC,
s390_extract_part (x, HImode, -1));
else if (code == 'k')
fprintf (file, HOST_WIDE_INT_PRINT_DEC,
s390_extract_part (x, SImode, 0));
else if (code == 'm')
fprintf (file, HOST_WIDE_INT_PRINT_DEC,
s390_extract_part (x, SImode, -1));
else if (code == 'o')
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0xffffffff);
else
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
break;
@ -4270,7 +4344,8 @@ s390_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority)
if (! INSN_P (insn))
return priority;
if (s390_tune != PROCESSOR_2084_Z990)
if (s390_tune != PROCESSOR_2084_Z990
&& s390_tune != PROCESSOR_2094_Z9_109)
return priority;
switch (s390_safe_attr_type (insn))
@ -4294,7 +4369,8 @@ s390_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority)
static int
s390_issue_rate (void)
{
if (s390_tune == PROCESSOR_2084_Z990)
if (s390_tune == PROCESSOR_2084_Z990
|| s390_tune == PROCESSOR_2094_Z9_109)
return 3;
return 1;
}
@ -7717,9 +7793,11 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
{
/* Setup literal pool pointer if required. */
if ((!DISP_IN_RANGE (delta)
&& !CONST_OK_FOR_K (delta))
&& !CONST_OK_FOR_K (delta)
&& !CONST_OK_FOR_Os (delta))
|| (!DISP_IN_RANGE (vcall_offset)
&& !CONST_OK_FOR_K (vcall_offset)))
&& !CONST_OK_FOR_K (vcall_offset)
&& !CONST_OK_FOR_Os (vcall_offset)))
{
op[5] = gen_label_rtx ();
output_asm_insn ("larl\t%4,%5", op);
@ -7734,6 +7812,8 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
output_asm_insn ("lay\t%1,%2(%1)", op);
else if (CONST_OK_FOR_K (delta))
output_asm_insn ("aghi\t%1,%2", op);
else if (CONST_OK_FOR_Os (delta))
output_asm_insn ("agfi\t%1,%2", op);
else
{
op[6] = gen_label_rtx ();
@ -7755,6 +7835,12 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
output_asm_insn ("ag\t%4,0(%1)", op);
output_asm_insn ("ag\t%1,0(%4)", op);
}
else if (CONST_OK_FOR_Os (vcall_offset))
{
output_asm_insn ("lgfi\t%4,%3", op);
output_asm_insn ("ag\t%4,0(%1)", op);
output_asm_insn ("ag\t%1,0(%4)", op);
}
else
{
op[7] = gen_label_rtx ();
@ -7792,9 +7878,11 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
/* Setup base pointer if required. */
if (!vcall_offset
|| (!DISP_IN_RANGE (delta)
&& !CONST_OK_FOR_K (delta))
&& !CONST_OK_FOR_K (delta)
&& !CONST_OK_FOR_Os (delta))
|| (!DISP_IN_RANGE (delta)
&& !CONST_OK_FOR_K (vcall_offset)))
&& !CONST_OK_FOR_K (vcall_offset)
&& !CONST_OK_FOR_Os (vcall_offset)))
{
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
@ -7811,6 +7899,8 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
output_asm_insn ("lay\t%1,%2(%1)", op);
else if (CONST_OK_FOR_K (delta))
output_asm_insn ("ahi\t%1,%2", op);
else if (CONST_OK_FOR_Os (delta))
output_asm_insn ("afi\t%1,%2", op);
else
{
op[6] = gen_label_rtx ();
@ -7837,6 +7927,12 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
output_asm_insn ("a\t%4,0(%1)", op);
output_asm_insn ("a\t%1,0(%4)", op);
}
else if (CONST_OK_FOR_Os (vcall_offset))
{
output_asm_insn ("iilf\t%4,%3", op);
output_asm_insn ("a\t%4,0(%1)", op);
output_asm_insn ("a\t%1,0(%4)", op);
}
else
{
op[7] = gen_label_rtx ();

View File

@ -40,6 +40,7 @@ enum processor_type
PROCESSOR_9672_G6,
PROCESSOR_2064_Z900,
PROCESSOR_2084_Z990,
PROCESSOR_2094_Z9_109,
PROCESSOR_max
};
@ -49,7 +50,8 @@ enum processor_flags
{
PF_IEEE_FLOAT = 1,
PF_ZARCH = 2,
PF_LONG_DISPLACEMENT = 4
PF_LONG_DISPLACEMENT = 4,
PF_EXTIMM = 8
};
extern enum processor_type s390_tune;
@ -64,10 +66,13 @@ extern enum processor_flags s390_arch_flags;
(s390_arch_flags & PF_ZARCH)
#define TARGET_CPU_LONG_DISPLACEMENT \
(s390_arch_flags & PF_LONG_DISPLACEMENT)
#define TARGET_CPU_EXTIMM \
(s390_arch_flags & PF_EXTIMM)
#define TARGET_LONG_DISPLACEMENT \
(TARGET_ZARCH && TARGET_CPU_LONG_DISPLACEMENT)
#define TARGET_EXTIMM \
(TARGET_ZARCH && TARGET_CPU_EXTIMM)
/* Run-time target specification. */
@ -501,7 +506,8 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
((C) == 'U' || (C) == 'W' || (C) == 'Y')
#define CONSTRAINT_LEN(C, STR) \
((C) == 'N' ? 5 : \
((C) == 'N' ? 5 : \
(C) == 'O' ? 2 : \
(C) == 'A' ? 2 : \
(C) == 'B' ? 2 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
@ -980,6 +986,9 @@ do { \
indexing purposes) so give the MEM rtx a byte's mode. */
#define FUNCTION_MODE QImode
/* Specify the value which is used when clz operand is zero. */
#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 64, 1)
/* Machine-specific symbol_ref flags. */
#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0)

File diff suppressed because it is too large Load Diff