gem5  v20.0.0.3
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Static Private Attributes | List of all members
X86ISA::Decoder Class Reference

#include <decoder.hh>

Classes

struct  InstBytes
 

Public Member Functions

 Decoder (ISA *isa=nullptr)
 
void setM5Reg (HandyM5Reg m5Reg)
 
void takeOverFrom (Decoder *old)
 
void reset ()
 
void process ()
 
void moreBytes (const PCState &pc, Addr fetchPC, MachInst data)
 
bool needMoreBytes ()
 
bool instReady ()
 
void updateNPC (X86ISA::PCState &nextPC)
 
StaticInstPtr decodeInst (ExtMachInst mach_inst)
 
StaticInstPtr decode (ExtMachInst mach_inst, Addr addr)
 Decode a machine instruction. More...
 
StaticInstPtr decode (X86ISA::PCState &nextPC)
 

Protected Types

enum  State {
  ResetState, FromCacheState, PrefixState, Vex2Of2State,
  Vex2Of3State, Vex3Of3State, VexOpcodeState, OneByteOpcodeState,
  TwoByteOpcodeState, ThreeByte0F38OpcodeState, ThreeByte0F3AOpcodeState, ModRMState,
  SIBState, DisplacementState, ImmediateState, ErrorState
}
 
typedef RegVal CacheKey
 Caching for decoded instruction objects. More...
 
typedef DecodeCache::AddrMap< Decoder::InstBytesDecodePages
 
typedef std::unordered_map< CacheKey, DecodePages * > AddrCacheMap
 
typedef std::unordered_map< CacheKey, DecodeCache::InstMap< ExtMachInst > * > InstCacheMap
 

Protected Member Functions

uint8_t getNextByte ()
 
void getImmediate (int &collected, uint64_t &current, int size)
 
void updateOffsetState ()
 
void consumeByte ()
 
void consumeBytes (int numBytes)
 
State doResetState ()
 
State doFromCacheState ()
 
State doPrefixState (uint8_t)
 
State doVex2Of2State (uint8_t)
 
State doVex2Of3State (uint8_t)
 
State doVex3Of3State (uint8_t)
 
State doVexOpcodeState (uint8_t)
 
State doOneByteOpcodeState (uint8_t)
 
State doTwoByteOpcodeState (uint8_t)
 
State doThreeByte0F38OpcodeState (uint8_t)
 
State doThreeByte0F3AOpcodeState (uint8_t)
 
State doModRMState (uint8_t)
 
State doSIBState (uint8_t)
 
State doDisplacementState ()
 
State doImmediateState ()
 
State processOpcode (ByteTable &immTable, ByteTable &modrmTable, bool addrSizedImm=false)
 
State processExtendedOpcode (ByteTable &immTable)
 

Protected Attributes

MachInst fetchChunk
 
InstBytesinstBytes
 
int chunkIdx
 
Addr basePC
 
Addr origPC
 
int offset
 
ExtMachInst emi
 
X86Mode mode
 
X86SubMode submode
 
uint8_t altOp
 
uint8_t defOp
 
uint8_t altAddr
 
uint8_t defAddr
 
uint8_t stack
 
bool outOfBytes
 
bool instDone
 
int displacementSize
 
int immediateSize
 
int immediateCollected
 
State state
 
DecodePagesdecodePages
 
AddrCacheMap addrCacheMap
 
DecodeCache::InstMap< ExtMachInst > * instMap
 

Static Protected Attributes

static InstBytes dummy
 
static InstCacheMap instCacheMap
 

Private Types

typedef const uint8_t ByteTable[256]
 

Static Private Attributes

static const uint8_t SizeTypeToSize [3][10]
 
static ByteTable Prefixes
 
static ByteTable UsesModRMOneByte
 
static ByteTable UsesModRMTwoByte
 
static ByteTable UsesModRMThreeByte0F38
 
static ByteTable UsesModRMThreeByte0F3A
 
static ByteTable ImmediateTypeOneByte
 
static ByteTable ImmediateTypeTwoByte
 
static ByteTable ImmediateTypeThreeByte0F38
 
static ByteTable ImmediateTypeThreeByte0F3A
 
static ByteTable ImmediateTypeVex [10]
 

Detailed Description

Definition at line 50 of file decoder.hh.

