This is the mail archive of the gcc-patches@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: Powerpc64 long double support


On Wed, Mar 10, 2004 at 11:25:38AM +0000, Richard Sandiford wrote:
> Alan Modra <amodra@bigpond.net.au> writes:
> > 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.
> 
> Not sure: are you saying that's what the spec says you should do, or
> that is it just what a particular implementation does?

No, I'm not talking about any spec or other implementation.  I'm just
following through the logical implications of using the simplest
long double -> double -> long double conversion sequences.

>  As per my
> previous message, IRIX uses +0.0 for the low double and it still gets
> the conversion right.  I assume it must be using something other than
> simple addition.

I'm curious as to what it uses.

> My only concern (in case it wasn't obvious ;) is that you don't
> change the behaviour for IRIX.

Easy.  I can add this.

  else if (!fmt->qnan_msb_set)
    {
      /* MIPS slavishly follows proprietary compilers, which use 0.0
	 in the low word.  */
      buf[2] = 0;
      buf[3] = 0;
    }

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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