arm.c (arm_rtx_costs_1): Handle mutiply-subtract.

2007-01-10  Paul Brook  <paul@codesourcery.com>

	gcc/
	* config/arm/arm.c (arm_rtx_costs_1): Handle mutiply-subtract.
	* config/arm/arm.md (mulsi3subsi): New insn.

From-SVN: r120651
This commit is contained in:
Paul Brook 2007-01-10 22:06:56 +00:00 committed by Paul Brook
parent 567b96ed38
commit 26b53f802d
3 changed files with 25 additions and 0 deletions

View 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 ...

View 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))

View File

@ -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"