Member Typedef Documentation

◆ AddrCacheMap

typedef std::unordered_map<CacheKey, DecodePages *> X86ISA::Decoder::AddrCacheMap
protected

Definition at line 227 of file decoder.hh.

◆ ByteTable

typedef const uint8_t X86ISA::Decoder::ByteTable[256]
private

Definition at line 55 of file decoder.hh.

◆ CacheKey

typedef RegVal X86ISA::Decoder::CacheKey
protected

Caching for decoded instruction objects.

Definition at line 223 of file decoder.hh.

◆ DecodePages

Definition at line 225 of file decoder.hh.

◆ InstCacheMap

typedef std::unordered_map< CacheKey, DecodeCache::InstMap<ExtMachInst> *> X86ISA::Decoder::InstCacheMap
protected

Definition at line 232 of file decoder.hh.

Member Enumeration Documentation

◆ State

enum X86ISA::Decoder::State
protected
Enumerator
ResetState 
FromCacheState 
PrefixState 
Vex2Of2State 
Vex2Of3State 
Vex3Of3State 
VexOpcodeState 
OneByteOpcodeState 
TwoByteOpcodeState 
ThreeByte0F38OpcodeState 
ThreeByte0F3AOpcodeState 
ModRMState 
SIBState 
DisplacementState 
ImmediateState 
ErrorState 

Definition at line 175 of file decoder.hh.

Constructor & Destructor Documentation

◆ Decoder()

X86ISA::Decoder::Decoder ( ISA isa = nullptr)
inline

Member Function Documentation

◆ consumeByte()

void X86ISA::Decoder::consumeByte ( )
inlineprotected

◆ consumeBytes()

void X86ISA::Decoder::consumeBytes ( int  numBytes)
inlineprotected

Definition at line 155 of file decoder.hh.

References updateOffsetState().

Referenced by getImmediate().

◆ decode() [1/2]

StaticInstPtr X86ISA::Decoder::decode ( ExtMachInst  mach_inst,
Addr  addr 
)

Decode a machine instruction.

Parameters
mach_instThe binary instruction to decode.
Return values
Apointer to the corresponding StaticInst object.

Definition at line 680 of file decoder.cc.

References decodeInst(), instMap, and X86ISA::si.

Referenced by decode(), and updateNPC().

◆ decode() [2/2]

StaticInstPtr X86ISA::Decoder::decode ( X86ISA::PCState nextPC)

◆ decodeInst()

StaticInstPtr X86ISA::Decoder::decodeInst ( ExtMachInst  mach_inst)

Referenced by decode(), and updateNPC().

◆ doDisplacementState()

Decoder::State X86ISA::Decoder::doDisplacementState ( )
protected

◆ doFromCacheState()

Decoder::State X86ISA::Decoder::doFromCacheState ( )
protected

◆ doImmediateState()

Decoder::State X86ISA::Decoder::doImmediateState ( )
protected

◆ doModRMState()

Decoder::State X86ISA::Decoder::doModRMState ( uint8_t  nextByte)
protected

◆ doOneByteOpcodeState()

Decoder::State X86ISA::Decoder::doOneByteOpcodeState ( uint8_t  nextByte)
protected

◆ doPrefixState()

Decoder::State X86ISA::Decoder::doPrefixState ( uint8_t  nextByte)
protected

◆ doResetState()

Decoder::State X86ISA::Decoder::doResetState ( )
protected

◆ doSIBState()

Decoder::State X86ISA::Decoder::doSIBState ( uint8_t  nextByte)
protected

◆ doThreeByte0F38OpcodeState()

Decoder::State X86ISA::Decoder::doThreeByte0F38OpcodeState ( uint8_t  nextByte)
protected

◆ doThreeByte0F3AOpcodeState()

Decoder::State X86ISA::Decoder::doThreeByte0F3AOpcodeState ( uint8_t  nextByte)
protected

◆ doTwoByteOpcodeState()

Decoder::State X86ISA::Decoder::doTwoByteOpcodeState ( uint8_t  nextByte)
protected

◆ doVex2Of2State()

Decoder::State X86ISA::Decoder::doVex2Of2State ( uint8_t  nextByte)
protected

◆ doVex2Of3State()

Decoder::State X86ISA::Decoder::doVex2Of3State ( uint8_t  nextByte)
protected

