From: pbrook Date: Wed, 10 Jan 2007 22:06:56 +0000 (+0000) Subject: 2007-01-10 Paul Brook X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8954523869fe72beb7f72643ddf3168c256eb9af;p=thirdparty%2Fgcc.git 2007-01-10 Paul Brook 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 607cbb06b618..6443a1dbed5f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-01-10 Paul Brook + + * config/arm/arm.c (arm_rtx_costs_1): Handle mutiply-subtract. + * config/arm/arm.md (mulsi3subsi): New insn. + 2007-01-10 Zdenek Dvorak * tree-ssa-loop-manip.c (tree_unroll_loop): Make it a wrapper over ... diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 731dbe2af7d1..20b8fd75f7bd 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -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)) diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 564c755a3a67..6d8f914c4cba 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -1294,6 +1294,18 @@ (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"