This is the mail archive of the
mailing list for the GCC project.
Re: Powerpc64 long double support
On Wed, Mar 10, 2004 at 09:31:13PM +1030, Alan Modra wrote:
> On Wed, Mar 10, 2004 at 09:42:36AM +0000, Richard Sandiford wrote:
> > when compiled with MIPSpro cc.
> Does MIPSpro correctly convert a long double -0.0 to double -0.0? Does
> mips gcc?
The reason for -0.0 in the low double goes like this:
Conversion from long double to double is done by simply adding the
two component doubles. That means long double -0.0 must be
(-0.0 + -0.0), or you need to add code to handle -0.0 on every
Conversion from double to long double is done by using the double
in the high part and making the low part zero. For consistency
(and correct conversion back to double), the low part must be -0.0
when the double is -0.0. Again, if you want +0.0, +Inf, -Inf to
have +0.0 as the low double, then you need something more complicated
than just loading a constant value in the low double.
IBM OzLabs - Linux Technology Centre