Use WriteExceptionExit and implement the change for JitIL
This commit is contained in:
parent
da4141aa9f
commit
e1ddbdd214
|
@ -300,15 +300,13 @@ void Jit64::Cleanup()
|
||||||
ABI_CallFunctionCCC((void *)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, jit->js.numLoadStoreInst, jit->js.numFloatingPointInst);
|
ABI_CallFunctionCCC((void *)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, jit->js.numLoadStoreInst, jit->js.numFloatingPointInst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit64::WriteExit(u32 destination, int exit_num, bool force_ee_check)
|
void Jit64::WriteExit(u32 destination, int exit_num)
|
||||||
{
|
{
|
||||||
Cleanup();
|
Cleanup();
|
||||||
|
|
||||||
// External exceptions are checked when the following instruction sets the <= 0 flag.
|
// External exceptions are checked when the following instruction sets the <= 0 flag.
|
||||||
// If we need to force the check, execute a useless SUB EAX, EAX
|
// If we need to force the check, execute a useless SUB EAX, EAX
|
||||||
SUB(32, M(&CoreTiming::downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
|
SUB(32, M(&CoreTiming::downcount), js.downcountAmount > 127 ? Imm32(js.downcountAmount) : Imm8(js.downcountAmount));
|
||||||
if (force_ee_check)
|
|
||||||
SUB(32, R(EAX), R(EAX));
|
|
||||||
|
|
||||||
//If nobody has taken care of this yet (this can be removed when all branches are done)
|
//If nobody has taken care of this yet (this can be removed when all branches are done)
|
||||||
JitBlock *b = js.curBlock;
|
JitBlock *b = js.curBlock;
|
||||||
|
@ -317,7 +315,7 @@ void Jit64::WriteExit(u32 destination, int exit_num, bool force_ee_check)
|
||||||
|
|
||||||
// Link opportunity!
|
// Link opportunity!
|
||||||
int block = blocks.GetBlockNumberFromStartAddress(destination);
|
int block = blocks.GetBlockNumberFromStartAddress(destination);
|
||||||
if (!force_ee_check && block >= 0 && jo.enableBlocklink)
|
if (block >= 0 && jo.enableBlocklink)
|
||||||
{
|
{
|
||||||
// It exists! Joy of joy!
|
// It exists! Joy of joy!
|
||||||
JMP(blocks.GetBlock(block)->checkedEntry, true);
|
JMP(blocks.GetBlock(block)->checkedEntry, true);
|
||||||
|
|
|
@ -112,7 +112,7 @@ public:
|
||||||
|
|
||||||
// Utilities for use by opcodes
|
// Utilities for use by opcodes
|
||||||
|
|
||||||
void WriteExit(u32 destination, int exit_num, bool force_ee_check = false);
|
void WriteExit(u32 destination, int exit_num);
|
||||||
void WriteExitDestInEAX();
|
void WriteExitDestInEAX();
|
||||||
void WriteExceptionExit();
|
void WriteExceptionExit();
|
||||||
void WriteExternalExceptionExit();
|
void WriteExternalExceptionExit();
|
||||||
|
|
|
@ -125,7 +125,8 @@ void Jit64::mtmsr(UGeckoInstruction inst)
|
||||||
|
|
||||||
// Force an external exception when going out of mtmsr in order to check
|
// Force an external exception when going out of mtmsr in order to check
|
||||||
// immediately for interrupts that were delayed because of MSR.EE=0.
|
// immediately for interrupts that were delayed because of MSR.EE=0.
|
||||||
WriteExit(js.compilerPC + 4, 0, true);
|
MOV(32, M(&PC), Imm32(js.compilerPC + 4));
|
||||||
|
WriteExceptionExit();
|
||||||
js.firstFPInstructionFound = false;
|
js.firstFPInstructionFound = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,8 +276,8 @@ public:
|
||||||
InstLoc EmitLoadMSR() {
|
InstLoc EmitLoadMSR() {
|
||||||
return FoldZeroOp(LoadMSR, 0);
|
return FoldZeroOp(LoadMSR, 0);
|
||||||
}
|
}
|
||||||
InstLoc EmitStoreMSR(InstLoc val) {
|
InstLoc EmitStoreMSR(InstLoc val, InstLoc pc) {
|
||||||
return FoldUOp(StoreMSR, val);
|
return FoldBiOp(StoreMSR, val, pc);
|
||||||
}
|
}
|
||||||
InstLoc EmitStoreFPRF(InstLoc value) {
|
InstLoc EmitStoreFPRF(InstLoc value) {
|
||||||
return FoldUOp(StoreFPRF, value);
|
return FoldUOp(StoreFPRF, value);
|
||||||
|
|
|
@ -994,8 +994,11 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case StoreMSR: {
|
case StoreMSR: {
|
||||||
|
unsigned InstLoc = ibuild->GetImmValue(getOp2(I));
|
||||||
regStoreInstToConstLoc(RI, 32, getOp1(I), &MSR);
|
regStoreInstToConstLoc(RI, 32, getOp1(I), &MSR);
|
||||||
regNormalRegClear(RI, I);
|
regNormalRegClear(RI, I);
|
||||||
|
Jit->MOV(32, M(&PC), Imm32(InstLoc + 4));
|
||||||
|
Jit->WriteExceptionExit();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case StoreGQR: {
|
case StoreGQR: {
|
||||||
|
|
|
@ -106,7 +106,7 @@ void JitIL::mfspr(UGeckoInstruction inst)
|
||||||
// --------------
|
// --------------
|
||||||
void JitIL::mtmsr(UGeckoInstruction inst)
|
void JitIL::mtmsr(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
ibuild.EmitStoreMSR(ibuild.EmitLoadGReg(inst.RS));
|
ibuild.EmitStoreMSR(ibuild.EmitLoadGReg(inst.RS), ibuild.EmitIntConst(js.compilerPC));
|
||||||
ibuild.EmitBranchUncond(ibuild.EmitIntConst(js.compilerPC + 4));
|
ibuild.EmitBranchUncond(ibuild.EmitIntConst(js.compilerPC + 4));
|
||||||
}
|
}
|
||||||
// ==============
|
// ==============
|
||||||
|
|
Loading…
Reference in New Issue