arm.c (arm_rtx_costs_1): Handle multiply-accumulate.
authorPaul Brook <paul@codesourcery.com>
Tue, 17 Oct 2006 01:04:27 +0000 (01:04 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Tue, 17 Oct 2006 01:04:27 +0000 (01:04 +0000)
2006-10-17  Paul Brook  <paul@codesourcery.com>

* config/arm/arm.c (arm_rtx_costs_1): Handle multiply-accumulate.

From-SVN: r117809

gcc/ChangeLog
gcc/config/arm/arm.c

index 877b768cf576946f66b57de4bf6dbc9d77b4af6e..15b1a70da01a6da642c40f27081d8e6a5a9f44ab 100644 (file)
@@ -1,3 +1,7 @@
+2006-10-17  Paul Brook  <paul@codesourcery.com>
+
+       * config/arm/arm.c (arm_rtx_costs_1): Handle multiply-accumulate.
+
 2006-10-16  Brooks Moses  <bmoses@stanford.edu>
 
        * doc/contrib.texi, doc/install.texi, doc/standards.texi:
index ff5831f4325e75bf28f5f714ac9956d8f42c6038..98b2d6008bb5a156ac9b806ea8e7b5e02e2dd937 100644 (file)
@@ -4465,6 +4465,14 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
       /* Fall through */
 
     case PLUS:
+      if (GET_CODE (XEXP (x, 0)) == MULT)
+       {
+         extra_cost = rtx_cost (XEXP (x, 0), code);
+         if (!REG_OR_SUBREG_REG (XEXP (x, 1)))
+           extra_cost += 4 * ARM_NUM_REGS (mode);
+         return extra_cost;
+       }
+
       if (GET_MODE_CLASS (mode) == MODE_FLOAT)
        return (2 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 8)
                + ((REG_OR_SUBREG_REG (XEXP (x, 1))