This is the mail archive of the
mailing list for the GCC project.
Re: [patch] MIPS: Size optimization costs.
On Nov 6, 2006, at 12:15 PM, Richard Sandiford wrote:
Eric Christopher <firstname.lastname@example.org> writes:
Too much indentation: the COST_N_INSNS() lines are too indented.
I'm not a great fan of the current MIPS cost model, not least
it fails to take things like -mhard-float and -msoft-float into
However, your patch is a strict improvement on what we have now.
FWIW a simple improvement on this would be to bias the cost count in
favor of the cheaper instructions, i.e. multiplication over division
using something like CONST_N_INSNS(1) + 1.
I don't think that's a good idea. The expressions given to rtx_costs
can be arbitrarily complex, and taken literally, the higher cost would
suggest that 4 divisions have the same cost as 5 multiplications.
Yeah, I've just never seen a case where we've done something like that
in the middle end. I'm willing to stipulate it could happen though.
If we're optimising for size, I think something should only have
a higher cost if it really is bigger. Adding +1 to the cost of X
might be appropriate if using X sometimes causes extra code to
be generated (e.g. if we sometimes have to insert nops to avoid
That's a good idea though.