0

In GCC4.2(Xcode3), I use %R0/%Q0 to specify the high/low part of double word operand in inline assembly. But the following code generates error in llvm-gcc (Xcode4): error: invalid operand in inline asm: 'mov ${0:D}, $1

Can someone point me a solution?

    long long v1 = 0;
    long v2 = 1;
    __asm__(
        "mov %R0, %1\n\t"
        : "=&r" (v1)
        : "r" (v2)
    );
hc-song
  • 99
  • 3

1 Answers1

0

It's not supported in the current versions of llvm-gcc or clang (Apple LLVM Compiler). As a workaround, you can split the 64-bit value into two 32-bit variables, and reassemble the 64-bit value with shifts etc. The generated code should end up looking the same.

servn
  • 3,049
  • 14
  • 8