|
From: John R.
|
> In none/tests/amd64/pcmpxstrx64.c and none/tests/amd64/pcmpxstrx64w.c > complains about all occurrences of: > > "movupd 48(%0), %%xmm0" > "movupd %%xmm0, 48(%0)" > > For instance: > > pcmpxstrx64.c:79:46: error: invalid operand for instruction > "movupd 48(%0), %%xmm0" "\n\t" > ^ This is legal code; if clang rejects the code then clang has a bug. -----foo.S movupd 48(%rdi), %xmm0 movupd %xmm0, 48(%rdi) nop nop nop ----- $ gcc -c foo.S $ gdb foo.o (gdb) x/2i 0 0x0: movupd 0x30(%rdi),%xmm0 0x5: movupd %xmm0,0x30(%rdi) (gdb) x/xg 0 0x0: 0x110f663047100f66 (gdb) x/xg 5 0x5: 0x9090903047110f66 > <inline asm>:6:22: note: instantiated into assembly here > movw 64(%rdi), %rcx > ^~~~ Should be "%cx" which is 16 bits, instead of "%rcx" which is 64 bits. gcc accepts sloppiness. > > > In none/tests/amd64/insn_sse.c > complains about the pextrw insn like so: > > insn_sse.c:4602:11: error: invalid operand for instruction > "pextrw $0, %%mm6, %%r9\n" > ^ > <inline asm>:7:1: note: instantiated into assembly here > pextrw $0, %mm6, %r9 > ^ This is legal code. If clang rejects the code, then clang has a bug. Note that pextrw has multiple encodings: SSE: 0F C5 /r ib (no 66 prefix) SSE2: 66 0F C5 /r ib SSE4.1: 66 0F 3A 15 /r ib while pextrb/d/q uses: SSE4.1: 66 0F 3A 14 /r ib pextrb SSE4.1: 66 0F 3A 16 /r ib pextrd SSE4.1: 66 REX.W 0F 3A 16 /r ib pextrq This may well have confused clang. [Lines in the table above have extra spaces for the purpose of aligning like columns.] (gdb) 0xa: pextrw $0x0,%mm6,%r9d (gdb) 0xf: nop (gdb) x/xg 0xa 0xa: 0x90909000cec50f44 where the 0x44 prefix is a REX.r for %r9. > > > In exp-bbv/tests/amd64-linux/fldcw_check.S: > > movw %rax, cw > error: invalid operand for instruction > movw %rax, cw # store back to memory > ^~~~ Should be "%ax" which is 16 bits, instead of "%rax" which is 64 bits. gcc accepts sloppiness. -- |