[AArch64 costs 6/18] Set default costs and handle vector modes.
authorJames Greenhalgh <james.greenhalgh@arm.com>
Fri, 16 May 2014 08:52:30 +0000 (08:52 +0000)
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>
Fri, 16 May 2014 08:52:30 +0000 (08:52 +0000)
gcc/

* config/aarch64/aarch64.c (aarch64_rtx_costs): Set default costs.

From-SVN: r210498

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index e449380a441106d4374998742c4b71e61723564b..97017485ef86f537910bca10f3ba85dc32bb60f6 100644 (file)
@@ -1,3 +1,7 @@
+2014-05-16  James Greenhalgh  <james.greenhalgh@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_rtx_costs): Set default costs.
+
 2014-05-16  James Greenhalgh  <james.greenhalgh@arm.com>
            Philipp Tomsich  <philipp.tomsich@theobroma-systems.com>
 
index 2b6479dc17c855ee518c9964d32f93d42315123b..52189f4a96794df19ce198436bde51da497e023f 100644 (file)
@@ -4843,6 +4843,21 @@ aarch64_rtx_costs (rtx x, int code, int outer ATTRIBUTE_UNUSED,
     = aarch64_tune_params->insn_extra_cost;
   enum machine_mode mode = GET_MODE (x);
 
+  /* By default, assume that everything has equivalent cost to the
+     cheapest instruction.  Any additional costs are applied as a delta
+     above this default.  */
+  *cost = COSTS_N_INSNS (1);
+
+  /* TODO: The cost infrastructure currently does not handle
+     vector operations.  Assume that all vector operations
+     are equally expensive.  */
+  if (VECTOR_MODE_P (mode))
+    {
+      if (speed)
+       *cost += extra_cost->vect.alu;
+      return true;
+    }
+
   switch (code)
     {
     case SET: