diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 17:02:24 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 17:02:24 +0000 |
commit | 2c8643c6396b0a3db33430cf9380e70bbb9efce0 (patch) | |
tree | 4df130b28021d86e13bf4565ef58c1c5a5e093b4 /contrib/llvm/utils/TableGen/X86DisassemblerShared.h | |
parent | 678318cd20f7db4e6c6b85d83fe00fa327b04fca (diff) | |
parent | e27feadae0885aa074df58ebfda2e7a7f7a7d590 (diff) | |
download | FreeBSD-src-2c8643c6396b0a3db33430cf9380e70bbb9efce0.zip FreeBSD-src-2c8643c6396b0a3db33430cf9380e70bbb9efce0.tar.gz |
Merge llvm 3.5.0 release from ^/vendor/llvm/dist, resolve conflicts, and
preserve our customizations, where necessary.
Diffstat (limited to 'contrib/llvm/utils/TableGen/X86DisassemblerShared.h')
-rw-r--r-- | contrib/llvm/utils/TableGen/X86DisassemblerShared.h | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/contrib/llvm/utils/TableGen/X86DisassemblerShared.h b/contrib/llvm/utils/TableGen/X86DisassemblerShared.h index 3ff922b..9e79b9c 100644 --- a/contrib/llvm/utils/TableGen/X86DisassemblerShared.h +++ b/contrib/llvm/utils/TableGen/X86DisassemblerShared.h @@ -13,27 +13,42 @@ #include <string.h> #include <string> -#define INSTRUCTION_SPECIFIER_FIELDS \ - struct OperandSpecifier operands[X86_MAX_OPERANDS]; \ - bool filtered; \ - InstructionContext insnContext; \ - std::string name; \ - \ - InstructionSpecifier() { \ - filtered = false; \ - insnContext = IC; \ - name = ""; \ - modifierType = MODIFIER_NONE; \ - modifierBase = 0; \ - memset(operands, 0, sizeof(operands)); \ +#include "../../lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h" + +struct InstructionSpecifier { + llvm::X86Disassembler::OperandSpecifier + operands[llvm::X86Disassembler::X86_MAX_OPERANDS]; + llvm::X86Disassembler::InstructionContext insnContext; + std::string name; + + InstructionSpecifier() { + insnContext = llvm::X86Disassembler::IC; + name = ""; + memset(operands, 0, sizeof(operands)); } +}; -#define INSTRUCTION_IDS \ - InstrUID instructionIDs[256]; +/// Specifies whether a ModR/M byte is needed and (if so) which +/// instruction each possible value of the ModR/M byte corresponds to. Once +/// this information is known, we have narrowed down to a single instruction. +struct ModRMDecision { + uint8_t modrm_type; + llvm::X86Disassembler::InstrUID instructionIDs[256]; +}; -#include "../../lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h" +/// Specifies which set of ModR/M->instruction tables to look at +/// given a particular opcode. +struct OpcodeDecision { + ModRMDecision modRMDecisions[256]; +}; -#undef INSTRUCTION_SPECIFIER_FIELDS -#undef INSTRUCTION_IDS +/// Specifies which opcode->instruction tables to look at given +/// a particular context (set of attributes). Since there are many possible +/// contexts, the decoder first uses CONTEXTS_SYM to determine which context +/// applies given a specific set of attributes. Hence there are only IC_max +/// entries in this table, rather than 2^(ATTR_max). +struct ContextDecision { + OpcodeDecision opcodeDecisions[llvm::X86Disassembler::IC_max]; +}; #endif |