This is the mail archive of the 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

Alan Modra <> writes:
> touched this
> area, with Richard noting
>> While there, I noticed that the code didn't deal correctly with normal
>> values of the form 0x1.FFFFFFFFFFFFFx....P1023, where the high bit of "x"
>> is set.  The high part double will round to infinity, and so the extended
>> precision number will also be infinite.  However, at the moment, the low
>> part of this number will have a nonzero (negative) lowpart.
> [...]
> LDBL_MAX is a number of the above form, in fact x.... is a bunch of
> F's.  It's obvious that gcc's own value for LDBL_MAX ought to convert to
> a finite number!  So either LDBL_MAX needs adjusting or
> encode_ibm_extended needs to convert these numbers to finite values.
> I think the latter is the correct course.

Dunno about powerpc, but I think the first is right for MIPS.  According
to math(5), the low-part double is supposed to be within 0.5ULP of the
high part.  No special exception is given for the highest exponent.

Indeed, SGI's float.h definition of LDBL_MAX is:


== 0x1.FFFFFFFFFFFFF7FFFFFFFP1023L.  Try a higher number and MIPSpro cc
reports an error.


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