lkml.org 
[lkml]   [2000]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Code optimization <LEA Instruction>
On Fri, Jan 28, 2000 at 01:15:22PM +0100, Jamie Lokier <lkd@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@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@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.044 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site