[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Oct 9 13:03:07 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #7 from Walter Bright <bugzilla at digitalmars.com> ---
I propose putting the 'loadUnaligned' function in druntime. The point of having
it there is it only has to be ported once, then everyone can use it. There are
plenty of other examples of this in druntime.

> making this a function breaks LDC's fastmath optimizations.

... and ...

> A function can be inlined by LDC but it will break other possible optimisations.

I find this baffling. The whole point of inlining is to enable optimizations,
not disable them. Even if this were the case, the DMD front end inlines it, and
the LLVM back end will never see the function.

Lastly, the link going to the LDC code has this:

    version (LDC)
    {
        return loadUnaligned!vec(cast(T*) p);
    }

meaning that the LDC implementation is already a wrapper template function.

--


More information about the Digitalmars-d-bugs mailing list