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)


Could you please explain what's wrong with incorrectly rounded results?

What's wrong with them is that they are incorrectly rounded!


I was under the impression accuracy and performance is more important to
most people.

Incorrect rounding is precisely a case of giving inaccurate results. Now there are those who are willing to tolerate inaccurate results if they can get them faster. After all lots of Fortran programmers tolerate Cray's fast junk arithmetic (in which 81.0/3.0 was not 27.0) for years! But this kind of behavior should not occur by default in a compiler that advertises itself as a C compiler!

> And please don't expect everyone to use a flag
named unsafe-math-optimizations.

Why not? That's exactly what you are talking about, optimizations that are not safe, in the sense that they give wrong results.



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