reference implementation of BLAS

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Sep 25 01:29:00 GMT 2006


On Sun, Sep 24, 2006 at 06:10:42PM -0700, Tim Prince wrote:
> Steve Kargl wrote:
> 
> >
> >Are you using -ffast-math?  DON'T!
> >
> 
> There are a few potentially useful optimizations included in 
> -ffast-math, such as optimization of sum reduction by parallel addition, 
> abrupt underflow, and optimization of repeated division by an invariant.
> Apparently, there are also shortcuts for multiply by 1. and 0. They are 
> outweighed by other performance losses, as well as the bugs you no doubt 
> encounter.  Generally, in addition, people tend to set it up to invoke 
> some broken shortcuts in math libraries, or mathinline.h.  If you could 
> find out how to invoke the individual optimizations which have a chance 
> of success, that might be interesting.

-ffast-math causes problems for complex data types by
using naive algorithms.  You'll get Inf and NaN when
you shouldn't.  What makes things worse is that the gcc
backend does not properly propagate Inf and NaN with
complex arithmetic.  "fast" in -ffast-math should be
renamed to "dangerous" because many users don't fully
understand what it does.   

-- 
Steve



More information about the Fortran mailing list