◆ doVex3Of3State()

Decoder::State X86ISA::Decoder::doVex3Of3State ( uint8_t  nextByte)
protected

◆ doVexOpcodeState()

Decoder::State X86ISA::Decoder::doVexOpcodeState ( uint8_t  nextByte)
protected

◆ getImmediate()

void X86ISA::Decoder::getImmediate ( int &  collected,
uint64_t &  current,
int  size 
)
inlineprotected

Definition at line 109 of file decoder.hh.

References consumeBytes(), immediateCollected, and X86ISA::mask.

Referenced by doDisplacementState(), and doImmediateState().

◆ getNextByte()

uint8_t X86ISA::Decoder::getNextByte ( )
inlineprotected

Definition at line 104 of file decoder.hh.

References offset.

Referenced by process().

◆ instReady()

bool X86ISA::Decoder::instReady ( )
inline

Definition at line 321 of file decoder.hh.

References instDone.

◆ moreBytes()

void X86ISA::Decoder::moreBytes ( const PCState pc,
Addr  fetchPC,
MachInst  data 
)
inline

Definition at line 306 of file decoder.hh.

References DPRINTF, GenericISA::PCStateBase::instAddr(), letoh(), and process().

◆ needMoreBytes()

bool X86ISA::Decoder::needMoreBytes ( )
inline

Definition at line 316 of file decoder.hh.

References outOfBytes.

◆ process()

void X86ISA::Decoder::process ( )

◆ processExtendedOpcode()

State X86ISA::Decoder::processExtendedOpcode ( ByteTable immTable)
protected

◆ processOpcode()

Decoder::State X86ISA::Decoder::processOpcode ( ByteTable immTable,
ByteTable modrmTable,
bool  addrSizedImm = false 
)
protected

◆ reset()

void X86ISA::Decoder::reset ( )
inline

Definition at line 297 of file decoder.hh.

References process(), and ResetState.

◆ setM5Reg()

void X86ISA::Decoder::setM5Reg ( HandyM5Reg  m5Reg)
inline

Definition at line 255 of file decoder.hh.

References decodePages, instMap, mode, X86ISA::ExtMachInst::mode, and submode.

◆ takeOverFrom()

void X86ISA::Decoder::takeOverFrom ( Decoder old)
inline

Definition at line 284 of file decoder.hh.

References altAddr, altOp, defAddr, defOp, mode, X86ISA::ExtMachInst::mode, stack, and submode.

◆ updateNPC()

void X86ISA::Decoder::updateNPC ( X86ISA::PCState nextPC)
inline

◆ updateOffsetState()

void X86ISA::Decoder::updateOffsetState ( )
inlineprotected

Definition at line 132 of file decoder.hh.

References chunkIdx, X86ISA::Decoder::InstBytes::chunks, DPRINTF, and outOfBytes.

Referenced by consumeByte(), and consumeBytes().

Member Data Documentation

◆ addrCacheMap

AddrCacheMap X86ISA::Decoder::addrCacheMap
protected

Definition at line 228 of file decoder.hh.

◆ altAddr

uint8_t X86ISA::Decoder::altAddr
protected

Definition at line 100 of file decoder.hh.

Referenced by processOpcode(), and takeOverFrom().

◆ altOp

uint8_t X86ISA::Decoder::altOp
protected

Definition at line 98 of file decoder.hh.

Referenced by processOpcode(), and takeOverFrom().

◆ basePC

Addr X86ISA::Decoder::basePC
protected

Definition at line 88 of file decoder.hh.

Referenced by decode(), doFromCacheState(), and doResetState().

◆ chunkIdx

int X86ISA::Decoder::chunkIdx
protected

Definition at line 86 of file decoder.hh.

Referenced by doFromCacheState(), doResetState(), and updateOffsetState().

◆ decodePages

DecodePages* X86ISA::Decoder::decodePages
protected

Definition at line 226 of file decoder.hh.

Referenced by doResetState(), and setM5Reg().

◆ defAddr

uint8_t X86ISA::Decoder::defAddr
protected

Definition at line 101 of file decoder.hh.

Referenced by processOpcode(), and takeOverFrom().

◆ defOp

uint8_t X86ISA::Decoder::defOp
protected

Definition at line 99 of file decoder.hh.

