|
LLVM
8.0.1
|
Classes | |
| struct | InstructionSpecifier |
| The specification for how to extract and interpret a full instruction and its operands. More... | |
| struct | InternalInstruction |
| The x86 internal instruction, which is produced by the decoder. More... | |
| struct | OperandSpecifier |
| The specification for how to extract and interpret one operand. More... | |
Typedefs | |
| typedef uint16_t | InstrUID |
| typedef int(* | byteReader_t) (const void *arg, uint8_t *byte, uint64_t address) |
| Type for the byte reader that the consumer must provide to the decoder. More... | |
| typedef void(* | dlog_t) (void *arg, const char *log) |
| Type for the logging function that the consumer can provide to get debugging output from the decoder. More... | |
Functions | |
| int | decodeInstruction (InternalInstruction *insn, byteReader_t reader, const void *readerArg, dlog_t logger, void *loggerArg, const void *miiArg, uint64_t startLoc, DisassemblerMode mode) |
| Decode one instruction and store the decoding results in a buffer provided by the consumer. More... | |
| void | Debug (const char *file, unsigned line, const char *s) |
| Print a message to debugs() More... | |
| StringRef | GetInstrName (unsigned Opcode, const void *mii) |
Variables | |
| static const unsigned | X86_MAX_OPERANDS = 6 |
| typedef int(* llvm::X86Disassembler::byteReader_t) (const void *arg, uint8_t *byte, uint64_t address) |
Type for the byte reader that the consumer must provide to the decoder.
Reads a single byte from the instruction's address space.
| arg | A baton that the consumer can associate with any internal state that it needs. |
| byte | A pointer to a single byte in memory that should be set to contain the value at address. |
| address | The address in the instruction's address space that should be read from. |
Definition at line 508 of file X86DisassemblerDecoder.h.
Type for the logging function that the consumer can provide to get debugging output from the decoder.
| arg | A baton that the consumer can associate with any internal state that it needs. |
| log | A string that contains the message. Will be reused after the logger returns. |
Definition at line 516 of file X86DisassemblerDecoder.h.
| typedef uint16_t llvm::X86Disassembler::InstrUID |
Definition at line 310 of file X86DisassemblerDecoderCommon.h.
| Enumerator | |
|---|---|
| ATTR_max | |
Definition at line 68 of file X86DisassemblerDecoderCommon.h.
Decoding mode for the Intel disassembler.
16-bit, 32-bit, and 64-bit mode are supported, and represent real mode, IA-32e, and IA-32e in 64-bit mode, respectively.
| Enumerator | |
|---|---|
| MODE_16BIT | |
| MODE_32BIT | |
| MODE_64BIT | |
Definition at line 466 of file X86DisassemblerDecoderCommon.h.
All possible values of the base field for effective-address computations, a.k.a.
the Mod and R/M fields of the ModR/M byte. We distinguish between bases (EA_BASE_*) and registers that just happen to be referred to when Mod == 0b11 (EA_REG_*).
| Enumerator | |
|---|---|
| EA_BASE_NONE | |
| EA_max | |
Definition at line 407 of file X86DisassemblerDecoder.h.
Possible displacement types for effective-address computations.
| Enumerator | |
|---|---|
| EA_DISP_NONE | |
| EA_DISP_8 | |
| EA_DISP_16 | |
| EA_DISP_32 | |
Definition at line 443 of file X86DisassemblerDecoder.h.
| Enumerator | |
|---|---|
| IC_max | |
Definition at line 284 of file X86DisassemblerDecoderCommon.h.
| Enumerator | |
|---|---|
| MODRM_max | |
Definition at line 336 of file X86DisassemblerDecoderCommon.h.
| Enumerator | |
|---|---|
| ONEBYTE | |
| TWOBYTE | |
| THREEBYTE_38 | |
| THREEBYTE_3A | |
| XOP8_MAP | |
| XOP9_MAP | |
| XOPA_MAP | |
| THREEDNOW_MAP | |
Definition at line 292 of file X86DisassemblerDecoderCommon.h.
| Enumerator | |
|---|---|
| ENCODING_max | |
Definition at line 403 of file X86DisassemblerDecoderCommon.h.
| Enumerator | |
|---|---|
| TYPE_max | |
Definition at line 449 of file X86DisassemblerDecoderCommon.h.
All possible values of the reg field in the ModR/M byte.
| Enumerator | |
|---|---|
| MODRM_REG_max | |
Definition at line 451 of file X86DisassemblerDecoder.h.
All possible segment overrides.
| Enumerator | |
|---|---|
| SEG_OVERRIDE_NONE | |
| SEG_OVERRIDE_CS | |
| SEG_OVERRIDE_SS | |
| SEG_OVERRIDE_DS | |
| SEG_OVERRIDE_ES | |
| SEG_OVERRIDE_FS | |
| SEG_OVERRIDE_GS | |
| SEG_OVERRIDE_max | |
Definition at line 459 of file X86DisassemblerDecoder.h.
All possible values of the SIB base field.
| Enumerator | |
|---|---|
| SIB_BASE_NONE | |
| SIB_BASE_max | |
Definition at line 434 of file X86DisassemblerDecoder.h.
All possible values of the SIB index field.
borrows entries from ALL_EA_BASES with the special case that sib is synonymous with NONE. Vector SIB: index can be XMM or YMM.
| Enumerator | |
|---|---|
| SIB_INDEX_NONE | |
| SIB_INDEX_max | |
Definition at line 422 of file X86DisassemblerDecoder.h.
| Enumerator | |
|---|---|
| TYPE_NO_VEX_XOP | |
| TYPE_VEX_2B | |
| TYPE_VEX_3B | |
| TYPE_EVEX | |
| TYPE_XOP | |
Definition at line 491 of file X86DisassemblerDecoder.h.
Possible values for the VEX.m-mmmm field.
| Enumerator | |
|---|---|
| VEX_LOB_0F | |
| VEX_LOB_0F38 | |
| VEX_LOB_0F3A | |
Definition at line 471 of file X86DisassemblerDecoder.h.
Possible values for the VEX.pp/EVEX.pp field.
| Enumerator | |
|---|---|
| VEX_PREFIX_NONE | |
| VEX_PREFIX_66 | |
| VEX_PREFIX_F3 | |
| VEX_PREFIX_F2 | |
Definition at line 484 of file X86DisassemblerDecoder.h.
| Enumerator | |
|---|---|
| XOP_MAP_SELECT_8 | |
| XOP_MAP_SELECT_9 | |
| XOP_MAP_SELECT_A | |
Definition at line 477 of file X86DisassemblerDecoder.h.
Print a message to debugs()
| file | The name of the file printing the debug message. |
| line | The line number that printed the debug message. |
| s | The message to print. |
Definition at line 95 of file X86Disassembler.cpp.
References llvm::dbgs().
| int llvm::X86Disassembler::decodeInstruction | ( | InternalInstruction * | insn, |
| byteReader_t | reader, | ||
| const void * | readerArg, | ||
| dlog_t | logger, | ||
| void * | loggerArg, | ||
| const void * | miiArg, | ||
| uint64_t | startLoc, | ||
| DisassemblerMode | mode | ||
| ) |
Decode one instruction and store the decoding results in a buffer provided by the consumer.
| insn | The buffer to store the instruction in. Allocated by the consumer. |
| reader | The byteReader_t for the bytes to be read. |
| readerArg | An argument to pass to the reader for storing context specific to the consumer. May be NULL. |
| logger | The dlog_t to be used in printing status messages from the disassembler. May be NULL. |
| loggerArg | An argument to pass to the logger for storing context specific to the logger. May be NULL. |
| startLoc | The address (in the reader's address space) of the first byte in the instruction. |
| mode | The mode (16-bit, 32-bit, 64-bit) to decode in. |
Definition at line 1899 of file X86DisassemblerDecoder.cpp.
References dbgprintf(), llvm::X86Disassembler::InternalInstruction::dlog, llvm::X86Disassembler::InternalInstruction::dlogArg, getID(), llvm::X86Disassembler::InternalInstruction::instructionID, llvm::X86Disassembler::InternalInstruction::length, logger(), llvm::Intrinsic::memset, mode, llvm::X86Disassembler::InternalInstruction::mode, llvm::X86Disassembler::InternalInstruction::numImmediatesConsumed, llvm::X86Disassembler::InstructionSpecifier::operands, llvm::X86Disassembler::InternalInstruction::operands, llvm::X86Disassembler::InternalInstruction::reader, llvm::X86Disassembler::InternalInstruction::readerArg, llvm::X86Disassembler::InternalInstruction::readerCursor, readOpcode(), readOperands(), readPrefixes(), llvm::X86Disassembler::InternalInstruction::spec, and llvm::X86Disassembler::InternalInstruction::startLocation.
Referenced by AddThumb1SBit(), adjustDuplex(), checkDecodedInstruction(), decodeBDVAddr64Disp12Operand(), decodeCRBitMOperand(), decodeFRMArg(), DecodeL4RSrcDstSrcDstInstruction(), DecodeMoveHRegInstruction(), getDecoderTable(), llvm::AArch64Disassembler::getInstruction(), llvm::LanaiDisassembler::getInstruction(), logger(), readInstruction32(), readInstruction64(), and llvm::AMDGPUDisassembler::tryDecodeInst().
Definition at line 100 of file X86Disassembler.cpp.
References llvm::MCInstrInfo::getName().
Referenced by getID().
Definition at line 461 of file X86DisassemblerDecoderCommon.h.
1.8.13