Please rid me of this goto

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 23 14:03:08 PDT 2016


On 06/23/2016 02:37 PM, Seb wrote:
> On Thursday, 23 June 2016 at 18:05:07 UTC, Andrei Alexandrescu wrote:
>> On 06/23/2016 01:34 PM, H. S. Teoh via Digitalmars-d wrote:
>>> I don't understand why that goto is necessary.
>>
>> Eh, thank you all who set me straight! I've been in my head for too
>> long. So where is the current implementation of "^^"? If it's not as
>> fast as this, we should replace it. -- Andrei
>
> ^^ seems to be lowered here
> https://github.com/dlang/dmd/blob/9903aba3b1d39bf499a54edbc81c7d9f08711f3e/src/constfold.d#L506
>
>
> and std.math.pow is defined here:
> https://github.com/dlang/phobos/blob/master/std/math.d#L6028

I see, thanks. Both seem to be ripe for the optimized version (they do 
more testing than necessary).

> However you should test how it performs against the LLVM intrinsics
> available in LDC, e.g.:
>
> llvm.intrinsincs.llvm_pow and llvm_powi (i = integer).

Cool! Is that a CPU operation?


Andrei


More information about the Digitalmars-d mailing list