GCC options and floating-point correctness (benchmarks)
Scott Robert Ladd
coyote@coyotegulch.com
Thu Mar 25 21:34:00 GMT 2004
Dan Nicolaescu wrote:
> Scott Robert Ladd <coyote@coyotegulch.com> writes:
>
> > Joseph S. Myers wrote:
> >> What if -ffloat-store is used in alternative to those? It doesn't
> >> actually work as far as causing conformance (e.g., casts to same type
> >> still get discarded rather than reducing precision), but it is supposed to
> >> help.
> >
> > -ffloat-store and -mieee-fp don't change the results.
>
> This is contradicted by my results.
Okey-dokey, as we say here in the wild, wild west.
From my proc/cpuingo, I get:
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Pentium 4 (Northwood)
stepping : 7
cpu MHz : 2785.075
cache size : 512 KB
The following two command lines produce the exact same result from
paranoia (1 defect):
gcc -o paranoiag -ffloat-store -march=pentium4 -ffast-math \
-mfpmath=sse -lm paranoia.c
gcc -o paranoiag -march=pentium4 -ffast-math -mfpmath=sse \
-lm paranoia.c
In other words, -ffloat-store made no difference -- and using the either
command above produces a better (fewer problems) result than does your:
gcc -O2 -ffloat-store paranoia.c -lm
Note that I am running tree-ssa as my compiler; this is very different
from gcc 3.2.
--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing
More information about the Gcc
mailing list