This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: x87 float truncation/accuracy (gcc vs. icc/msvc)


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



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