I'm trying to push an xmm register onto the stack in x86_64 C code using GCC-style inline assembly. I looked at the answer to this question and am using this code
int main(void) {
asm volatile("subq 16, %rsp");
asm volatile("movdqu xmm0, xmmword ptr (%rsp)");
}
and when I compile it on OS X 10.10.2 with clang 6.0, I get the error error: unexpected token in argument list, and a green arrow pointing to the ptr in the second asm line.
I change the code to
int main(void) {
asm volatile("subq 16, %rsp");
asm volatile("movdqu xmm0, xmmword (%rsp)");
}
and it gives me error: invalid operand for instruction. I've tried changing xmmword to dqword, to no avail, and I'm not sure what I'm doing wrong.
Thanks in advance.