Referenced by doModRMState(), processOpcode(), and takeOverFrom().

◆ displacementSize

int X86ISA::Decoder::displacementSize
protected

Definition at line 168 of file decoder.hh.

Referenced by doDisplacementState(), doModRMState(), and doSIBState().

◆ dummy

Decoder::InstBytes X86ISA::Decoder::dummy
staticprotected

Definition at line 81 of file decoder.hh.

Referenced by Decoder(), and doImmediateState().

◆ emi

ExtMachInst X86ISA::Decoder::emi
protected

◆ fetchChunk

MachInst X86ISA::Decoder::fetchChunk
protected

Definition at line 84 of file decoder.hh.

Referenced by doFromCacheState(), and process().

◆ immediateCollected

int X86ISA::Decoder::immediateCollected
protected

Definition at line 173 of file decoder.hh.

Referenced by doDisplacementState(), doImmediateState(), doResetState(), and getImmediate().

◆ immediateSize

int X86ISA::Decoder::immediateSize
protected

◆ ImmediateTypeOneByte

const Decoder::ByteTable X86ISA::Decoder::ImmediateTypeOneByte
staticprivate
Initial value:
=
{
0 , 0 , 0 , 0 , BY, ZW, 0 , 0 , 0 , 0 , 0 , 0 , BY, ZW, 0 , 0 ,
0 , 0 , 0 , 0 , BY, ZW, 0 , 0 , 0 , 0 , 0 , 0 , BY, ZW, 0 , 0 ,
0 , 0 , 0 , 0 , BY, ZW, 0 , 0 , 0 , 0 , 0 , 0 , BY, ZW, 0 , 0 ,
0 , 0 , 0 , 0 , BY, ZW, 0 , 0 , 0 , 0 , 0 , 0 , BY, ZW, 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , ZW, ZW, BY, BY, 0 , 0 , 0 , 0 ,
BY, BY, BY, BY, BY, BY, BY, BY, BY, BY, BY, BY, BY, BY, BY, BY,
BY, ZW, BY, BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
VW, VW, VW, VW, 0 , 0 , 0 , 0 , BY, ZW, 0 , 0 , 0 , 0 , 0 , 0 ,
BY, BY, BY, BY, BY, BY, BY, BY, VW, VW, VW, VW, VW, VW, VW, VW,
BY, BY, WO, 0 , 0 , 0 , BY, ZW, EN, 0 , WO, 0 , 0 , BY, 0 , 0 ,
0 , 0 , 0 , 0 , BY, BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
BY, BY, BY, BY, BY, BY, BY, BY, ZW, ZW, PO, BY, 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}

Definition at line 63 of file decoder.hh.

Referenced by doOneByteOpcodeState(), doVex2Of3State(), and doVex3Of3State().

◆ ImmediateTypeThreeByte0F38

const Decoder::ByteTable X86ISA::Decoder::ImmediateTypeThreeByte0F38
staticprivate
Initial value:
=
{
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}

Definition at line 65 of file decoder.hh.

Referenced by doThreeByte0F38OpcodeState(), and doVexOpcodeState().

◆ ImmediateTypeThreeByte0F3A

const Decoder::ByteTable X86ISA::Decoder::ImmediateTypeThreeByte0F3A
staticprivate
Initial value:
=
{
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , BY, BY, BY, BY, BY, BY, BY, BY,
0 , 0 , 0 , 0 , BY, BY, BY, BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
BY, BY, BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
BY, BY, BY, 0 , BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
BY, BY, BY, BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , BY,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}

Definition at line 66 of file decoder.hh.

Referenced by doThreeByte0F3AOpcodeState(), and doVexOpcodeState().

◆ ImmediateTypeTwoByte

const Decoder::ByteTable X86ISA::Decoder::ImmediateTypeTwoByte
staticprivate
Initial value:
=
{
0 , 0 , 0 , 0 , WO, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , BY,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
BY, BY, BY, BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW, ZW,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , BY, 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , ZW, 0 , BY, 0 , 0 , 0 , 0 , 0 ,
0 , 0 , BY, 0 , BY, BY, BY, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}

Definition at line 64 of file decoder.hh.

Referenced by doTwoByteOpcodeState(), and doVexOpcodeState().

◆ ImmediateTypeVex

