aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/aarch64/aarch64.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 16db0ab..6945af9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-28 Kristina Martsenko <kristina.martsenko@arm.com>
+
+ * config/aarch64/aarch64.c (aarch64_rtx_costs): Fix cost of zero extend.
+
2016-07-28 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.c (aarch64_pushwb_pair_reg): Rename.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index d456670..e91811d 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -6803,11 +6803,12 @@ cost_plus:
{
int op_cost = rtx_cost (op0, VOIDmode, ZERO_EXTEND, 0, speed);
- if (!op_cost && speed)
- /* MOV. */
- *cost += extra_cost->alu.extend;
- else
- /* Free, the cost is that of the SI mode operation. */
+ /* If OP_COST is non-zero, then the cost of the zero extend
+ is effectively the cost of the inner operation. Otherwise
+ we have a MOV instruction and we take the cost from the MOV
+ itself. This is true independently of whether we are
+ optimizing for space or time. */
+ if (op_cost)
*cost = op_cost;
return true;