This is the mail archive of the 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]

Re: Performance of Integer Multiplication on PIII

On Sat, 3 Nov 2001, Tim Prince wrote:

> >  Form Agner Fog (
> >
> >                  PPlain      PMMX    PPro    PII   PIII
> >  IMUL latency       9          9       4      4      4
> >  IMUL throughput   1/9        1/9     1/1    1/1    1/1
> >
> >  That means, imul is pipelined on i686 ...
> >
> > > So I guess the lesson here is that on PIII integer multiplication is
> fast
> > > enough that doing special tricks to avoid integer multiplication will
> hurt
> > > performs in stead of helping it.
> >
> Even on the P4, code which permits full pipelining will run well with
> imul, while the add and shift sequences are preferable in contexts where
> that is not possible.  I haven't seen any compiler which is able to
> distinguish those situations.

The Intel compiler seams to be able to as it gets about the same results
as my hand coded assembly did.  It should not be two difficult to tell when
imul is preferable.  It would seam to me this can be done by calculating
a dependency tree on a block of code and then see if the latency of the
imul will prevent anything else from calculating....

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