Automatically eat prefixes in x86 jit.

Simplifies the code and makes it easier to know they're eaten
even for ops not yet jitted.
This commit is contained in:
Unknown W. Brackets 2013-02-17 15:50:31 -08:00
parent 6b223cf7d7
commit f532951331
5 changed files with 15 additions and 8 deletions

View File

@ -119,6 +119,9 @@ public:
void ClearCache();
void ClearCacheAt(u32 em_address);
// TODO: Eat VFPU prefixes here.
void EatPrefix() { }
private:
void GenerateFixedCode();
void FlushAll();

View File

@ -868,6 +868,7 @@ void MIPSCompileOp(u32 op)
if (op==0)
return;
const MIPSInstruction *instr = MIPSGetInstruction(op);
const int info = MIPSGetInfo(op);
if (instr)
{
if (instr->compile)
@ -877,6 +878,9 @@ void MIPSCompileOp(u32 op)
ERROR_LOG(CPU,"MIPSCompileOp %08x failed",op);
//MessageBox(0,"ARGH2",0,0);//compile an interpreter call
}
if (info & OUT_EAT_PREFIX)
MIPSComp::jit->EatPrefix();
}
else
{

View File

@ -318,10 +318,14 @@ void Jit::Comp_SVQ(u32 op)
void Jit::Comp_VDot(u32 op) {
DISABLE;
// No-op.
if (js.writeMask[0]) {
return;
}
// WARNING: No prefix support!
if (js.MayHavePrefix()) {
Comp_Generic(op);
js.EatPrefix();
return;
}
@ -365,8 +369,6 @@ void Jit::Comp_VDot(u32 op) {
// TODO: applyprefixD here somehow (write mask etc..)
fpr.ReleaseSpillLocks();
js.EatPrefix();
}
void Jit::Comp_VecDo3(u32 op) {
@ -376,7 +378,6 @@ void Jit::Comp_VecDo3(u32 op) {
if (js.MayHavePrefix())
{
Comp_Generic(op);
js.EatPrefix();
return;
}
@ -420,7 +421,6 @@ void Jit::Comp_VecDo3(u32 op) {
if (xmmop == NULL)
{
Comp_Generic(op);
js.EatPrefix();
return;
}
@ -463,8 +463,6 @@ void Jit::Comp_VecDo3(u32 op) {
}
fpr.ReleaseSpillLocks();
js.EatPrefix();
}
void Jit::Comp_Mftv(u32 op) {

View File

@ -283,7 +283,8 @@ void Jit::Comp_Generic(u32 op)
_dbg_assert_msg_(JIT, 0, "Trying to compile instruction that can't be interpreted");
// Might have eaten prefixes, hard to tell...
if ((MIPSGetInfo(op) & IS_VFPU) != 0)
const int info = MIPSGetInfo(op);
if ((info & IS_VFPU) != 0 && (info & OUT_EAT_PREFIX) == 0)
js.PrefixStart();
}

View File

@ -173,6 +173,7 @@ public:
void ApplyPrefixST(u8 *vregs, u32 prefix, VectorSize sz);
void ApplyPrefixD(const u8 *vregs, u32 prefix, VectorSize sz, bool onlyWriteMask = false);
void EatPrefix() { js.EatPrefix(); }
JitBlockCache *GetBlockCache() { return &blocks; }
AsmRoutineManager &Asm() { return asm_; }