From 43fd621df8f353415235ae76cd3d6bddf504f7c4 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 1 Oct 2011 21:20:14 +0000 Subject: [PATCH] Fix disassembling of INVEPT and INVVPID to take operands llvm-svn: 140955 --- lib/Target/X86/X86InstrVMX.td | 10 ++++++++-- test/MC/Disassembler/X86/simple-tests.txt | 6 ++++++ test/MC/Disassembler/X86/x86-32.txt | 5 +++++ utils/TableGen/X86RecognizableInstr.cpp | 2 ++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/X86InstrVMX.td b/lib/Target/X86/X86InstrVMX.td index daf61e4625d..09a7a7d0c4d 100644 --- a/lib/Target/X86/X86InstrVMX.td +++ b/lib/Target/X86/X86InstrVMX.td @@ -16,9 +16,15 @@ // VMX instructions // 66 0F 38 80 -def INVEPT : I<0x80, RawFrm, (outs), (ins), "invept", []>, OpSize, T8; +def INVEPT32 : I<0x80, MRMSrcMem, (outs), (ins GR32:$src1, i128mem:$src2), + "invept {$src2, $src1|$src1, $src2}", []>, OpSize, T8; +def INVEPT64 : I<0x80, MRMSrcMem, (outs), (ins GR64:$src1, i128mem:$src2), + "invept {$src2, $src1|$src1, $src2}", []>, OpSize, T8; // 66 0F 38 81 -def INVVPID : I<0x81, RawFrm, (outs), (ins), "invvpid", []>, OpSize, T8; +def INVVPID32 : I<0x81, MRMSrcMem, (outs), (ins GR32:$src1, i128mem:$src2), + "invvpid {$src2, $src1|$src1, $src2}", []>, OpSize, T8; +def INVVPID64 : I<0x81, MRMSrcMem, (outs), (ins GR64:$src1, i128mem:$src2), + "invvpid {$src2, $src1|$src1, $src2}", []>, OpSize, T8; // 0F 01 C1 def VMCALL : I<0x01, MRM_C1, (outs), (ins), "vmcall", []>, TB; def VMCLEARm : I<0xC7, MRM6m, (outs), (ins i64mem:$vmcs), diff --git a/test/MC/Disassembler/X86/simple-tests.txt b/test/MC/Disassembler/X86/simple-tests.txt index 4f88caa4b5c..768743555d7 100644 --- a/test/MC/Disassembler/X86/simple-tests.txt +++ b/test/MC/Disassembler/X86/simple-tests.txt @@ -302,3 +302,9 @@ # CHECK: crc32q %rax, %rax 0xf2 0x48 0x0f 0x38 0xf1 0xc0 + +# CHECK: invept (%rax), %rax +0x66 0x0f 0x38 0x80 0x00 + +# CHECK: invvpid (%rax), %rax +0x66 0x0f 0x38 0x81 0x00 diff --git a/test/MC/Disassembler/X86/x86-32.txt b/test/MC/Disassembler/X86/x86-32.txt index 7df29546e8a..75e6b169864 100644 --- a/test/MC/Disassembler/X86/x86-32.txt +++ b/test/MC/Disassembler/X86/x86-32.txt @@ -322,3 +322,8 @@ # CHECK: vroundsd $0, %xmm0, %xmm0, %xmm0 0xc4 0xe3 0x79 0x0b 0xc0 0x00 +# CHECK: invept (%eax), %eax +0x66 0x0f 0x38 0x80 0x00 + +# CHECK: invvpid (%eax), %eax +0x66 0x0f 0x38 0x81 0x00 diff --git a/utils/TableGen/X86RecognizableInstr.cpp b/utils/TableGen/X86RecognizableInstr.cpp index 532e7307050..787e4df081b 100644 --- a/utils/TableGen/X86RecognizableInstr.cpp +++ b/utils/TableGen/X86RecognizableInstr.cpp @@ -255,6 +255,8 @@ RecognizableInstr::RecognizableInstr(DisassemblerTables &tables, Rec->getName() == "REX64_PREFIX" || Rec->getName().find("VMREAD64") != Name.npos || Rec->getName().find("VMWRITE64") != Name.npos || + Rec->getName().find("INVEPT64") != Name.npos || + Rec->getName().find("INVVPID64") != Name.npos || Rec->getName().find("MOV64") != Name.npos || Rec->getName().find("PUSH64") != Name.npos || Rec->getName().find("POP64") != Name.npos;