Message ID | 20190801194756.GA11962@ibm-toto.the-meissners.org |
---|---|
State | New |
Headers | show |
Series | , Add future cost placeholder to PowerPC | expand |
On Thu, Aug 01, 2019 at 03:47:56PM -0400, Michael Meissner wrote: > 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. Is there any reason for this? At least when it actually points to the power9 costs it is clear it is just a placeholder. Segher
On Thu, Aug 01, 2019 at 04:26:11PM -0500, Segher Boessenkool wrote: > On Thu, Aug 01, 2019 at 03:47:56PM -0400, Michael Meissner wrote: > > 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. > > Is there any reason for this? At least when it actually points to the > power9 costs it is clear it is just a placeholder. The main reason was you had asked for it many, many months ago on the internal branch. But until we actually need to change the values, it doesn't need to be changed immediately.
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;