This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: real.c implementation
- From: Richard Henderson <rth at redhat dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: aph at redhat dot com, gcc at gcc dot gnu dot org
- Date: Tue, 22 Oct 2002 11:00:28 -0700
- Subject: Re: real.c implementation
- References: <20021022105831.B7E89F2D65@nile.gnat.com>
On Tue, Oct 22, 2002 at 06:58:31AM -0400, Robert Dewar wrote:
> Well if you define "The Right Thing" to be what Java needs, fine, but then
> this would be wrong for Ada, since Ada requires that float literals be
> rounded away from infinity (0.5 always rounds up).
Easy enough to handle with an argument to the real_from_string
function.
> What about the handling of denormals?
What about them? They should work as advertized.
The main reason for the recent real.c rewrite was to fix this
very issue for double-extended and quad ieee formats, so if
you remember problems with denormals in the past, they are in
theory fixed now. You should definitely re-test.
> Also, the issue of what should be done on non-IEEE machines is not clear.
> For example, on the Alpha, you probably do not want to generate denormal
> literals by default.
We do now. We did have code in the compiler to prevent this
(unconditionally, mind!) until recently; I considered this a
bug and removed it. If you don't want to trap on denormals,
then don't write denormal constants. Simple as that.
As for truely non-ieee machines, well, we do the best we can.
r~