std.math performance (SSE vs. real)

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 2 20:48:10 PDT 2014


On Thursday, 3 July 2014 at 01:13:13 UTC, H. S. Teoh via 
Digitalmars-d wrote:
>
> I'm not sure I understand how removing support 80-bit floats 
> hurts interoperability with C? I thought none of the standard C 
> float types map to the x87 80-bit float?

The C spec never says anything specific about representation 
because it's meant to target anything, but the x86 and AMD64 ABIs 
basically say that "long double" is 80-bit for calculations.  The 
x86 spec says that the type is stored in 96 bits though, and the 
AMD64 spec says they're stored in 128 bits for alignment purposes.

I'm still unclear whether we're aiming for C interoperability or 
hardware support though, based on Walter's remark about SPARC and 
PPC.  There, 'long double' is represented differently but is not 
backed by specialized hardware, so I'm guessing D would make 
'real' 64-bits on these platforms and break compatibility with C. 
  So... I guess we really do need a special alias for C 
compatibility, and this can map to whatever intrinsic type the 
applicable compiler supports for that platform.


More information about the Digitalmars-d mailing list