Re: Semaphore assembly-code bug

From: Andreas Steinmetz
Date: Fri Oct 29 2004 - 14:44:09 EST


Linus Torvalds wrote:
Somebody should check what the Pentium M does. It might just notice that "lea 4(%esp),%esp" is the same as "add 4 to esp", but it's entirely possible that lea will confuse its stack engine logic and cause stack-related address generation stalls..

Now especially Intel tells everybody in their Pentium Optimization manuals to *use* lea whereever possible as this operation doesn't depend on the ALU and is processed in other parts of the CPU.

Sample quote from said manual (P/N 248966-05):
"Use the lea instruction and the full range of addressing modes to do address calculation"

I would guess Intel would add caveats about such stalls in this manual if there would be any.
--
Andreas Steinmetz SPAMmers use robotrap@xxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/