[Issue 15144] Bad operand size in asm { movdqa ... } produces bogus ubyte16 initializer error elsewhere.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Oct 3 13:38:33 PDT 2015


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

--- Comment #1 from Marco Leise <Marco.Leise at gmx.de> ---
Ok, using `movdqa XMM0, csXMM;` it works when the `SSEFromString` is changed to
declare the vector as __gshared instead of immutable. So DMD has trouble
sorting things out when they are read-only data.

    void foo()
    {
        version (D_InlineAsm_X86_64)
        {
            alias csXMM = SSEFromString!`abc`;
            asm @nogc nothrow
            {
                movdqa      XMM0, csXMM;
            }
        }
        else static assert(0, "Not implemented");
    }

    template SSEFromString(string str)
    {
        import std.algorithm, std.range;

        version (DigitalMars)
            __gshared ubyte16 SIMDFromString = chain(str,
'\0'.repeat(ubyte16.sizeof - str.length)).array;
        else
            immutable ubyte16 SIMDFromString = chain(str,
'\0'.repeat(ubyte16.sizeof - str.length)).array;
    }

--


More information about the Digitalmars-d-bugs mailing list