Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

Seb via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 4 14:38:52 PDT 2016


On Thursday, 4 August 2016 at 21:13:23 UTC, Iain Buclaw wrote:
> On 4 August 2016 at 01:00, Seb via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>> To make matters worse std.math yields different results than 
>> compiler/assembly intrinsics - note that in this example 
>> import std.math.pow adds about 1K instructions to the output 
>> assembler, whereas llvm_powf boils down to the assembly powf. 
>> Of course the performance of powf is a lot better, I measured 
>> [3] that e.g. std.math.pow takes ~1.5x as long for both LDC 
>> and DMD. Of course if you need to run this very often, this 
>> cost isn't acceptable.
>>
>
> This could be something specific to your architecture.  I get 
> the same result on from all versions of powf, and from GCC 
> builtins too, regardless of optimization tunings.

I can reproduce this on DPaste (also x86_64).

https://dpaste.dzfl.pl/c0ab5131b49d

Behavior with a recent LDC build is similar (as annotated with 
the comments).


More information about the Digitalmars-d mailing list