OSDN Git Service

2007-01-10 Paul Brook <paul@codesourcery.com>
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2007 22:06:56 +0000 (22:06 +0000)
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2007 22:06:56 +0000 (22:06 +0000)
gcc/
* config/arm/arm.c (arm_rtx_costs_1): Handle mutiply-subtract.
* config/arm/arm.md (mulsi3subsi): New insn.

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

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

index 607cbb0..6443a1d 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-10  Paul Brook  <paul@codesourcery.com>
+
+       * config/arm/arm.c (arm_rtx_costs_1): Handle mutiply-subtract.
+       * config/arm/arm.md (mulsi3subsi): New insn.
+
 2007-01-10  Zdenek Dvorak <dvorakz@suse.cz>
 
        * tree-ssa-loop-manip.c (tree_unroll_loop): Make it a wrapper over ...
index 731dbe2..20b8fd7 100644 (file)
@@ -4752,6 +4752,14 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
                 ? 0 : 4));
 
     case MINUS:
+      if (GET_CODE (XEXP (x, 1)) == MULT && mode == SImode && arm_arch_thumb2)
+       {
+         extra_cost = rtx_cost (XEXP (x, 1), code);
+         if (!REG_OR_SUBREG_REG (XEXP (x, 0)))
+           extra_cost += 4 * ARM_NUM_REGS (mode);
+         return extra_cost;
+       }
+
       if (mode == DImode)
        return (4 + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 8)
                + ((REG_OR_SUBREG_REG (XEXP (x, 0))
index 564c755..6d8f914 100644 (file)
    (set_attr "insn" "mlas")]
 )
 
+(define_insn "*mulsi3subsi"
+  [(set (match_operand:SI 0 "s_register_operand" "=r")
+       (minus:SI
+         (match_operand:SI 3 "s_register_operand" "r")
+         (mult:SI (match_operand:SI 2 "s_register_operand" "r")
+                  (match_operand:SI 1 "s_register_operand" "r"))))]
+  "TARGET_32BIT && arm_arch_thumb2"
+  "mls%?\\t%0, %2, %1, %3"
+  [(set_attr "insn" "mla")
+   (set_attr "predicable" "yes")]
+)
+
 ;; Unnamed template to match long long multiply-accumulate (smlal)
 
 (define_insn "*mulsidi3adddi"