Go to the documentation of this file.
35 #include "debug/Decoder.hh"
136 panic(
"Went to the error state in the decoder.\n");
180 uint8_t prefix =
Prefixes[nextByte];
238 panic(
"Unrecognized prefix %#x\n", nextByte);
247 Vex2Of2 vex = nextByte;
282 nextByte >= 0xA0 && nextByte <= 0xA3);
286 Vex2Of3 vex = nextByte;
323 nextByte >= 0xA0 && nextByte <= 0xA3);
327 Vex3Of3 vex = nextByte;
362 case ThreeByte0F38Opcode:
365 case ThreeByte0F3AOpcode:
381 if (nextByte == 0x0f) {
390 nextByte >= 0xA0 && nextByte <= 0xA3);
402 if (nextByte == 0x38) {
405 }
else if (nextByte == 0x3a) {
425 DPRINTF(
Decoder,
"Found three byte 0F38 opcode %#x.\n", nextByte);
439 DPRINTF(
Decoder,
"Found three byte 0F3A opcode %#x.\n", nextByte);
485 int immType = immTable[
opcode];
512 ModRM modRM = nextByte;
516 if ((modRM.mod == 0 && modRM.rm == 6) || modRM.mod == 2)
518 else if (modRM.mod == 1)
524 if ((modRM.mod == 0 && modRM.rm == 5) || modRM.mod == 2)
526 else if (modRM.mod == 1)
534 if (
emi.
opcode.
type == OneByteOpcode && (modRM.reg & 0x6) == 0) {
543 if (modRM.rm == 4 && modRM.mod != 3) {
593 DPRINTF(
Decoder,
"Collecting %d byte displacement, got %d bytes.\n",
612 panic(
"Undefined displacement size!\n");
677 auto iter =
instMap->find(mach_inst);
682 (*instMap)[mach_inst] =
si;
700 const int chunkSize =
sizeof(
MachInst);
708 int start = firstOffset;
712 int end = start + totalSize;
713 end = (chunkSize < end) ? chunkSize : end;
714 int size = end - start;
static ByteTable UsesModRMThreeByte0F38
void updateNPC(X86ISA::PCState &nextPC)
std::vector< MachInst > chunks
static const uint8_t SizeTypeToSize[3][10]
struct X86ISA::ExtMachInst::@22 opcode
void getImmediate(int &collected, uint64_t ¤t, int size)
static ByteTable UsesModRMThreeByte0F3A
@ ThreeByte0F3AOpcodeState
State doVex2Of3State(uint8_t)
State doPrefixState(uint8_t)
StaticInstPtr fetchMicroop(MicroPC microPC, StaticInstPtr curMacroop)
StaticInstPtr decodeInst(ExtMachInst mach_inst)
State doVex3Of3State(uint8_t)
State doTwoByteOpcodeState(uint8_t)
static ByteTable UsesModRMTwoByte
State doSIBState(uint8_t)
static ByteTable ImmediateTypeThreeByte0F3A
Value & lookup(Addr addr)
static ByteTable ImmediateTypeTwoByte
State processOpcode(ByteTable &immTable, ByteTable &modrmTable, bool addrSizedImm=false)
State doModRMState(uint8_t)
static ByteTable UsesModRMOneByte
State doVexOpcodeState(uint8_t)
DecodePages * decodePages
StaticInstPtr fetchRomMicroop(MicroPC micropc, StaticInstPtr curMacroop) override
This is exposed globally, independent of the ISA.
static InstCacheMap instCacheMap
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Bitfield< 24, 21 > opcode
static ByteTable ImmediateTypeOneByte
State doThreeByte0F38OpcodeState(uint8_t)
@ ThreeByte0F38OpcodeState
static ByteTable ImmediateTypeThreeByte0F38
State doVex2Of2State(uint8_t)
StaticInstPtr decode(ExtMachInst mach_inst, Addr addr)
Decode a machine instruction.
std::vector< MachInst > masks
std::unordered_map< CacheKey, DecodeCache::InstMap< ExtMachInst > * > InstCacheMap
DecodeCache::InstMap< ExtMachInst > * instMap
State doOneByteOpcodeState(uint8_t)
State doDisplacementState()
LegacyPrefixVector legacy
State doThreeByte0F3AOpcodeState(uint8_t)
static X86ISAInst::MicrocodeRom microcodeRom
#define panic(...)
This implements a cprintf based panic() function.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Generated on Wed Sep 30 2020 14:01:58 for gem5 by doxygen 1.8.17