2012-11-01 15:19:01 +00:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
2012-11-04 22:01:49 +00:00
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
2013-07-27 20:14:01 +00:00
|
|
|
#include <cmath>
|
|
|
|
#include <limits>
|
2021-11-28 00:11:51 +00:00
|
|
|
#include <mutex>
|
2013-07-27 20:14:01 +00:00
|
|
|
|
2020-10-03 22:25:21 +00:00
|
|
|
#include "Common/Math/math_util.h"
|
2013-12-29 22:28:31 +00:00
|
|
|
|
2022-01-30 23:49:02 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2020-08-10 07:12:51 +00:00
|
|
|
#include "Common/Serialize/Serializer.h"
|
|
|
|
#include "Common/Serialize/SerializeFuncs.h"
|
2018-06-17 01:42:31 +00:00
|
|
|
#include "Core/ConfigValues.h"
|
2013-04-26 21:58:20 +00:00
|
|
|
#include "Core/MIPS/MIPS.h"
|
2014-01-28 10:32:54 +00:00
|
|
|
#include "Core/MIPS/MIPSInt.h"
|
2013-04-26 21:58:20 +00:00
|
|
|
#include "Core/MIPS/MIPSTables.h"
|
|
|
|
#include "Core/MIPS/MIPSDebugInterface.h"
|
|
|
|
#include "Core/MIPS/MIPSVFPUUtils.h"
|
2016-05-07 23:43:27 +00:00
|
|
|
#include "Core/MIPS/IR/IRJit.h"
|
2013-08-12 02:33:52 +00:00
|
|
|
#include "Core/Reporting.h"
|
2013-04-26 21:58:20 +00:00
|
|
|
#include "Core/System.h"
|
|
|
|
#include "Core/MIPS/JitCommon/JitCommon.h"
|
|
|
|
#include "Core/CoreTiming.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
MIPSState mipsr4k;
|
|
|
|
MIPSState *currentMIPS = &mipsr4k;
|
|
|
|
MIPSDebugInterface debugr4k(&mipsr4k);
|
|
|
|
MIPSDebugInterface *currentDebugMIPS = &debugr4k;
|
|
|
|
|
2013-11-27 21:45:17 +00:00
|
|
|
u8 voffset[128];
|
|
|
|
u8 fromvoffset[128];
|
|
|
|
|
2013-07-27 20:14:01 +00:00
|
|
|
|
|
|
|
#ifndef M_LOG2E
|
|
|
|
#define M_E 2.71828182845904523536f
|
|
|
|
#define M_LOG2E 1.44269504088896340736f
|
|
|
|
#define M_LOG10E 0.434294481903251827651f
|
|
|
|
#define M_LN2 0.693147180559945309417f
|
|
|
|
#define M_LN10 2.30258509299404568402f
|
|
|
|
#undef M_PI
|
|
|
|
#define M_PI 3.14159265358979323846f
|
2014-06-15 09:03:00 +00:00
|
|
|
|
|
|
|
#ifndef M_PI_2
|
2013-07-27 20:14:01 +00:00
|
|
|
#define M_PI_2 1.57079632679489661923f
|
2014-06-15 09:03:00 +00:00
|
|
|
#endif
|
2013-07-27 20:14:01 +00:00
|
|
|
#define M_PI_4 0.785398163397448309616f
|
|
|
|
#define M_1_PI 0.318309886183790671538f
|
|
|
|
#define M_2_PI 0.636619772367581343076f
|
|
|
|
#define M_2_SQRTPI 1.12837916709551257390f
|
|
|
|
#define M_SQRT2 1.41421356237309504880f
|
|
|
|
#define M_SQRT1_2 0.707106781186547524401f
|
|
|
|
#endif
|
|
|
|
|
2013-08-25 02:31:12 +00:00
|
|
|
const float cst_constants[32] = {
|
2013-07-27 20:14:01 +00:00
|
|
|
0,
|
|
|
|
std::numeric_limits<float>::max(), // all these are verified on real PSP
|
|
|
|
sqrtf(2.0f),
|
|
|
|
sqrtf(0.5f),
|
|
|
|
2.0f/sqrtf((float)M_PI),
|
|
|
|
2.0f/(float)M_PI,
|
|
|
|
1.0f/(float)M_PI,
|
|
|
|
(float)M_PI/4,
|
|
|
|
(float)M_PI/2,
|
|
|
|
(float)M_PI,
|
|
|
|
(float)M_E,
|
|
|
|
(float)M_LOG2E,
|
|
|
|
(float)M_LOG10E,
|
|
|
|
(float)M_LN2,
|
|
|
|
(float)M_LN10,
|
|
|
|
2*(float)M_PI,
|
|
|
|
(float)M_PI/6,
|
|
|
|
log10f(2.0f),
|
|
|
|
logf(10.0f)/logf(2.0f),
|
|
|
|
sqrtf(3.0f)/2.0f,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-01-28 10:32:54 +00:00
|
|
|
MIPSState::MIPSState() {
|
2021-11-27 14:00:18 +00:00
|
|
|
MIPSComp::jit = nullptr;
|
2013-11-27 21:45:17 +00:00
|
|
|
|
|
|
|
// Initialize vorder
|
|
|
|
|
|
|
|
// This reordering of the VFPU registers in RAM means that instead of being like this:
|
|
|
|
|
|
|
|
// 0x00 0x20 0x40 0x60 -> "columns", the most common direction
|
|
|
|
// 0x01 0x21 0x41 0x61
|
|
|
|
// 0x02 0x22 0x42 0x62
|
|
|
|
// 0x03 0x23 0x43 0x63
|
2014-01-28 10:32:54 +00:00
|
|
|
|
2013-11-27 21:45:17 +00:00
|
|
|
// 0x04 0x24 0x44 0x64
|
|
|
|
// 0x06 0x26 0x45 0x65
|
|
|
|
// ....
|
|
|
|
|
|
|
|
// the VPU registers are effectively organized like this:
|
|
|
|
// 0x00 0x01 0x02 0x03
|
|
|
|
// 0x04 0x05 0x06 0x07
|
2014-01-28 10:32:54 +00:00
|
|
|
// 0x08 0x09 0x0a 0x0b
|
2013-11-27 21:45:17 +00:00
|
|
|
// ....
|
|
|
|
|
2013-11-27 23:08:45 +00:00
|
|
|
// This is because the original indices look like this:
|
|
|
|
// 0XXMMMYY where M is the matrix number.
|
|
|
|
|
|
|
|
// We will now map 0YYMMMXX to 0MMMXXYY.
|
|
|
|
|
2014-01-28 10:32:54 +00:00
|
|
|
// Advantages:
|
2013-11-27 21:45:17 +00:00
|
|
|
// * Columns can be flushed and reloaded faster "at once"
|
|
|
|
// * 4x4 Matrices are contiguous in RAM, making them, too, fast-loadable in NEON
|
|
|
|
|
|
|
|
// Disadvantages:
|
|
|
|
// * Extra indirection, can be confusing and slower (interpreter only)
|
|
|
|
// * Flushing and reloading row registers is now slower
|
2014-01-28 10:32:54 +00:00
|
|
|
|
2013-11-27 21:45:17 +00:00
|
|
|
int i = 0;
|
|
|
|
for (int m = 0; m < 8; m++) {
|
|
|
|
for (int y = 0; y < 4; y++) {
|
|
|
|
for (int x = 0; x < 4; x++) {
|
2013-11-27 23:08:45 +00:00
|
|
|
voffset[m * 4 + x * 32 + y] = i++;
|
2013-11-27 21:45:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// And the inverse.
|
|
|
|
for (int i = 0; i < 128; i++) {
|
|
|
|
fromvoffset[voffset[i]] = i;
|
|
|
|
}
|
|
|
|
|
2013-11-27 23:08:45 +00:00
|
|
|
// Sanity check that things that should be ordered are ordered.
|
2013-11-28 10:47:39 +00:00
|
|
|
static const u8 firstThirtyTwo[] = {
|
|
|
|
0x0, 0x20, 0x40, 0x60,
|
|
|
|
0x1, 0x21, 0x41, 0x61,
|
|
|
|
0x2, 0x22, 0x42, 0x62,
|
|
|
|
0x3, 0x23, 0x43, 0x63,
|
|
|
|
|
|
|
|
0x4, 0x24, 0x44, 0x64,
|
|
|
|
0x5, 0x25, 0x45, 0x65,
|
|
|
|
0x6, 0x26, 0x46, 0x66,
|
|
|
|
0x7, 0x27, 0x47, 0x67,
|
|
|
|
};
|
2014-01-28 10:32:54 +00:00
|
|
|
|
2013-11-28 06:30:48 +00:00
|
|
|
for (int i = 0; i < (int)ARRAY_SIZE(firstThirtyTwo); i++) {
|
2013-11-28 10:47:39 +00:00
|
|
|
if (voffset[firstThirtyTwo[i]] != i) {
|
|
|
|
ERROR_LOG(CPU, "Wrong voffset order! %i: %i should have been %i", firstThirtyTwo[i], voffset[firstThirtyTwo[i]], i);
|
2013-11-27 23:08:45 +00:00
|
|
|
}
|
|
|
|
}
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-01-28 10:32:54 +00:00
|
|
|
MIPSState::~MIPSState() {
|
|
|
|
Shutdown();
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-01-28 10:32:54 +00:00
|
|
|
void MIPSState::Shutdown() {
|
2021-11-28 00:11:51 +00:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
|
2021-11-27 14:00:18 +00:00
|
|
|
MIPSComp::JitInterface *oldjit = MIPSComp::jit;
|
|
|
|
if (oldjit) {
|
|
|
|
MIPSComp::jit = nullptr;
|
|
|
|
delete oldjit;
|
2012-12-26 11:30:08 +00:00
|
|
|
}
|
2014-01-28 10:32:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MIPSState::Reset() {
|
|
|
|
Shutdown();
|
|
|
|
Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MIPSState::Init() {
|
2012-11-01 15:19:01 +00:00
|
|
|
memset(r, 0, sizeof(r));
|
|
|
|
memset(f, 0, sizeof(f));
|
|
|
|
memset(v, 0, sizeof(v));
|
|
|
|
memset(vfpuCtrl, 0, sizeof(vfpuCtrl));
|
|
|
|
|
|
|
|
vfpuCtrl[VFPU_CTRL_SPREFIX] = 0xe4; //passthru
|
|
|
|
vfpuCtrl[VFPU_CTRL_TPREFIX] = 0xe4; //passthru
|
|
|
|
vfpuCtrl[VFPU_CTRL_DPREFIX] = 0;
|
|
|
|
vfpuCtrl[VFPU_CTRL_CC] = 0x3f;
|
|
|
|
vfpuCtrl[VFPU_CTRL_INF4] = 0;
|
2014-09-02 06:14:04 +00:00
|
|
|
vfpuCtrl[VFPU_CTRL_REV] = 0x7772ceab;
|
2012-11-01 15:19:01 +00:00
|
|
|
vfpuCtrl[VFPU_CTRL_RCX0] = 0x3f800001;
|
|
|
|
vfpuCtrl[VFPU_CTRL_RCX1] = 0x3f800002;
|
|
|
|
vfpuCtrl[VFPU_CTRL_RCX2] = 0x3f800004;
|
|
|
|
vfpuCtrl[VFPU_CTRL_RCX3] = 0x3f800008;
|
|
|
|
vfpuCtrl[VFPU_CTRL_RCX4] = 0x3f800000;
|
|
|
|
vfpuCtrl[VFPU_CTRL_RCX5] = 0x3f800000;
|
|
|
|
vfpuCtrl[VFPU_CTRL_RCX6] = 0x3f800000;
|
|
|
|
vfpuCtrl[VFPU_CTRL_RCX7] = 0x3f800000;
|
|
|
|
|
|
|
|
pc = 0;
|
|
|
|
hi = 0;
|
|
|
|
lo = 0;
|
|
|
|
fpcond = 0;
|
|
|
|
fcr31 = 0;
|
|
|
|
debugCount = 0;
|
|
|
|
currentMIPS = this;
|
|
|
|
inDelaySlot = false;
|
2012-11-07 16:34:25 +00:00
|
|
|
llBit = 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
nextPC = 0;
|
2013-01-14 22:03:23 +00:00
|
|
|
downcount = 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
// Initialize the VFPU random number generator with .. something?
|
|
|
|
rng.Init(0x1337);
|
2014-06-30 15:10:14 +00:00
|
|
|
|
2021-11-28 00:11:51 +00:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
|
2017-03-02 11:36:54 +00:00
|
|
|
if (PSP_CoreParameter().cpuCore == CPUCore::JIT) {
|
2016-04-30 23:20:21 +00:00
|
|
|
MIPSComp::jit = MIPSComp::CreateNativeJit(this);
|
2017-03-02 11:36:54 +00:00
|
|
|
} else if (PSP_CoreParameter().cpuCore == CPUCore::IR_JIT) {
|
2016-05-07 23:43:27 +00:00
|
|
|
MIPSComp::jit = new MIPSComp::IRJit(this);
|
2015-03-05 22:31:03 +00:00
|
|
|
} else {
|
|
|
|
MIPSComp::jit = nullptr;
|
2014-12-07 13:25:22 +00:00
|
|
|
}
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-06-28 06:21:22 +00:00
|
|
|
bool MIPSState::HasDefaultPrefix() const {
|
|
|
|
return vfpuCtrl[VFPU_CTRL_SPREFIX] == 0xe4 && vfpuCtrl[VFPU_CTRL_TPREFIX] == 0xe4 && vfpuCtrl[VFPU_CTRL_DPREFIX] == 0;
|
|
|
|
}
|
|
|
|
|
2014-05-27 06:55:48 +00:00
|
|
|
void MIPSState::UpdateCore(CPUCore desired) {
|
|
|
|
if (PSP_CoreParameter().cpuCore == desired) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
PSP_CoreParameter().cpuCore = desired;
|
2021-11-27 14:00:18 +00:00
|
|
|
MIPSComp::JitInterface *oldjit = MIPSComp::jit;
|
2021-11-28 00:11:51 +00:00
|
|
|
MIPSComp::JitInterface *newjit = nullptr;
|
|
|
|
|
2014-05-27 06:55:48 +00:00
|
|
|
switch (PSP_CoreParameter().cpuCore) {
|
2017-03-02 11:36:54 +00:00
|
|
|
case CPUCore::JIT:
|
2015-03-07 21:29:44 +00:00
|
|
|
INFO_LOG(CPU, "Switching to JIT");
|
2021-11-27 14:00:18 +00:00
|
|
|
if (oldjit) {
|
2021-11-28 00:11:51 +00:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
|
2021-11-27 14:00:18 +00:00
|
|
|
MIPSComp::jit = nullptr;
|
|
|
|
delete oldjit;
|
2014-05-27 06:55:48 +00:00
|
|
|
}
|
2021-11-28 00:11:51 +00:00
|
|
|
newjit = MIPSComp::CreateNativeJit(this);
|
2016-05-07 23:43:27 +00:00
|
|
|
break;
|
|
|
|
|
2017-03-02 11:36:54 +00:00
|
|
|
case CPUCore::IR_JIT:
|
2016-05-07 23:43:27 +00:00
|
|
|
INFO_LOG(CPU, "Switching to IRJIT");
|
2021-11-27 14:00:18 +00:00
|
|
|
if (oldjit) {
|
2021-11-28 00:11:51 +00:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
|
2021-11-27 14:00:18 +00:00
|
|
|
MIPSComp::jit = nullptr;
|
|
|
|
delete oldjit;
|
2016-05-07 23:43:27 +00:00
|
|
|
}
|
2021-11-28 00:11:51 +00:00
|
|
|
newjit = new MIPSComp::IRJit(this);
|
2014-05-27 06:55:48 +00:00
|
|
|
break;
|
|
|
|
|
2017-03-02 11:36:54 +00:00
|
|
|
case CPUCore::INTERPRETER:
|
2015-03-07 21:29:44 +00:00
|
|
|
INFO_LOG(CPU, "Switching to interpreter");
|
2021-11-28 00:11:51 +00:00
|
|
|
if (oldjit) {
|
|
|
|
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
|
|
|
|
MIPSComp::jit = nullptr;
|
|
|
|
delete oldjit;
|
|
|
|
}
|
2014-05-27 06:55:48 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-11-28 00:11:51 +00:00
|
|
|
|
|
|
|
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
|
|
|
|
MIPSComp::jit = newjit;
|
2014-05-27 06:55:48 +00:00
|
|
|
}
|
|
|
|
|
2013-05-19 22:56:37 +00:00
|
|
|
void MIPSState::DoState(PointerWrap &p) {
|
2013-11-27 21:45:17 +00:00
|
|
|
auto s = p.Section("MIPSState", 1, 3);
|
2013-09-15 03:23:03 +00:00
|
|
|
if (!s)
|
|
|
|
return;
|
|
|
|
|
2012-12-28 04:33:10 +00:00
|
|
|
// Reset the jit if we're loading.
|
|
|
|
if (p.mode == p.MODE_READ)
|
|
|
|
Reset();
|
2021-11-28 00:11:51 +00:00
|
|
|
// Assume we're not saving state during a CPU core reset, so no lock.
|
2013-02-18 09:14:57 +00:00
|
|
|
if (MIPSComp::jit)
|
|
|
|
MIPSComp::jit->DoState(p);
|
2013-03-08 16:49:21 +00:00
|
|
|
else
|
2017-11-30 00:07:03 +00:00
|
|
|
MIPSComp::DoDummyJitState(p);
|
2012-12-28 04:33:10 +00:00
|
|
|
|
2020-08-10 04:20:42 +00:00
|
|
|
DoArray(p, r, sizeof(r) / sizeof(r[0]));
|
|
|
|
DoArray(p, f, sizeof(f) / sizeof(f[0]));
|
2013-11-27 21:45:17 +00:00
|
|
|
if (s <= 2) {
|
|
|
|
float vtemp[128];
|
2020-08-10 04:20:42 +00:00
|
|
|
DoArray(p, vtemp, sizeof(v) / sizeof(v[0]));
|
2013-11-27 21:45:17 +00:00
|
|
|
for (int i = 0; i < 128; i++) {
|
|
|
|
v[voffset[i]] = vtemp[i];
|
|
|
|
}
|
|
|
|
} else {
|
2020-08-10 04:20:42 +00:00
|
|
|
DoArray(p, v, sizeof(v) / sizeof(v[0]));
|
2013-11-27 21:45:17 +00:00
|
|
|
}
|
2020-08-10 04:20:42 +00:00
|
|
|
DoArray(p, vfpuCtrl, sizeof(vfpuCtrl) / sizeof(vfpuCtrl[0]));
|
|
|
|
Do(p, pc);
|
|
|
|
Do(p, nextPC);
|
|
|
|
Do(p, downcount);
|
2015-06-28 17:42:19 +00:00
|
|
|
// Reversed, but we can just leave it that way.
|
2020-08-10 04:20:42 +00:00
|
|
|
Do(p, hi);
|
|
|
|
Do(p, lo);
|
|
|
|
Do(p, fpcond);
|
2013-11-14 06:41:25 +00:00
|
|
|
if (s <= 1) {
|
2013-11-15 16:18:34 +00:00
|
|
|
u32 fcr0_unused = 0;
|
2020-08-10 04:20:42 +00:00
|
|
|
Do(p, fcr0_unused);
|
2013-11-14 06:41:25 +00:00
|
|
|
}
|
2020-08-10 04:20:42 +00:00
|
|
|
Do(p, fcr31);
|
|
|
|
Do(p, rng.m_w);
|
|
|
|
Do(p, rng.m_z);
|
|
|
|
Do(p, inDelaySlot);
|
|
|
|
Do(p, llBit);
|
|
|
|
Do(p, debugCount);
|
2018-04-01 17:09:31 +00:00
|
|
|
|
|
|
|
if (p.mode == p.MODE_READ && MIPSComp::jit) {
|
|
|
|
// Now that we've loaded fcr31, update any jit state associated.
|
|
|
|
MIPSComp::jit->UpdateFCR31();
|
|
|
|
}
|
2012-12-28 04:33:10 +00:00
|
|
|
}
|
|
|
|
|
2014-01-28 10:32:54 +00:00
|
|
|
void MIPSState::SingleStep() {
|
2012-11-01 15:19:01 +00:00
|
|
|
int cycles = MIPS_SingleStep();
|
2013-01-11 23:44:18 +00:00
|
|
|
currentMIPS->downcount -= cycles;
|
2012-11-01 15:19:01 +00:00
|
|
|
CoreTiming::Advance();
|
|
|
|
}
|
|
|
|
|
2012-11-19 13:16:37 +00:00
|
|
|
// returns 1 if reached ticks limit
|
2014-01-28 10:32:54 +00:00
|
|
|
int MIPSState::RunLoopUntil(u64 globalTicks) {
|
|
|
|
switch (PSP_CoreParameter().cpuCore) {
|
2017-03-02 11:36:54 +00:00
|
|
|
case CPUCore::JIT:
|
|
|
|
case CPUCore::IR_JIT:
|
2021-05-09 15:40:07 +00:00
|
|
|
while (inDelaySlot) {
|
|
|
|
// We must get out of the delay slot before going into jit.
|
|
|
|
SingleStep();
|
|
|
|
}
|
2012-11-01 15:19:01 +00:00
|
|
|
MIPSComp::jit->RunLoopUntil(globalTicks);
|
2012-11-23 11:42:35 +00:00
|
|
|
break;
|
|
|
|
|
2017-03-02 11:36:54 +00:00
|
|
|
case CPUCore::INTERPRETER:
|
2012-11-23 11:42:35 +00:00
|
|
|
return MIPSInterpret_RunUntil(globalTicks);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
2012-11-19 13:16:37 +00:00
|
|
|
return 1;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-01-28 10:32:54 +00:00
|
|
|
void MIPSState::InvalidateICache(u32 address, int length) {
|
2013-09-01 07:32:17 +00:00
|
|
|
// Only really applies to jit.
|
2021-11-28 00:11:51 +00:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
|
2013-09-01 07:32:17 +00:00
|
|
|
if (MIPSComp::jit)
|
2014-06-19 08:08:45 +00:00
|
|
|
MIPSComp::jit->InvalidateCacheAt(address, length);
|
2013-09-01 07:32:17 +00:00
|
|
|
}
|
2014-12-12 22:48:48 +00:00
|
|
|
|
|
|
|
void MIPSState::ClearJitCache() {
|
2021-11-28 00:11:51 +00:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
|
2014-12-12 22:48:48 +00:00
|
|
|
if (MIPSComp::jit)
|
|
|
|
MIPSComp::jit->ClearCache();
|
2014-12-23 07:58:20 +00:00
|
|
|
}
|