GDC release 0.23

Don Clugston dac at nospam.com.au
Tue Mar 6 08:23:42 PST 2007


Sean Kelly wrote:
> Anders F Björklund wrote:
>>>> GDC now supports 64-bit targets! A new x86_64 Linux binary is
>>>> available and the MacOS X binary supports x86_64 and ppc64.
>>>
>>> Excellent news! I'll try it on ppc64 Linux too (Fedora Core)
>>
>> Except for some strange (temporary?) build error with soft-float,
>> it built just fine for powerpc64-unknown-linux-gnu (with FC5/PPC*)
> 
> That reminds me.  Is it really a good idea to map the GCC/PPC "long 
> double" to "real" in D?  I know this has come up before:
> 
> http://www.digitalmars.com/d/archives/digitalmars/D/20790.html
> 
> and the data type seems like an aberration.  Here is some more info:
> 
> http://lists.apple.com/archives/Darwin-development/2001/Jan/msg00499.html
> 
> And from the ELF ABI:
> 
>     This "Extended precision" differs from the IEEE 754 Standard
>     in the following ways:
> 
>     * The software support is restricted to round-to-nearest
>       mode. Programs that use extended precision must ensure
>       that this rounding mode is in effect when
>       extended-precision calculations are performed.
>     * Does not fully support the IEEE special numbers NaN and
>       INF. These values are encoded in the high-order double
>       value only. The low-order value is not significant.
>     * Does not support the IEEE status flags for overflow,
>       underflow, and other conditions. These flag have no
>       meaning in this format.
> 
> I can't claim to have the maths background of some folks here, but this 
> suggests to me that this 128-bit representation isn't truly IEEE-754 
> compliant and therefore probably shouldn't be a default data type in D?
> 
> 
> Sean

Sean, thanks for posting that; I was about to do the same.

The IEEE-754 standard is pretty clear on the fact that these 
double-doubles are *NOT* IEEE-754 compliant. (In fact, storing the 
significand in two parts is already enough to be non-compliant).

Allowing this as a 'real' is a bit of a disaster; for example, it means 
that IEEE status flags and precision modes cannot be used portably on 
any platform, and it makes support for even basic mathematical functions 
extremely difficult.

The stupid thing is, that the underlying double-double type exists on 
all platforms! There would be great benefit someday in supporting 
double-doubles in the compiler -- just not as a 'real'.

IMHO, 'real' should map to 'double' on PPC.



More information about the Digitalmars-d-announce mailing list