GDC release 0.23
Anders F Björklund
afb at algonet.se
Wed Mar 7 12:00:59 PST 2007
Walter Bright wrote:
> I don't really understand the issues with the PPC 'double double', but:
>
> 1) real.sizeof is 10 on Win32, and 12 on Linux. This caused some (now
> fixed) compiler bugs, but shouldn't have affected any user code.
And real.sizeof is now 16 on Linux for X86_64 (even *more* padding)
> 2) D floating point arithmetic is supposed to be IEEE 754. Some wacky
> real type for the PPC is going to cause grief and break code in
> irritating and unforeseeable ways.
So basically we need to change PPC use of "long double" to "double"
> 3) The D implementation is allowed to evaluate floating point ops in
> higher precision than that specified by the type. FP algorithms should
> be coded to not break if more accurate answers are delivered.
But those higher evaluations should still be IEEE standard compatible.
> 4) I suggest supporting the wacky PPC double double with:
> a) a special type, like __doubledouble, that is NOT real, ireal, or creal.
> b) real should map to C's double, but still be a distinct type to the
> compiler
> c) if doing __doubledouble is a pain as an inbuilt type, perhaps do it
> as a struct and a library type?
That should pretty much settle it, then. GDC's "real" needs changing,
so that it uses C "double" on PPC even if "long double" is available.
(no idea how much work a __doubledouble or such D type would be to do,
but it is probably needed for interop with C "long double" routines...)
I think we can use the -mlong-double-64 option in the interim, minus
the C/C++ compatibility part (but not much uses "long double" on PPC)
--anders
More information about the D.gnu
mailing list