This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC patch: invariant addresses too cheap


> We could also change the i386 target hook to return something >
> COSTS_N_INSN(1) when two regs are mentioned and something smaller
> (0,1,2,3) when not. ?I.e. "half" insn costs. ?That doesn't sound too
> appealing either, OTOH that may be the reason why COSTS_N_INSN is scaled
> at all.

I have no qualms with your patch at all, but I think that fractional costs
do make sense if you want address_cost to have the same unit as
rtx_costs (which the default implementation suggests).

I would just write < 3 in your patch as "<= COSTS_N_INSN (1) / 2".
Which shows even more how it is taken from thin air :-) but at least
shows that it is supposed to be in the same unit as rtx_costs.

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]