From b75d6babbcf1a4d0fa1f358f52015020ffa688d1 Mon Sep 17 00:00:00 2001 From: Mark Dettinger Date: Thu, 16 Dec 2004 12:31:32 +0000 Subject: [PATCH] s390.c (struct processor_costs): Two new fields: madbr, maebr. 2004-12-16 Mark Dettinger * 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 --- gcc/ChangeLog | 7 +++++++ gcc/config/s390/s390.c | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6c2e45aa8c4..b857cce14b21 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-12-16 Mark Dettinger + + * 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. + 2004-12-15 Richard Henderson PR target/19028 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 856a0b78ea38..9db222a8ffd6 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. */