std.math performance (SSE vs. real)

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 4 05:45:07 PDT 2014


On 4 Jul 2014 13:10, "Daniel Murphy via Digitalmars-d" <
digitalmars-d at puremagic.com> wrote:
>
> "Walter Bright"  wrote in message news:lp26l3$qlk$1 at digitalmars.com...
>
>
>> Per the D spec, 'real' will be the longest type supported by the native
hardware.
>
>
> So if you were targeting a processor with only soft-float real would be
undefined?  Fixing the widths of the integers was a great idea, and we
really should have done the same with the floating point types.  We could
easily have a library alias for what real currently means.
>

FP types are fixed.  float is 32bit, double 64bit.

>
>> Not only that, a marquee feature of D is interoperability with C. We'd
need an AWFULLY good reason to throw that under the bus.
>
>
> Unfortunately it's a useless definition for portable interop with C++.
 real needs to always match the size and mangling of long double unless you
want to stick workarounds all over the bindings.  We have related problems
with char/char/char and long/longlong/size_t, but luckily relatively few
interfaces actually use long double.

What 's the mangling problem with long double? There's only *one* long
double.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140704/40a00c67/attachment.html>


More information about the Digitalmars-d mailing list