summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2011-10-01 21:20:14 +0000
committerCraig Topper <craig.topper@gmail.com>2011-10-01 21:20:14 +0000
commit846a2dcada30a3507a1e9af9eabc2919674e669f (patch)
treefe131dbfd7aac9bac2dac9df092b4bd697a2c521
parente1b4a1a07ec79440536e4535721f15de3893cd13 (diff)
downloadllvm-846a2dcada30a3507a1e9af9eabc2919674e669f.tar.gz
llvm-846a2dcada30a3507a1e9af9eabc2919674e669f.tar.bz2
llvm-846a2dcada30a3507a1e9af9eabc2919674e669f.tar.xz
Fix disassembling of INVEPT and INVVPID to take operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140955 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86InstrVMX.td10
-rw-r--r--test/MC/Disassembler/X86/simple-tests.txt6
-rw-r--r--test/MC/Disassembler/X86/x86-32.txt5
-rw-r--r--utils/TableGen/X86RecognizableInstr.cpp2
4 files changed, 21 insertions, 2 deletions
diff --git a/lib/Target/X86/X86InstrVMX.td b/lib/Target/X86/X86InstrVMX.td
index daf61e4625..09a7a7d0c4 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 4f88caa4b5..768743555d 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 7df29546e8..75e6b16986 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 532e730705..787e4df081 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;