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: [PATCH] Reorganize rs6000_rtx_costs


On Thu, 1 Jul 2004, David Edelsohn wrote:
> > This will allow us to record the fact that a 64-bit multiplication
> > is significantly shorter on processors when compiling for a 64-bit
> > CPU, than it is for a 32-bit CPU.
>
> Do you mean that the table already records this information, or that
> it can record the information?

Sorry, if this was unclear.  I meant that this will eventually allow
us to distinguish 32bit vs. 64bit size costs.  Its easier to introduce
the size32 and size64 structures now, to show the final form of the
proposed rs6000_rtx_costs overhaul.  The rest of my patches in this
series won't have to touch rs6000_override_options again.

Interestingly, I've been asked by the x86_64 folks to make the identical
change to the i386 backend, to improve the modeling of 64bit code size
there.


> > There should be no functional/parameter differences with this patch
> > other than to report the size of multiplication and and division
> > operations as a single instruction when optimizing for size.
>
> Also, the original code returned COSTS_N_INSNS(2), not COSTS_N_INSNS(1),
> for optimize_size.  Any reason for the change?

This is intentional.  The PowerPC's RISC architecture means that the
sizes of additions, multiplications and divisions are the same.  There
seemed no point leaving this bug in the existing code, and although
unlikely, its possible that estimating a division as "cheaper" than
a multiplication might produce undesirable side-effects in the RTL
optimizers.  For example, implementing a floating point multiplication
as a division by a reciprocal!


Roger
--


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