Add future_cost placeholder.

Currently, the -mcpu=future uses the power9 costs.  This patch separates out
the cost to a separate structure so that in the future we can tweak the costs
as needed.

I have bootstraped versions of this patch multiple times on a power8 little
endian system.  Can I check this into the FSF trunk?

2019-08-01  Michael Meissner  <meiss...@linux.ibm.com>

        * config/rs6000/rs6000.c (future_cost): Add separate cost
        structure for a 'future' machine.
        (rs6000_option_override_internal): If -mcpu=future, use the future
        costs instead of power9.

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c  (revision 273954)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -1079,6 +1079,27 @@ struct processor_costs power9_cost = {
   COSTS_N_INSNS (3),   /* SF->DF convert */
 };
 
+/* Instruction costs on FUTURE processors.  At present, this is a place holder,
+   until more accurate information can be provided.  */
+static const
+struct processor_costs future_cost = {
+  COSTS_N_INSNS (3),   /* mulsi */
+  COSTS_N_INSNS (3),   /* mulsi_const */
+  COSTS_N_INSNS (3),   /* mulsi_const9 */
+  COSTS_N_INSNS (3),   /* muldi */
+  COSTS_N_INSNS (8),   /* divsi */
+  COSTS_N_INSNS (12),  /* divdi */
+  COSTS_N_INSNS (3),   /* fp */
+  COSTS_N_INSNS (3),   /* dmul */
+  COSTS_N_INSNS (13),  /* sdiv */
+  COSTS_N_INSNS (18),  /* ddiv */
+  128,                 /* cache line size */
+  32,                  /* l1 cache */
+  512,                 /* l2 cache */
+  8,                   /* prefetch streams */
+  COSTS_N_INSNS (3),   /* SF->DF convert */
+};
+
 /* Instruction costs on POWER A2 processors.  */
 static const
 struct processor_costs ppca2_cost = {
@@ -4487,10 +4508,13 @@ rs6000_option_override_internal (bool gl
        break;
 
       case PROCESSOR_POWER9:
-      case PROCESSOR_FUTURE:
        rs6000_cost = &power9_cost;
        break;
 
+      case PROCESSOR_FUTURE:
+       rs6000_cost = &future_cost;
+       break;
+
       case PROCESSOR_PPCA2:
        rs6000_cost = &ppca2_cost;
        break;

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797

Reply via email to