!!!Please add intrinsics module for DMD DRuntime!!!

Johan Engelen via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 22 15:07:59 PST 2016


On Tuesday, 22 November 2016 at 22:57:22 UTC, Iain Buclaw wrote:
> On 22 November 2016 at 23:29, Daniel Kozak via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>> Dne 22.11.2016 v 17:36 Andrei Alexandrescu via Digitalmars-d 
>> napsal(a):
>>>
>>> The intent is to have the compiler detect the pattern and 
>>> insert the code. dmd does that IIRC (why is asm.dlang.org not 
>>> working again?) and so does gdc: 
>>> https://godbolt.org/g/WspkIX. -- Andrei
>>>
>> WTF? I hope you are not serious?
>
> Ilya, Andrei, or both?
>
> It's a compilers job is to detect code patterns and emit 
> suitable instructions for them. :-)

None of the compilers detect the body code pattern. I believe DMD 
and GDC just detect the mangled function name. Indeed, changing 
the function body to something else will still emit a "bsr" asm 
instruction: https://godbolt.org/g/x3WiEt
LDC chose to reimplement the functions using intrinsics.


More information about the Digitalmars-d mailing list