x87 float truncation/accuracy (gcc vs. icc/msvc)
Thomas Kunert
kunert@physik.tu-dresden.de
Fri Mar 19 11:30:00 GMT 2004
Roger Sayle wrote:
> interesting is that both the Microsoft Visual C/C++ compiler and Intel's
> icc both *by default* completely optimized away this "float_truncate",
> producing incorrectly rounded results.
>
Could you please explain what's wrong with incorrectly rounded results?
I was under the impression accuracy and performance is more important to
most people. And for the ones who actually care about rounding
there is -ffloat-store. What is this option for, if the truncation happens
anyway?
The current behavior is very surprising, at least to me. Excess precision is
documented and known by most people doing numerical applications. On the other
hand, a performance impact for the sake of correct rounding is surprising and
very annoying here, especially since one cannot turn it off. And please don't
expect everyone to use a flag named unsafe-math-optimizations.
Thanks,
Thomas Kunert
More information about the Gcc
mailing list