Code optimization <LEA Instruction>
Marc Lehmann
marc en gimp.org
Sab Ene 29 00:06:50 CST 2000
On Fri, Jan 28, 2000 at 01:15:22PM +0100, Jamie Lokier <lkd en tantalophile.demon.co.uk> wrote:
> Richard B. Johnson wrote:
> > The following program clearly shows that many more 'addl' instructions
> > may be executed than 'leal' instructions within a given time.
The point of Alan and about everybody else is that this code does not
occur in practise. leal simply *is* faster, overall, even if the compiler
always chose leal over addl.
> Pentiums and 486s. See _any_ 486 or Pentium optimisation book... AGI
> is an important scheduling detail. I think modern GCC knows about it
> and schedules accordingly.
Modern gcc has indeed imrpoved a lot on this. It still does not decide the
use of lea vs. add based on functional units, though. As it is now, it
favours addl over leal in cases these are equivalent (leal does not clobber
cc), and uses leal in all other cases.
This is an overall win.
> Certainly, PGCC does.
pgcc indeed tries to catch the most common AGI occurrences, a technique
only effective on pentiums, though (the problem on pentiumpro and above
is much less severe, and the code sequences to exploit that are totally
different).
--
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg en opengroup.org |e|
-=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE --+
The choice of a GNU generation |
|
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Más información sobre la lista de distribución Ayuda