GDC for x86_64!

Don Clugston dac at nospam.com.au
Thu Sep 21 06:07:06 PDT 2006


Anders F Björklund wrote:
> Don Clugston wrote:
> 
>> 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.
> 
> Here you go: (PPC)
> nan 7ff8000000000000
> nan 7ff8000000000000
> nan ffffffffffffffff
> nan ffffffffe0000000
> nan ffffabcd9876ffff
> nan ffffabcd80000000
> inf 7ff0000000000000
> nan 7ff8000000000000
> nan 7ff8000000000009
> nan fff8000000000009

Thanks! That's fascinating, the last two lines is a real surprise 
(totally different to the x86 behaviour). Where the heck did that '9' 
come from??

> BTW "real" and "double"
> are the same size here.

Yes, that's part of the reason for my interest in it. It's BigEndian 
too, isn't it?


 > If you are doing further development, the easiest is
 > probably to get a full PowerPC emulator environment ?
 >
 > Like this one, for instance: http://pearpc.sf.net/

I know about PearPC, but what I was testing just then is the least 
likely part of the CPU emulation to be tested properly; I reckon that if 
they got that wrong, it wouldn't break any code. (I bet it doesn't give 
those '9's).



More information about the D.gnu mailing list