[Issue 19443] core.simd generates incorrect code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 28 09:56:45 UTC 2020


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

--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> ---
Here's the attachment:

/*dmd -m64 movhlps.d*/
import std.stdio;
import core.simd;

void main ()
{
        float4 a = [1, 2, 4, 8];
        float4 b = [2, 3, 5, 7];
        writefln ("expected result: [5, 7, 4, 8]");
        //Does not produce the expected result
        writefln ("core.simd: %s", simd!(XMM.MOVHLPS) (a, b));
        //But this does. How mysterious!
        float4 res;
        asm
        {
                movaps XMM0, a;
                movaps XMM1, b;
                movhlps XMM0, XMM1;
                movaps res, XMM0;
        }
        writefln ("asm: %s", res);
}

--


More information about the Digitalmars-d-bugs mailing list