GDC for x86_64!

Don Clugston dac at nospam.com.au
Thu Sep 21 03:59:18 PDT 2006


Anders F Björklund wrote:
> Gregor Richards wrote:
> 
>> I've made a (mostly untested) port of GDC 0.19 to x86_64.
>>
>> This required numerous patches to the frontend, and a few less patches 
>> to phobos.  I have another thread in digitalmars.D complaining about 
>> the phobos patches.
>>
>> Attached is a patch file for GDC 0.19.  Testers are welcome, I've only 
>> done some very simple "does this work at all" tests.
> 
> Sounds fun, I'm going to try it on PPC64. Attaching missing platform.
> 
>> PS: I've only tested this on an emulated x86_64 system
> 
> I am testing on Fedora Core 5 PowerPC, multi-lib ppc64 and ppc system.
> 
> --anders

Anders, could you do me a favour? I'd love to know what the following 
prints on a PowerPC CPU (and on x86-64, for that matter). It would be a 
great help for math library portability. It's amazingly hard to find 
documentation on this stuff. - Don.
---------
import std.stdio;

void show(double x)
{
     writefln("%f %08x", x, *cast(ulong*)&x);
}

void main()
{
     double x = double.init;
     double zero = 0.0;
     show(x);
     x = real.nan;
     show(x);
     ulong *p = cast(ulong *)&x;
     *p = 0xFFFF_FFFF_FFFF_FFFF;
     show(x);
     float f = x*5.2f;
     show(f);
     *p = 0xFFFF_ABCD_9876_FFFF;
     show(x);
     f = x;
     show(f);
     x = 35.61;
     x /= zero;
     show(x);
     x *= zero;
     show(x);
     x = 56.37;
     double y = x % zero;
     show(y);
     x = -y;
     show(x);
}



More information about the D.gnu mailing list