Floating point problems (accuracy).
Chris Lattner
sabre@nondot.org
Tue Jan 18 22:28:00 GMT 2005
James E Wilson wrote:
> Phil Prentice wrote:
>> We are having a few problems regarding floating point inaccuracies
>> under Linux. Please see the code below.
> This is PR 323 in our bug database. One of our most commonly reported
> problems. We call this the excess precision problem.
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
> This problem has been known for about 15 years now, and hasn't been
> fixed yet. My suspicion is that it never will be.
Another option is that you can try out the LLVM compiler
(http://llvm.org). The CVS version of LLVM supports a
--disable-excess-fp-precision flag, which causes it to emit the extra
rounding operations needed to give "correct" 32 and 64-bit FP results,
even when using the X86 floating point stack.
Note that this is severely slow down your code if it is FP intensive, but
it will produce correct results. As James mentions, using SSE is a much
better approach if possible.
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the Gcc
mailing list