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


On Wed, Mar 03, 2004 at 10:42:44PM -0800, Geoff Keating wrote:
> > Date: Thu, 4 Mar 2004 16:30:24 +1030
> > From: Alan Modra <amodra@bigpond.net.au>
> > 	* 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?

You mean c-cppbuiltins.c:builtin_define_float_constants, presumably,
possibly with some supporting changes to struct real_format.  Hmm, I
could detect ibm (and mips) format long doubles by looking at fmt->p
and fmt->pnan.  IBM format is the only one where they differ, and
fmt->pnan conveniently specifies the bit we need to zero.  Is that
too hacky?

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

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