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: rs6000 LDBL_MAX converts to infinity


> Date: Thu, 4 Mar 2004 16:30:24 +1030
> From: Alan Modra <amodra@bigpond.net.au>

> On Wed, Mar 03, 2004 at 01:53:09PM -0800, Geoff Keating wrote:
> > I believe that the answer to this particular one is to change
> > LDBL_MAX; it should always be the case that the high part is the sum
> > of the high and low parts in round-to-nearest mode.
> 
> The value I'm using here is 0x1.fffffffffffff7ffffffffffff8p1023
> converted to decimal exactly as builtin_define_float_constants does.
> It's slightly different to the value reported by Richard for SGI's
> float.h.  I did check that it converts back to sensible asm.  :)
> 
> 	* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Set __LDBL_MAX__.
> 	* real.c (encode_ibm_extended): Don't bother rounding low double.

Shouldn't the first part also be a patch to real.c?

The second part looks right to me but should really leave a comment in
the code saying why the value is already rounded.

-- 
- 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]