diff mbox

[AArch64] Use extend_arith rtx cost appropriately

Message ID 55352DCE.8000601@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov April 20, 2015, 4:48 p.m. UTC
Hi all,

When calculating the rtx costs of an arithmetic operation combined with
zero or sign extension of its operand we should use the extend_arith
cost rather than the arith_shift cost.

Bootstrapped and tested on aarch64-linux.
Ok for trunk?

Thanks,
Kyrill

2015-04-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/aarch64/aarch64.c (aarch64_rtx_costs): Use extend_arith
     rather than arith_shift cost when costing ADD/MINUS of an
     extended value.

Comments

Marcus Shawcroft April 30, 2015, 12:09 p.m. UTC | #1
On 20 April 2015 at 17:48, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> Hi all,
>
> When calculating the rtx costs of an arithmetic operation combined with
> zero or sign extension of its operand we should use the extend_arith
> cost rather than the arith_shift cost.
>
> Bootstrapped and tested on aarch64-linux.
> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2015-04-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     * config/aarch64/aarch64.c (aarch64_rtx_costs): Use extend_arith
>     rather than arith_shift cost when costing ADD/MINUS of an
>     extended value.

OK /Marcus
diff mbox

Patch

commit 5bf9f716682d7098b52f3f6ba562c74a33ed9485
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Mon Mar 2 10:31:43 2015 +0000

    [AArch64] Use extend_arith rtx cost appropriately.

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 6e73176..2023f04 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -5821,7 +5821,7 @@  cost_minus:
         if (aarch64_rtx_arith_op_extract_p (op1, mode))
 	  {
 	    if (speed)
-	      *cost += extra_cost->alu.arith_shift;
+	      *cost += extra_cost->alu.extend_arith;
 
 	    *cost += rtx_cost (XEXP (XEXP (op1, 0), 0),
 			       (enum rtx_code) GET_CODE (op1),
@@ -5891,7 +5891,7 @@  cost_plus:
         if (aarch64_rtx_arith_op_extract_p (op0, mode))
 	  {
 	    if (speed)
-	      *cost += extra_cost->alu.arith_shift;
+	      *cost += extra_cost->alu.extend_arith;
 
 	    *cost += rtx_cost (XEXP (XEXP (op0, 0), 0),
 			       (enum rtx_code) GET_CODE (op0),