[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 03:45:34 PDT 2016


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

--- Comment #3 from Walter Bright <bugzilla at digitalmars.com> ---
The following code:

  import core.simd;

  auto load(in float* p) {
    enum regsz = 16;
    enum N = regsz / float.sizeof;
    alias vec = __vector(float[N]);
    return __simd(XMM.LODUPS, *cast(const vec*) p);
  }

  auto foo(float f) {
    return load(&f);
  }

produces in D with -O -inline for foo():

    _D5test23fooFNaNbNifZNhG16v:
        push    RBP
        mov    RBP,RSP
        movss    010h[RBP],XMM0
        movups    XMM0,010h[RBP]   <=====
        pop    RBP
        ret

So I'm not sure what the problem is.

--


More information about the Digitalmars-d-bugs mailing list