mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Add a MIPSState context pointer to the JitAt call
This commit is contained in:
1 parent
d21467beb0
commit
7a9a354e50
10 files changed
+13
-11
No files matched your search
@@ -222,7 +222,7 @@ void ArmJit::GenerateFixedCode() {
|
||||
// No block found, let's jit
|
||||
SaveDowncount();
|
||||
RestoreRoundingMode(true);
|
||||
QuickCallFunction(R2, (void *)&MIPSComp::JitAt);
|
||||
QuickCallFunctionR(R2, (void *)&MIPSComp::JitAt, CTXREG);
|
||||
ApplyRoundingMode(true);
|
||||
RestoreDowncount();
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ void Arm64Jit::GenerateFixedCode(const JitOptions &jo) {
|
||||
// Also, rounding mode gotta be irrelevant here..
|
||||
SaveStaticRegisters();
|
||||
RestoreRoundingMode(true);
|
||||
QuickCallFunction(SCRATCH1_64, (void *)&MIPSComp::JitAt);
|
||||
QuickCallFunctionR(SCRATCH1_64, (void *)&MIPSComp::JitAt, CTXREG);
|
||||
ApplyRoundingMode(true);
|
||||
LoadStaticRegisters();
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ void Arm64JitBackend::GenerateFixedCode(MIPSState *mipsState) {
|
||||
// No block found, let's jit. We don't need to save static regs, they're all callee saved.
|
||||
RestoreRoundingMode(true);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::COMPILING);
|
||||
QuickCallFunction(SCRATCH1_64, &MIPSComp::JitAt);
|
||||
QuickCallFunctionR(SCRATCH1_64, &MIPSComp::JitAt, CTXREG);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::IN_JIT);
|
||||
ApplyRoundingMode(true);
|
||||
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
namespace MIPSComp {
|
||||
JitInterface *jit;
|
||||
|
||||
void JitAt() {
|
||||
void JitAt(MIPSState *mips) {
|
||||
// TODO: We could probably check for a bad pc here, and fire an exception. Could spare us from some crashes.
|
||||
// Although, we just tried to load from this address to check for a JIT block, and if we're here, that succeeded..
|
||||
jit->Compile(currentMIPS->pc);
|
||||
jit->Compile(mips->pc);
|
||||
}
|
||||
|
||||
void DoDummyJitState(PointerWrap &p) {
|
||||
|
||||
@@ -38,7 +38,7 @@ class PointerWrap;
|
||||
class MIPSState;
|
||||
|
||||
namespace MIPSComp {
|
||||
void JitAt();
|
||||
void JitAt(MIPSState *mips);
|
||||
|
||||
class MIPSFrontendInterface {
|
||||
public:
|
||||
|
||||
@@ -186,7 +186,7 @@ void LoongArch64JitBackend::GenerateFixedCode(MIPSState *mipsState) {
|
||||
// No block found, let's jit. We don't need to save static regs, they're all callee saved.
|
||||
RestoreRoundingMode(true);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::COMPILING);
|
||||
QuickCallFunction(&MIPSComp::JitAt, R20);
|
||||
QuickCallFunctionR(&MIPSComp::JitAt, CTXREG, R20);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::IN_JIT);
|
||||
ApplyRoundingMode(true);
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ void RiscVJitBackend::GenerateFixedCode(MIPSState *mipsState) {
|
||||
// No block found, let's jit. We don't need to save static regs, they're all callee saved.
|
||||
RestoreRoundingMode(true);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::COMPILING);
|
||||
QuickCallFunction(&MIPSComp::JitAt, X7);
|
||||
QuickCallFunctionR(&MIPSComp::JitAt, CTXREG, X7);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::IN_JIT);
|
||||
ApplyRoundingMode(true);
|
||||
|
||||
|
||||
@@ -194,7 +194,8 @@ void Jit::GenerateFixedCode(JitOptions &jo) {
|
||||
|
||||
//Ok, no block, let's jit
|
||||
RestoreRoundingMode(true);
|
||||
ABI_CallFunction(&MIPSComp::JitAt);
|
||||
LEA(PTRBITS, ECX, MDisp(CTXREG, -(s32)offsetof(MIPSState, f[0]))); // Adjust to get the real pointer.
|
||||
ABI_CallFunctionR(reinterpret_cast<void *>(&MIPSComp::JitAt), ECX);
|
||||
ApplyRoundingMode(true);
|
||||
JMP(dispatcherNoCheck, true); // Let's just dispatch again, we'll enter the block since we know it's there.
|
||||
|
||||
|
||||
@@ -265,7 +265,8 @@ void X64JitBackend::GenerateFixedCode(MIPSState *mipsState) {
|
||||
// No block found, let's jit. We don't need to save static regs, they're all callee saved.
|
||||
RestoreRoundingMode(true);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::COMPILING);
|
||||
ABI_CallFunction(&MIPSComp::JitAt);
|
||||
LEA(PTRBITS, ECX, MDisp(CTXREG, -(s32)offsetof(MIPSState, f[0])));
|
||||
ABI_CallFunctionR(reinterpret_cast<void *>(&MIPSComp::JitAt), ECX);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::IN_JIT);
|
||||
ApplyRoundingMode(true);
|
||||
// Let's just dispatch again, we'll enter the block since we know it's there.
|
||||
|
||||
@@ -54,7 +54,7 @@ double ExecCPUTest(bool clearCache = true) {
|
||||
|
||||
if (MIPSComp::jit) {
|
||||
currentMIPS->pc = PSP_GetUserMemoryBase();
|
||||
MIPSComp::JitAt();
|
||||
MIPSComp::JitAt(currentMIPS);
|
||||
}
|
||||
|
||||
double st = time_now_d();
|
||||
|
||||
Reference in new issue
Block a user