IR: Split Syscall into Syscall and ExitToPC, so we can put ApplyRoundingMode in between.

This commit is contained in:
Henrik Rydgard 2016-05-14 14:31:38 +02:00
parent cc1a16b0e0
commit 64eda6a4ec
4 changed files with 8 additions and 3 deletions

View File

@ -386,9 +386,9 @@ void IRFrontend::Comp_Syscall(MIPSOpcode op) {
FlushAll();
ir.Write(IROp::Syscall, 0, ir.AddConstant(op.encoding));
// TODO: This never happens because of Syscall exiting.
ApplyRoundingMode();
ir.Write(IROp::ExitToPC);
js.compiling = false;
}

View File

@ -114,6 +114,7 @@ static const IRMeta irMeta[] = {
{ IROp::Interpret, "Interpret", "_C" },
{ IROp::Downcount, "Downcount", "_II" },
{ IROp::ExitToPC, "ExitToPC", "", IRFLAG_EXIT },
{ IROp::ExitToConst, "Exit", "C", IRFLAG_EXIT },
{ IROp::ExitToConstIfEq, "ExitIfEq", "CGG", IRFLAG_EXIT },
{ IROp::ExitToConstIfNeq, "ExitIfNeq", "CGG", IRFLAG_EXIT },

View File

@ -204,6 +204,7 @@ enum class IROp : u8 {
ExitToConstIfFpTrue,
ExitToConstIfFpFalse,
ExitToPC, // Used after a syscall to give us a way to do things before returning.
Syscall,
SetPC, // hack to make syscall returns work

View File

@ -587,9 +587,12 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, const u32 *constPool, int c
CallSyscall(op);
if (coreState != CORE_RUNNING)
CoreTiming::ForceCheck();
return mips->pc;
break;
}
case IROp::ExitToPC:
return mips->pc;
case IROp::Interpret: // SLOW fallback. Can be made faster.
{
MIPSOpcode op(constPool[inst->src1]);