Code optimization <LEA Instruction>
willy en thepuffingroup.com
willy en thepuffingroup.com
Sab Ene 29 09:41:26 CST 2000
On Thu, Jan 27, 2000 at 05:01:48PM -0500, Richard B. Johnson wrote:
> The Intel reference manual tells about optimizing code.
> One of the things it states is that the LEA instruction can
> be used to change the value of an index register faster than
> using the ADD instruction (Page G-10, Intel '486 Rag).
yes...
> I note that recent 'C' compilers do this. There are a lot of
> LEA instructions that have replaced simple adds for adding
> a constant displacement to an index register.
ok...
> As usual, the Intel reference manual is wrong for all types
> of CPUs that I have tested (486-686).
with you...
> I wish somebody would have tested this information before wrong
> information went into the code-generation of the 'C' compilers.
uh huh...
> The following program clearly shows that many more 'addl' instructions
> may be executed than 'leal' instructions within a given time.
[snip example]
> The main point is, when attempting to optimize code, it would be
> a good idea to test the many possible instruction-sequences before
> you commit yourself, especially when providing inline 'asm' or
> generating compiler output.
umm...
I still don't see the relevance to linux-kernel (which is not x86
specific and is not particularly tied to the intimate details of the gcc
x86 backend). Perhaps you meant to send this to gcc-bug or take it up
with the gcc x86 backend maintainer in personal mail instead?
-
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