This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reference implementation of BLAS


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]