This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Performance of Integer Multiplication on PIII
- To: Tim Prince <tprince at computer dot org>
- Subject: Re: Performance of Integer Multiplication on PIII
- From: Kevin Atkinson <kevin at atkinson dot dhs dot org>
- Date: Mon, 5 Nov 2001 06:48:57 -0500 (EST)
- Cc: <pete at ltoi dot iap dot physik dot tu-darmstadt dot de>, <gcc at gcc dot gnu dot org>
On Sat, 3 Nov 2001, Tim Prince wrote:
> > Form Agner Fog (http://www.agner.org/assem/) pentopt.zip
> >
> > 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....