This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][AArch64] Use extend_arith rtx cost appropriately
- From: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, James Greenhalgh <james dot greenhalgh at arm dot com>
- Date: Mon, 20 Apr 2015 17:48:14 +0100
- Subject: [PATCH][AArch64] Use extend_arith rtx cost appropriately
- Authentication-results: sourceware.org; auth=none
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.
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),