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: real.c implementation


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~


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