History

x86-asm: Correct mem64->xmm movq

Now we can express prefixes with 0x0fxx opcodes we can correct the movq mem64->xmm opcode, and restrict the movq xmm->mem64 movq to not invalidly accept mmx.

Michael Matz committed 10 years ago

Commit 58963821 parent 5a222583 files · +6 −11Browse files

Unified · Split

3 files
  1. i386-asm.h +2 −5
  2. tests/asmtest.S +1 −0
  3. x86_64-asm.h +3 −6
i386-asm.h+2−5
@@ -390,11 +390,8 @@ ALT(DEF_ASM_OP2(cmovo, 0x0f40, 0, OPC_MODRM | OPC_TEST | OPC_WLX, OPT_REGW | OPT · 389 unmodified lines
390390 DEF_ASM_OP2(movq, 0x0f6f, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX )
391391 ALT(DEF_ASM_OP2(movd, 0x0f7e, 0, OPC_MODRM, OPT_MMXSSE, OPT_EA | OPT_REG32 ))
392392 ALT(DEF_ASM_OP2(movq, 0x0f7f, 0, OPC_MODRM, OPT_MMX, OPT_EA | OPT_MMX ))
393− /* Hack: movq d6 only accepts xmm->mem/xmm, we use MMXSSE in source
394− to get the 0x66 prefix that is added automatically. The mmx->mem
395− is accepted by 0f7f above, and mmx->xmm doesn't exist (but is
396− invalidly accepted by this entry). */
397−ALT(DEF_ASM_OP2(movq, 0x0fd6, 0, OPC_MODRM, OPT_MMXSSE, OPT_EA | OPT_SSE ))
393+ALT(DEF_ASM_OP2(movq, 0x660fd6, 0, OPC_MODRM, OPT_SSE, OPT_EA | OPT_SSE ))
394+ALT(DEF_ASM_OP2(movq, 0xf30f7e, 0, OPC_MODRM, OPT_EA | OPT_SSE, OPT_SSE ))
398395
399396 DEF_ASM_OP2(packssdw, 0x0f6b, 0, OPC_MODRM, OPT_EA | OPT_MMXSSE, OPT_MMXSSE )
400397 DEF_ASM_OP2(packsswb, 0x0f63, 0, OPC_MODRM, OPT_EA | OPT_MMXSSE, OPT_MMXSSE )
tests/asmtest.S+1−0
@@ -738,6 +738,7 @@ ft1: ft2: ft3: ft4: ft5: ft6: ft7: ft8: ft9: · 737 unmodified lines
738738
739739 movq (%ebp), %mm1
740740 movq %mm2, (%edi)
741+ movq (%edi), %xmm3
741742 #ifdef __x86_64__
742743 movq %rcx, %mm1
743744 movq %rdx, %xmm2
x86_64-asm.h+3−6
@@ -398,15 +398,12 @@ ALT(DEF_ASM_OP2(movd, 0x0f6e, 0, OPC_MODRM, OPT_EA | OPT_REG64, OPT_MMXSSE )) · 397 unmodified lines
398398 mem->mmx/sse. 6E is disassembled by GAS as movd, so there would
399399 be discrepancies in the asmtest.S. */
400400 ALT(DEF_ASM_OP2(movq, 0x0f6f, 0, OPC_MODRM, OPT_EA | OPT_MMX, OPT_MMX ))
401−ALT(DEF_ASM_OP2(movq, 0x0f6e, 0, OPC_MODRM, OPT_EA | OPT_REG64, OPT_MMXSSE ))
401+ALT(DEF_ASM_OP2(movq, 0x480f6e, 0, OPC_MODRM, OPT_REG64, OPT_MMXSSE ))
402402 ALT(DEF_ASM_OP2(movd, 0x0f7e, 0, OPC_MODRM, OPT_MMXSSE, OPT_EA | OPT_REG32 ))
403403 ALT(DEF_ASM_OP2(movd, 0x0f7e, 0, OPC_MODRM, OPT_MMXSSE, OPT_EA | OPT_REG64 ))
404404 ALT(DEF_ASM_OP2(movq, 0x0f7f, 0, OPC_MODRM, OPT_MMX, OPT_EA | OPT_MMX ))
405− /* Hack: movq d6 only accepts xmm->mem/xmm, we use MMXSSE in source
406− to get the 0x66 prefix that is added automatically. The mmx->mem
407− is accepted by 0f7f above, and mmx->xmm doesn't exist (but is
408− invalidly accepted by this entry). */
409−ALT(DEF_ASM_OP2(movq, 0x0fd6, 0, OPC_MODRM, OPT_MMXSSE, OPT_EA | OPT_SSE ))
405+ALT(DEF_ASM_OP2(movq, 0x660fd6, 0, OPC_MODRM, OPT_SSE, OPT_EA | OPT_SSE ))
406+ALT(DEF_ASM_OP2(movq, 0xf30f7e, 0, OPC_MODRM, OPT_EA | OPT_SSE, OPT_SSE ))
410407 ALT(DEF_ASM_OP2(movq, 0x0f7e, 0, OPC_MODRM, OPT_MMXSSE, OPT_EA | OPT_REG64 ))
411408
412409 DEF_ASM_OP2(packssdw, 0x0f6b, 0, OPC_MODRM, OPT_EA | OPT_MMXSSE, OPT_MMXSSE )

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t