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: Floating poing 'non-bug'? Or is this a bug?


Yuval Kfir wrote:
Isn't this something that should be fixed in the gcc backend, then?

In theory. But this is a very complicated problem. It has been a known problem for at least 13-14 years, and it hasn't been fixed yet. Personally, I don't think it ever will be.


It is probably easier to fix the problem in hardware than in the compiler. There is one secondary problem (the double rounding problem) that can't be fixed in the compiler at all. So without a hardware fix, there will always be problems with x87 FP support.

Recent hardware has SSE/SSE2/etc FP instructions that do not have the excess precision problems that the x87 register stack has. However, using the new registers requires an ABI change, which is unlikely to ever happen for 32-bit x86 code.

64-bit x86 code however did change the ABI to use the new FP instructions. The result is that if you generate 64-bit code for an AMD64/EM64T processor, then you will get correct FP results. At least this is true for linux. I don't know about Windows.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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