aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/X86DisassemblerShared.h
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2009-12-19 02:59:52 +0000
committerSean Callanan <scallanan@apple.com>2009-12-19 02:59:52 +0000
commit8ed9f51663bc5533f36ca62e5668ae08e9a1313f (patch)
tree3054645839caee367e9403507d8487538819ed5b /utils/TableGen/X86DisassemblerShared.h
parente9ec6ad1ba5fd9ad70f5d0c059c5a5aa44f501f7 (diff)
downloadexternal_llvm-8ed9f51663bc5533f36ca62e5668ae08e9a1313f.zip
external_llvm-8ed9f51663bc5533f36ca62e5668ae08e9a1313f.tar.gz
external_llvm-8ed9f51663bc5533f36ca62e5668ae08e9a1313f.tar.bz2
Table-driven disassembler for the X86 architecture (16-, 32-, and 64-bit
incarnations), integrated into the MC framework. The disassembler is table-driven, using a custom TableGen backend to generate hierarchical tables optimized for fast decode. The disassembler consumes MemoryObjects and produces arrays of MCInsts, adhering to the abstract base class MCDisassembler (llvm/MC/MCDisassembler.h). The disassembler is documented in detail in - lib/Target/X86/Disassembler/X86Disassembler.cpp (disassembler runtime) - utils/TableGen/DisassemblerEmitter.cpp (table emitter) You can test the disassembler by running llvm-mc -disassemble for i386 or x86_64 targets. Please let me know if you encounter any problems with it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91749 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/X86DisassemblerShared.h')
-rw-r--r--utils/TableGen/X86DisassemblerShared.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/utils/TableGen/X86DisassemblerShared.h b/utils/TableGen/X86DisassemblerShared.h
new file mode 100644
index 0000000..9003cbf
--- /dev/null
+++ b/utils/TableGen/X86DisassemblerShared.h
@@ -0,0 +1,37 @@
+//===- X86DisassemblerShared.h - Emitter shared header ----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef X86DISASSEMBLERSHARED_H
+#define X86DISASSEMBLERSHARED_H
+
+#include <string>
+
+#define INSTRUCTION_SPECIFIER_FIELDS \
+ bool filtered; \
+ InstructionContext insnContext; \
+ std::string name; \
+ \
+ InstructionSpecifier() { \
+ filtered = false; \
+ insnContext = IC; \
+ name = ""; \
+ modifierType = MODIFIER_NONE; \
+ modifierBase = 0; \
+ bzero(operands, sizeof(operands)); \
+ }
+
+#define INSTRUCTION_IDS \
+ InstrUID instructionIDs[256];
+
+#include "../../lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h"
+
+#undef INSTRUCTION_SPECIFIER_FIELDS
+#undef INSTRUCTION_IDS
+
+#endif