This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/15492] floating-point arguments are loaded too early to x87 stack
- From: "uros at kss-loka dot si" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2004 08:07:20 -0000
- Subject: [Bug target/15492] floating-point arguments are loaded too early to x87 stack
- References: <20040517130734.15492.uros@kss-loka.si>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From uros at kss-loka dot si 2004-08-19 08:07 -------
According to "How to optimize for the Pentium family of microprocessors" by
Agner Fog, "fld r/m32/m64" consumes one clock cycle on P1, PMMX, PPRO, P2, P3
and P4, and "fld m80" consumes 3 cycles on P1, PMMX and P4 and two cycles on
PPRO, P2 and P3.
This means, that code in all examples will be faster, because there is less fxch
instructions. Also, more fp-stack could be used to store temporary variables if
arguments are taken from stack when needed instead of copying their value
between fp stack registers.
There is a question if it is worth to special-case "fld m80" instructions to use
fp register copies instead of memory load. Again, a lot of fxch instructions
would be needed and fp stack space could be wasted with register copies.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15492