emi.modRM = 0;
emi.sib = 0;
+ emi.mode = 0;
}
void Predecoder::process()
tc(_tc), basePC(0), origPC(0), offset(0),
outOfBytes(true), emiIsReady(false),
state(ResetState)
- {}
+ {
+ emi.mode.mode = LongMode;
+ emi.mode.submode = SixtyFourBitMode;
+ }
ThreadContext * getTC()
{
Bitfield<2,0> bottom3;
EndBitUnion(Opcode)
+ BitUnion8(OperatingMode)
+ Bitfield<3> mode;
+ Bitfield<2,0> submode;
+ EndBitUnion(OperatingMode)
+
+ enum X86Mode {
+ LongMode,
+ LegacyMode
+ };
+
+ enum X86SubMode {
+ SixtyFourBitMode,
+ CompatabilityMode,
+ ProtectedMode,
+ Virtual8086Mode,
+ RealMode
+ };
+
//The intermediate structure the x86 predecoder returns.
struct ExtMachInst
{
uint8_t opSize;
//The effective address size.
uint8_t addrSize;
+
+ //Mode information
+ OperatingMode mode;
};
inline static std::ostream &
inline static bool
operator == (const ExtMachInst &emi1, const ExtMachInst &emi2)
{
+ if(emi1.mode != emi2.mode)
+ return false;
if(emi1.legacy != emi2.legacy)
return false;
if(emi1.rex != emi2.rex)
((uint64_t)emi.opcode.prefixB << 8) |
((uint64_t)emi.opcode.op)) ^
emi.immediate ^ emi.displacement ^
- emi.opSize;
+ emi.mode ^ emi.opSize;
};
};
}