Floating point performance issue

Vincent Lefevre vincent+gcc@vinc17.org
Tue Dec 20 13:02:00 GMT 2011


On 2011-12-20 13:30:30 +0100, Segher Boessenkool wrote:
> Dunno about that(*), but you can portably do
> 
> fesetround(FE_TOWARDZERO);
> 
> and that prevents the problem from occurring as well.

But this is a bad idea in general, as it would affect all FP operations,
not just subnormals (when one gets subnormals, one has already lost much
precision, so that FTZ may not be a problem in practice -- this depends
on the application, of course).

-- 
Vincent Lefèvre <vincent@vinc17.net> - 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)



More information about the Gcc-help mailing list