llvm.org GIT mirror llvm / 6f37488
Don't provide two different definitions of ModRMDecision, OpcodeDecision, and ContextDecision in different source files (depending on #define magic). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206720 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Smith 6 years ago
4 changed file(s) with 46 addition(s) and 43 deletion(s). Raw diff Collapse all Expand all
2020 #include "X86DisassemblerDecoder.h"
2121
2222 using namespace llvm::X86Disassembler;
23
24 /// Specifies whether a ModR/M byte is needed and (if so) which
25 /// instruction each possible value of the ModR/M byte corresponds to. Once
26 /// this information is known, we have narrowed down to a single instruction.
27 struct ModRMDecision {
28 uint8_t modrm_type;
29 uint16_t instructionIDs;
30 };
31
32 /// Specifies which set of ModR/M->instruction tables to look at
33 /// given a particular opcode.
34 struct OpcodeDecision {
35 ModRMDecision modRMDecisions[256];
36 };
37
38 /// Specifies which opcode->instruction tables to look at given
39 /// a particular context (set of attributes). Since there are many possible
40 /// contexts, the decoder first uses CONTEXTS_SYM to determine which context
41 /// applies given a specific set of attributes. Hence there are only IC_max
42 /// entries in this table, rather than 2^(ATTR_max).
43 struct ContextDecision {
44 OpcodeDecision opcodeDecisions[IC_max];
45 };
2346
2447 #include "X86GenDisassemblerTables.inc"
2548
1515 #ifndef X86DISASSEMBLERDECODER_H
1616 #define X86DISASSEMBLERDECODER_H
1717
18 #define INSTRUCTION_IDS \
19 uint16_t instructionIDs;
20
2118 #include "X86DisassemblerDecoderCommon.h"
22
23 #undef INSTRUCTION_SPECIFIER_FIELDS
24 #undef INSTRUCTION_IDS
2519
2620 namespace llvm {
2721 namespace X86Disassembler {
337337 #undef ENUM_ENTRY
338338
339339 /*
340 * ModRMDecision - Specifies whether a ModR/M byte is needed and (if so) which
341 * instruction each possible value of the ModR/M byte corresponds to. Once
342 * this information is known, we have narrowed down to a single instruction.
343 */
344 struct ModRMDecision {
345 uint8_t modrm_type;
346
347 /* The macro below must be defined wherever this file is included. */
348 INSTRUCTION_IDS
349 };
350
351 /*
352 * OpcodeDecision - Specifies which set of ModR/M->instruction tables to look at
353 * given a particular opcode.
354 */
355 struct OpcodeDecision {
356 ModRMDecision modRMDecisions[256];
357 };
358
359 /*
360 * ContextDecision - Specifies which opcode->instruction tables to look at given
361 * a particular context (set of attributes). Since there are many possible
362 * contexts, the decoder first uses CONTEXTS_SYM to determine which context
363 * applies given a specific set of attributes. Hence there are only IC_max
364 * entries in this table, rather than 2^(ATTR_max).
365 */
366 struct ContextDecision {
367 OpcodeDecision opcodeDecisions[IC_max];
368 };
369
370 /*
371340 * Physical encodings of instruction operands.
372341 */
373342
1212 #include
1313 #include
1414
15 #define INSTRUCTION_IDS \
16 InstrUID instructionIDs[256];
17
1815 #include "../../lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h"
19
20 #undef INSTRUCTION_SPECIFIER_FIELDS
21 #undef INSTRUCTION_IDS
2216
2317 struct InstructionSpecifier {
2418 llvm::X86Disassembler::OperandSpecifier operands[X86_MAX_OPERANDS];
3226 }
3327 };
3428
29 /// Specifies whether a ModR/M byte is needed and (if so) which
30 /// instruction each possible value of the ModR/M byte corresponds to. Once
31 /// this information is known, we have narrowed down to a single instruction.
32 struct ModRMDecision {
33 uint8_t modrm_type;
34 llvm::X86Disassembler::InstrUID instructionIDs[256];
35 };
36
37 /// Specifies which set of ModR/M->instruction tables to look at
38 /// given a particular opcode.
39 struct OpcodeDecision {
40 ModRMDecision modRMDecisions[256];
41 };
42
43 /// Specifies which opcode->instruction tables to look at given
44 /// a particular context (set of attributes). Since there are many possible
45 /// contexts, the decoder first uses CONTEXTS_SYM to determine which context
46 /// applies given a specific set of attributes. Hence there are only IC_max
47 /// entries in this table, rather than 2^(ATTR_max).
48 struct ContextDecision {
49 OpcodeDecision opcodeDecisions[llvm::X86Disassembler::IC_max];
50 };
51
3552 #endif