Please rid me of this goto

Seb via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 23 11:37:35 PDT 2016


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

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).


More information about the Digitalmars-d mailing list