OSDN Git Service

2004-12-16 Mark Dettinger <dettinge@de.ibm.com>
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Dec 2004 12:31:32 +0000 (12:31 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Dec 2004 12:31:32 +0000 (12:31 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92259 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/s390/s390.c

index a6c2e45..b857cce 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2004-12-15  Richard Henderson  <rth@redhat.com>
 
        PR target/19028
index 856a0b7..9db222a 100644 (file)
@@ -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.  */