ByteTable X86ISA::Decoder::ImmediateTypeVex[10]
staticprivate

Definition at line 67 of file decoder.hh.

◆ instBytes

InstBytes* X86ISA::Decoder::instBytes
protected

Definition at line 85 of file decoder.hh.

Referenced by decode(), doFromCacheState(), doResetState(), and process().

◆ instCacheMap

Decoder::InstCacheMap X86ISA::Decoder::instCacheMap
staticprotected

Definition at line 233 of file decoder.hh.

Referenced by doImmediateState().

◆ instDone

bool X86ISA::Decoder::instDone
protected

◆ instMap

DecodeCache::InstMap<ExtMachInst>* X86ISA::Decoder::instMap
protected

Definition at line 230 of file decoder.hh.

Referenced by decode(), and setM5Reg().

◆ mode

X86Mode X86ISA::Decoder::mode
protected

Definition at line 96 of file decoder.hh.

Referenced by Decoder(), setM5Reg(), and takeOverFrom().

◆ offset

int X86ISA::Decoder::offset
protected

Definition at line 92 of file decoder.hh.

Referenced by decode(), doFromCacheState(), doResetState(), and getNextByte().

◆ origPC

Addr X86ISA::Decoder::origPC
protected

Definition at line 90 of file decoder.hh.

Referenced by decode(), doFromCacheState(), doResetState(), and updateNPC().

◆ outOfBytes

bool X86ISA::Decoder::outOfBytes
protected

Definition at line 164 of file decoder.hh.

Referenced by doFromCacheState(), needMoreBytes(), process(), and updateOffsetState().

◆ Prefixes

const Decoder::ByteTable X86ISA::Decoder::Prefixes
staticprivate
Initial value:
=
{
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , ES, 0 , 0 , 0 , 0 , 0 , 0 , 0 , CS, 0,
0 , 0 , 0 , 0 , 0 , 0 , SS, 0 , 0 , 0 , 0 , 0 , 0 , 0 , DS, 0,
RX, RX, RX, RX, RX, RX, RX, RX, RX, RX, RX, RX, RX, RX, RX, RX,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , FS, GS, OO, AO, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , V3, V2, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
LO, 0 , RN, RE, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}

Definition at line 56 of file decoder.hh.

◆ SizeTypeToSize

const uint8_t X86ISA::Decoder::SizeTypeToSize
staticprivate
Initial value:
=
{
{0, 1, 2, 4, 8, 16, 2, 2, 3, 4 },
{0, 1, 2, 4, 8, 16, 4, 4, 3, 6 },
{0, 1, 2, 4, 8, 16, 8, 4, 3, 0 }
}

Definition at line 54 of file decoder.hh.

Referenced by processOpcode().

◆ stack

uint8_t X86ISA::Decoder::stack
protected

Definition at line 102 of file decoder.hh.

Referenced by processOpcode(), and takeOverFrom().

◆ state

State X86ISA::Decoder::state
protected

Definition at line 195 of file decoder.hh.

Referenced by process().

◆ submode

X86SubMode X86ISA::Decoder::submode
protected

Definition at line 97 of file decoder.hh.

Referenced by Decoder(), setM5Reg(), and takeOverFrom().

◆ UsesModRMOneByte

const Decoder::ByteTable X86ISA::Decoder::UsesModRMOneByte
staticprivate
Initial value:
=
{
1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 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, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}

Definition at line 60 of file decoder.hh.

Referenced by doThreeByte0F38OpcodeState(), and doVexOpcodeState().

◆ UsesModRMThreeByte0F3A

const Decoder::ByteTable X86ISA::Decoder::UsesModRMThreeByte0F3A
staticprivate
Initial value:
=
{
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
}

Definition at line 61 of file decoder.hh.

Referenced by doThreeByte0F3AOpcodeState(), and doVexOpcodeState().

◆ UsesModRMTwoByte

const Decoder::ByteTable X86ISA::Decoder::UsesModRMTwoByte
staticprivate
Initial value:
=
{
1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0
}

Definition at line 59 of file decoder.hh.

Referenced by doTwoByteOpcodeState(), and doVexOpcodeState().


The documentation for this class was generated from the following files:

Generated on Fri Jul 3 2020 15:53:59 for gem5 by doxygen 1.8.13