This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC/RFT] Should we hoist FP constants on x87?
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Feb 2006 13:59:59 +0100
- Subject: Re: [RFC/RFT] Should we hoist FP constants on x87?
- References: <Pine.LNX.4.44.0512271619230.31521-100000@www.eyesopen.com>
On 12/28/05, Roger Sayle <roger@eyesopen.com> wrote:
>
> One significant (philosophical) difference between the floating point
> code generated by GCC vs that generated by commercial compilers for
> IA-32, is the decision whether or not to hoist floating point constants
> on the x87. Or phrased equivalently, whether to allocate an x87 stack
> register to hold compile-time FP constants over basic block boundaries.
> Of course, this decision (to hoist or not to hoist) requires a
> significant amount of benchmarking to decide whether it is more
> generally a win on real code, POV-Ray, SPECfp2000, etc... It may
> also be dependent upon the IA-32 processor generation and manufacturer
> as x87 stack manipulation is much cheaper on some Pentium familes
> than other chipsets. I'm posting this patch here in the hope
> that it triggers some feedback and/or discussion on the debate.
Roger, your patch brings ~1.2% speed improvements in povray benchmark:
Povray-3.6.1, compiled with CXXFLAGS = -Wno-multichar -O3 -mfpmath=387
-march=pentium4 -ffast-math -D__NO_MATH_INLINES -mtune=pentium4
-malign-double -minline-all-stringops
time ./povray -display=NONE benchmark.pov (compiled with unpatched gcc):
user 5m50.143s
time ./povray -display=NONE benchmark.pov (compiled with patched gcc):
user 5m45.957s
This is pentium4 3.2GHz / 800MHz FSB.
Tested gcc is gcc version 4.2.0 20060215 (experimental) with a couple
of other 387 performance patches.
Uros.