Mail Archives: pgcc/1998/06/16/20:54:37
I have a "C" application that is heavy on double precision floating
point. When I run it on a Pentium II processor I noticed that the
speed of the floating point in my "inner loop" can differ by nearly a
factor of two between different calls to the function (with the same
data).
I finally tracked it down to the value of the stack pointer when
entering the function. If the stack pointer is aligned on an 8 byte
boundary, the function runs fast; if it is not aligned on an 8 byte
boundary, it runs slow. I've tried varies versions of egcs with and
with out the Pentium patches, and the "-malign-double" and
"-mstack-align-double" options, to no avail.
I think there is a basic problem with alignment and the i386 CALL
instruction: CALL pushes the return address (4 bytes) onto the stack,
so that a function that starts with an aligned stack will present a
misaligned stack to any function it calls.
Has anybody else had this experience? Any suggestions?
This is all done on a 333Mhz PII on an Intel AL440LX motherboard.
--
Tom Quinn Astronomy, University of Washington
Internet: trq AT astro DOT washington DOT edu
Phone: 206-685-9009
- Raw text -