On 2011-12-20 12:48:53 +0100, Dario Saccavino wrote:
> In the second program, if 0.5 < f < 1 the values of a and b eventually
> become the smallest representable denormal value and never change
> afterwards, resulting in a large number of operations involving
> denormal numbers.
Yes, I agree (I forgot about that)... except that if f is close enough
to 1, you won't have subnormals and the program will be fast (like in
the case f <= 0.5).
> gcc enables FTZ when using SSE and ffast-math (I think the specific
> compiler flag is -funsafe-math-optimizations).
Thanks, good to know...
> Therefore the flags needed are -msse2 -mfpmath=sse -ffast-math
I would discourage the use of -ffast-math, which can affect generic
code very badly (due to -funsafe-math-optimizations). Isn't there
an option to enable FTZ?
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]