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


> X-Original-To: geoffk@foam.wonderslug.com
> Date: Sat, 6 Mar 2004 21:20:33 +1030
> From: Alan Modra <amodra@bigpond.net.au>
> Cc: gcc-patches@gcc.gnu.org, Geoff Keating <geoffk@geoffk.org>,
>         Andreas Jaeger <aj@suse.de>, Dwayne McConnell <dgm69@us.ibm.com>,
>         David Edelsohn <dje@watson.ibm.com>,
>         Marcus Meissner <meissner@suse.de>
> Mail-Followup-To: Steve Munroe <sjmunroe@us.ibm.com>,
> 	gcc-patches@gcc.gnu.org, Geoff Keating <geoffk@geoffk.org>,
> 	Andreas Jaeger <aj@suse.de>, Dwayne McConnell <dgm69@us.ibm.com>,
> 	David Edelsohn <dje@watson.ibm.com>,
> 	Marcus Meissner <meissner@suse.de>
> Content-Disposition: inline
> X-OriginalArrivalTime: 06 Mar 2004 10:50:37.0609 (UTC) FILETIME=[DC062990:01C40368]
> 
> On Fri, Mar 05, 2004 at 06:20:24PM -0600, Steve Munroe wrote:
> > +/* Powerpc64 uses the AIX long double format.
> > +   
> > +   Each long double is made up of two IEEE doubles.  The value of the
> > +   long double is the sum of the values of the two parts.  The most
> > +   significant part is required to be the value of the long double
> > +   rounded to the nearest double, as specified by IEEE.  For Inf
> > +   values, the least significant part is required to be one of +0.0 or
> > +   -0.0.
> 
> Do you know why this is required for Inf?  If there is a reason,
> then the patch I just posted to fix -0.0 is wrong..  (In any case,
> the patch is incomplete, as rs6000.md extenddftf2 also needs looking
> at.)
> 
> Hmm, I can see that if you represent +Inf by (+Inf + -Inf), you're
> in trouble, because converting to double will result in a Nan.
> Perhaps there is some sequence of operations that will result in
> (+Inf + +Inf) being turned into (+Inf + -Inf)?

If you represent +Inf by (+Inf, +/-Inf), then the code to convert a
double to a long double becomes significantly more complicated.  Right
now, it's done by just loading +0.0 in the low double.

You have to use the same value consistently, of course, or when you
compare two Inf values for == you might get the wrong answer.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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