Go to the documentation of this file.
35 #include "debug/Decode.hh"
36 #include "debug/Decoder.hh"
140 panic(
"Went to the error state in the decoder.\n");
187 const uint8_t prefix =
Prefixes[table_idx][nextByte];
242 panic(
"Unrecognized prefix %#x\n", nextByte);
251 Vex2Of2 vex = nextByte;
286 nextByte >= 0xA0 && nextByte <= 0xA3);
290 Vex2Of3 vex = nextByte;
327 nextByte >= 0xA0 && nextByte <= 0xA3);
331 Vex3Of3 vex = nextByte;
366 case ThreeByte0F38Opcode:
369 case ThreeByte0F3AOpcode:
385 if (nextByte == 0x0f) {
394 nextByte >= 0xA0 && nextByte <= 0xA3);
406 if (nextByte == 0x38) {
409 }
else if (nextByte == 0x3a) {
429 DPRINTF(
Decoder,
"Found three byte 0F38 opcode %#x.\n", nextByte);
443 DPRINTF(
Decoder,
"Found three byte 0F3A opcode %#x.\n", nextByte);
489 int immType = immTable[
opcode];
516 ModRM modRM = nextByte;
520 if ((modRM.mod == 0 && modRM.rm == 6) || modRM.mod == 2)
522 else if (modRM.mod == 1)
528 if ((modRM.mod == 0 && modRM.rm == 5) || modRM.mod == 2)
530 else if (modRM.mod == 1)
538 if (
emi.
opcode.
type == OneByteOpcode && (modRM.reg & 0x6) == 0) {
547 if (modRM.rm == 4 && modRM.mod != 3 &&
emi.
addrSize != 2) {
596 DPRINTF(
Decoder,
"Collecting %d byte displacement, got %d bytes.\n",
615 panic(
"Undefined displacement size!\n");
682 auto iter =
instMap->find(mach_inst);
687 (*instMap)[mach_inst] =
si;
690 DPRINTF(Decode,
"Decode: Decoded %s instruction: %#x\n",
691 si->getName(), mach_inst);
709 const int chunkSize =
sizeof(
MachInst);
717 int start = firstOffset;
721 int end = start + totalSize;
722 end = (chunkSize < end) ? chunkSize : end;
723 int size = end - start;
static ByteTable ImmediateTypeOneByte
State doSIBState(uint8_t)
std::unordered_map< CacheKey, decode_cache::InstMap< ExtMachInst > * > InstCacheMap
static X86ISAInst::MicrocodeRom microcodeRom
StaticInstPtr fetchMicroop(MicroPC microPC, StaticInstPtr curMacroop)
State doVex3Of3State(uint8_t)
static ByteTable UsesModRMThreeByte0F38
decode_cache::InstMap< ExtMachInst > * instMap
static ByteTable ImmediateTypeTwoByte
StaticInstPtr decodeInst(ExtMachInst mach_inst)
static ByteTable ImmediateTypeThreeByte0F3A
State doModRMState(uint8_t)
If you want a reference counting pointer to a mutable object, create it like this:
State doVexOpcodeState(uint8_t)
static ByteTable UsesModRMOneByte
Bitfield< 24, 21 > opcode
static InstCacheMap instCacheMap
LegacyPrefixVector legacy
std::vector< MachInst > masks
DecodePages * decodePages
StaticInstPtr decode(ExtMachInst mach_inst, Addr addr)
Decode a machine instruction.
State doVex2Of2State(uint8_t)
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
State doDisplacementState()
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
State doOneByteOpcodeState(uint8_t)
State processOpcode(ByteTable &immTable, ByteTable &modrmTable, bool addrSizedImm=false)
StaticInstPtr fetchRomMicroop(MicroPC micropc, StaticInstPtr curMacroop) override
State doThreeByte0F3AOpcodeState(uint8_t)
State doVex2Of3State(uint8_t)
void updateNPC(X86ISA::PCState &nextPC)
State doThreeByte0F38OpcodeState(uint8_t)
static const uint8_t SizeTypeToSize[3][10]
State doTwoByteOpcodeState(uint8_t)
Value & lookup(Addr addr)
struct gem5::X86ISA::ExtMachInst::@32 opcode
@ ThreeByte0F3AOpcodeState
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::vector< MachInst > chunks
void getImmediate(int &collected, uint64_t ¤t, int size)
@ ThreeByte0F38OpcodeState
static ByteTable ImmediateTypeThreeByte0F38
static ByteTable UsesModRMTwoByte
#define panic(...)
This implements a cprintf based panic() function.
static ByteTable UsesModRMThreeByte0F3A
State doPrefixState(uint8_t)
Generated on Sun Jul 30 2023 01:56:33 for gem5 by doxygen 1.8.17