public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: GCC options and floating-point correctness (benchmarks)
@ 2004-03-25 19:43 Joost VandeVondele
  0 siblings, 0 replies; 18+ messages in thread
From: Joost VandeVondele @ 2004-03-25 19:43 UTC (permalink / raw)
  To: gcc


Using the fortran version of the paranoia test :
http://www.netlib.org/paranoia/

xlf -qfloat=nomaf:rndsngl -qstrict -O3 dpara.f
 No failures, defects nor flaws have been discovered.
 Rounding appears to conform to the proposed IEEE standard  P754
 The arithmetic diagnosed appears to be Excellent!
 End of Test.

f95 -ieee=full dpara.f
 The number of  FLAWs  discovered =              1
 The arithmetic diagnosed seems Satisfactory though flawed.
 End of Test.
(flaw -0.0**0 -> NaN)

Joost

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: GCC options and floating-point correctness (benchmarks)
@ 2004-03-27 13:32 Richard Kenner
  0 siblings, 0 replies; 18+ messages in thread
From: Richard Kenner @ 2004-03-27 13:32 UTC (permalink / raw)
  To: dewar; +Cc: gcc

    I would bet that Intel is *very* familiar with Paranoia. I would have
    assumed that gcc developers would also be very familiar  with this
    test, but surprisingly, this seems incorrect!

GCC developers certainly *used* to be familiar with Paranoia ...

^ permalink raw reply	[flat|nested] 18+ messages in thread
* GCC options and floating-point correctness (benchmarks)
@ 2004-03-25 17:58 Scott Robert Ladd
  2004-03-25 18:09 ` Joseph S. Myers
  2004-03-25 18:54 ` Theodore Papadopoulo
  0 siblings, 2 replies; 18+ messages in thread
From: Scott Robert Ladd @ 2004-03-25 17:58 UTC (permalink / raw)
  To: gcc mailing list

Hello,

One of the most prominent numerical programmers, Dr. William Kahan, 
developed the PARANOIA benchmark. While it doesn't cover every aspect of 
numerical "correctness", it does provide an interesting benchmakr for 
comparing the effects of different compiler options.

Among numerical programmers, Mr. Kahan holds a reputation similar to 
that of Donald Knuth.

I produced the following results for a C version of PARANOIA on a 2.8GHz 
Pentium 4 (Northwood core), HT enabled, using a very recent build of the 
tree-ssa branch. I'll be glad to send copies of the benchmark source to 
anyone who requests it privately.

Conclusions and observations:

The best results (and the only potentially acceptable one in Mr. Kahan's 
opinion) required the use of the -march=pentium4 and -mfpmath=sse options.

VERY IMPORTANT: The -ffast-math switch *DOES NOT* introduce failures and 
defects *UNLESS COMBINED* with one of -O1, -O2, or -O3. And yes, 
-ffast-math does alter code generation even if no optimization is specified.

In fact, the use of any optimizations (-O1, -O2, or -O3) introduces 
numerous failures and defects (with and without -ffast-math), *unless* 
those switches are combined with -march=pentium4 and -mfpmath=sse. It is 
the -O options that should be our concern, *NOT* -ffast-math.

Adding -ffast-math to -O3 (without any other code generation options) 
actually *reduces* the number of failures over a simple -O3.

gcc -o paranoiag -lm paranoia.c

(no failures!)
The number of  SERIOUS DEFECTs  discovered = 1.
The number of  DEFECTs  discovered =         1.
The number of  FLAWs  discovered =           1.

gcc -o paranoiag -lm -march=pentium4 -mfpmath=sse paranoia.c
gcc -o paranoiag -lm -O1 -march=pentium4 -mfpmath=sse paranoia.c
gcc -o paranoiag -lm -O2 -march=pentium4 -mfpmath=sse paranoia.c
gcc -o paranoiag -lm -O3 -march=pentium4 -mfpmath=sse paranoia.c
gcc -o paranoiag -lm -ffast-math -march=pentium4 -mfpmath=sse paranoia.c

(no failures)
(no serious defects)
The number of  DEFECTs  discovered =         1.
(no flaws)

gcc -o paranoiag -lm -O1 paranoia.c

The number of  FAILUREs  encountered =       3.
The number of  SERIOUS DEFECTs  discovered = 3.
The number of  DEFECTs  discovered =         5.
The number of  FLAWs  discovered =           2.

gcc -o paranoiag -lm -O2 paranoia.c

The number of  FAILUREs  encountered =       3.
The number of  SERIOUS DEFECTs  discovered = 3.
The number of  DEFECTs  discovered =         5.
The number of  FLAWs  discovered =           2.

gcc -o paranoiag -lm -O3 paranoia.c

The number of  FAILUREs  encountered =       4.
The number of  SERIOUS DEFECTs  discovered = 4.
The number of  DEFECTs  discovered =         3.
The number of  FLAWs  discovered =           2.

gcc -o paranoiag -lm -O3 -ffast-math paranoia.c

The number of  FAILUREs  encountered =       3.
The number of  SERIOUS DEFECTs  discovered = 4.
The number of  DEFECTs  discovered =         3.
The number of  FLAWs  discovered =           2.

gcc -o paranoiag -lm -O3 -ffast-math -march=pentium4 paranoia.c

The number of  FAILUREs  encountered =       3.
The number of  SERIOUS DEFECTs  discovered = 3.
The number of  DEFECTs  discovered =         3.
The number of  FLAWs  discovered =           2.

gcc -o paranoiag -lm -O3 -ffast-math -march=pentium4 -mfpmath=sse paranoia.c

The number of  SERIOUS DEFECTs  discovered = 1.
The number of  DEFECTs  discovered =         1.
The number of  FLAWs  discovered =           2.

-- 
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2004-03-27  1:51 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-25 19:43 GCC options and floating-point correctness (benchmarks) Joost VandeVondele
  -- strict thread matches above, loose matches on Subject: below --
2004-03-27 13:32 Richard Kenner
2004-03-25 17:58 Scott Robert Ladd
2004-03-25 18:09 ` Joseph S. Myers
2004-03-25 18:12   ` Scott Robert Ladd
2004-03-25 20:40     ` Dan Nicolaescu
2004-03-25 21:34       ` Scott Robert Ladd
2004-03-25 18:54 ` Theodore Papadopoulo
2004-03-25 19:40   ` Scott Robert Ladd
2004-03-25 20:42     ` Joe Buck
2004-03-25 20:45       ` Scott Robert Ladd
2004-03-25 21:02         ` Joe Buck
2004-03-26 16:06           ` Dave Korn
2004-03-27  7:07           ` Robert Dewar
2004-03-27  7:28             ` Joe Buck
2004-03-27 10:21               ` Roger Sayle
2004-03-27  6:02       ` Robert Dewar
2004-03-27  2:01     ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).