aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorMark Dettinger <dettinge@de.ibm.com>2004-12-16 12:31:32 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2004-12-16 12:31:32 +0000
commitb75d6babbcf1a4d0fa1f358f52015020ffa688d1 (patch)
tree0eb9b31eb39bc39efdaee23da11440f88cb95308 /gcc/config
parentcacd0a2ccff5b9e18996d4c4e46a936c4543db22 (diff)
downloadgcc-b75d6babbcf1a4d0fa1f358f52015020ffa688d1.zip
gcc-b75d6babbcf1a4d0fa1f358f52015020ffa688d1.tar.gz
gcc-b75d6babbcf1a4d0fa1f358f52015020ffa688d1.tar.bz2
s390.c (struct processor_costs): Two new fields: madbr, maebr.
2004-12-16 Mark Dettinger <dettinge@de.ibm.com> * config/s390/s390.c (struct processor_costs): Two new fields: madbr, maebr. (s390_rtx_costs): Added handling of multipy and add in SFmode. More precise values for cost of multiply and add. From-SVN: r92259
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/s390/s390.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 856a0b7..9db222a 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -105,6 +105,8 @@ struct processor_costs
const int mult_df; /* cost of multiplication in DFmode. */
const int sqdbr; /* cost of square root in DFmode. */
const int sqebr; /* cost of square root in SFmode. */
+ const int madbr; /* cost of multiply and add in DFmode. */
+ const int maebr; /* cost of multiply and add in SFmode. */
};
const struct processor_costs *s390_cost;
@@ -127,6 +129,8 @@ struct processor_costs z900_cost =
COSTS_N_INSNS (7), /* multiplication in DFmode */
COSTS_N_INSNS (44), /* SQDBR */
COSTS_N_INSNS (35), /* SQEBR */
+ COSTS_N_INSNS (18), /* MADBR */
+ COSTS_N_INSNS (13), /* MAEBR */
};
static const
@@ -147,6 +151,8 @@ struct processor_costs z990_cost =
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 */
};
@@ -1902,13 +1908,16 @@ s390_rtx_costs (rtx x, int code, int outer_code, int *total)
case PLUS:
case MINUS:
/* Check for multiply and add. */
- if (GET_MODE (x) == DFmode
+ if ((GET_MODE (x) == DFmode || GET_MODE (x) == SFmode)
&& GET_CODE (XEXP (x, 0)) == MULT
&& TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD)
{
/* This is the multiply and add case. */
- *total = s390_cost->mult_df
- + rtx_cost (XEXP (XEXP (x, 0), 0), MULT)
+ if (GET_MODE (x) == DFmode)
+ *total = s390_cost->madbr;
+ else
+ *total = s390_cost->maebr;
+ *total += rtx_cost (XEXP (XEXP (x, 0), 0), MULT)
+ rtx_cost (XEXP (XEXP (x, 0), 1), MULT)
+ rtx_cost (XEXP (x, 1), code);
return true; /* Do not do an additional recursive descent. */