This is the mail archive of the
mailing list for the GCC project.
Re: Floating point trouble with x86's extended precision
Bradley Lucier wrote:
I, and other people, think that the inability to get predictable
behavior from GCC (even from an option that you might not like to use
because of speed or other issues) is a bug.
While I agreee that the current behaviour is a problem, I don't see any
good solution for it.
If we add explicit rounding after every operation, we effectively halve
the FPU performance, and we introduce double rounding errors. It isn't
clear if this is a better option, though it would be nice if it was
available as an option.
The best pragmatic solution is probably to set the rounding control to
64-bits, but then we lose access to long double which some people need,
and we still have excess precision problems for float. long double has
been available as part of GNU/Linux for so long that I don't think we
can take it away by default. That would upset too many people. This
can be done via a constructor, or by modifying the startup file.
Otherwise, the only solution is to avoid the x86 FP register stack.
This can be done by avoiding use of x86 hardware entirely. It can also
be done by using the SSE registers for FP.
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com