std.math performance (SSE vs. real)

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 3 12:45:17 PDT 2014


On 7/3/2014 3:49 AM, Jonathan M Davis via Digitalmars-d wrote:
> I don't think that there's anything unclear about that. The problem is that if
> real is supposed to be the largest hardware supported floating point type,
> then that doesn't necessarily match long double. It happens to on x86 and
> x86_64, but it doesn't on other architectures.

As it turns out, C compilers tend to use long double for that. So there's no 
issue. In any case, it's up to the person porting the D compiler to that 
platform to make these decisions.

For another case, D for Win64 maps real to 80 bits, despite VC++ mapping long 
double to 64 bits. This is compatible with the D spec, because you are still 
able to call C functions typed as "int foo(long double r)" because D's double 
works for that.

I think that some common sense on a case by case basis for each platform should 
work fine.



More information about the Digitalmars-d mailing list