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

--- Comment #4 from Jonathan Dunlap <[email protected]> ---
I'm having an issue adding an asm block for the fast increment by operation.
It's been awhile since I've used asm productively so I'm probably missing
something simple.

HeadUnshared!(T) atomicOp(string op, T, V1)( ref shared T val, V1 mod ) pure
nothrow @nogc
        if( __traits( compiles, mixin( "*cast(T*)&val" ~ op ~ "mod" ) ) )
[....]
get = set = atomicLoad!(MemoryOrder.raw)( val );

auto setptr = &set;
static if(op == "+=") {
  // qword ptr
  asm pure nothrow @nogc
  {
    mov EAX, mod;    //:678
    mov EDX, setptr; //:679
    lock; 
    xadd [EDX], EAX;
  }
}

Error:
src/core/atomic.d(678): Error: bad type/size of operands 'mov'
src/core/atomic.d(679): Error: bad type/size of operands 'mov'

--

Reply via email to