Merge pull request #11758 from unknownbrackets/jitflags

Add flags to turn off parts of jit
This commit is contained in:
Henrik Rydgård 2019-02-04 00:40:34 +01:00 committed by GitHub
commit 60bd2d8a60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 337 additions and 259 deletions

View File

@ -466,6 +466,7 @@ static ConfigSetting cpuSettings[] = {
ConfigSetting("HideSlowWarnings", &g_Config.bHideSlowWarnings, false, true, false), ConfigSetting("HideSlowWarnings", &g_Config.bHideSlowWarnings, false, true, false),
ConfigSetting("HideStateWarnings", &g_Config.bHideStateWarnings, false, true, false), ConfigSetting("HideStateWarnings", &g_Config.bHideStateWarnings, false, true, false),
ConfigSetting("PreloadFunctions", &g_Config.bPreloadFunctions, false, true, true), ConfigSetting("PreloadFunctions", &g_Config.bPreloadFunctions, false, true, true),
ConfigSetting("JitDisableFlags", &g_Config.uJitDisableFlags, (uint32_t)0, true, true),
ReportedConfigSetting("CPUSpeed", &g_Config.iLockedCPUSpeed, 0, true, true), ReportedConfigSetting("CPUSpeed", &g_Config.iLockedCPUSpeed, 0, true, true),
ConfigSetting(false), ConfigSetting(false),

View File

@ -93,6 +93,7 @@ public:
bool bHideSlowWarnings; bool bHideSlowWarnings;
bool bHideStateWarnings; bool bHideStateWarnings;
bool bPreloadFunctions; bool bPreloadFunctions;
uint32_t uJitDisableFlags;
bool bSeparateSASThread; bool bSeparateSASThread;
bool bSeparateIOThread; bool bSeparateIOThread;

View File

@ -43,7 +43,7 @@ using namespace MIPSAnalyst;
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp namespace MIPSComp
@ -72,7 +72,7 @@ namespace MIPSComp
void ArmJit::Comp_IType(MIPSOpcode op) void ArmJit::Comp_IType(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_IMM);
s32 simm = (s32)(s16)(op & 0xFFFF); // sign extension s32 simm = (s32)(s16)(op & 0xFFFF); // sign extension
u32 uimm = op & 0xFFFF; u32 uimm = op & 0xFFFF;
u32 suimm = (u32)(s32)simm; u32 suimm = (u32)(s32)simm;
@ -150,7 +150,7 @@ namespace MIPSComp
void ArmJit::Comp_RType2(MIPSOpcode op) void ArmJit::Comp_RType2(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
@ -234,7 +234,7 @@ namespace MIPSComp
void ArmJit::Comp_RType3(MIPSOpcode op) void ArmJit::Comp_RType3(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
@ -502,7 +502,7 @@ namespace MIPSComp
void ArmJit::Comp_ShiftType(MIPSOpcode op) void ArmJit::Comp_ShiftType(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
int fd = _FD; int fd = _FD;
@ -529,7 +529,7 @@ namespace MIPSComp
void ArmJit::Comp_Special3(MIPSOpcode op) void ArmJit::Comp_Special3(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -591,7 +591,7 @@ namespace MIPSComp
void ArmJit::Comp_Allegrex(MIPSOpcode op) void ArmJit::Comp_Allegrex(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
// Don't change $zr. // Don't change $zr.
@ -645,7 +645,7 @@ namespace MIPSComp
void ArmJit::Comp_Allegrex2(MIPSOpcode op) void ArmJit::Comp_Allegrex2(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
// Don't change $zr. // Don't change $zr.
@ -677,7 +677,7 @@ namespace MIPSComp
void ArmJit::Comp_MulDivType(MIPSOpcode op) void ArmJit::Comp_MulDivType(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(MULDIV);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;

View File

@ -44,7 +44,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp namespace MIPSComp
@ -54,7 +54,7 @@ namespace MIPSComp
void ArmJit::Comp_FPU3op(MIPSOpcode op) void ArmJit::Comp_FPU3op(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU);
int ft = _FT; int ft = _FT;
int fs = _FS; int fs = _FS;
@ -92,7 +92,7 @@ extern int logBlocks;
void ArmJit::Comp_FPULS(MIPSOpcode op) void ArmJit::Comp_FPULS(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_FPU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
s32 offset = (s16)(op & 0xFFFF); s32 offset = (s16)(op & 0xFFFF);
@ -193,7 +193,7 @@ void ArmJit::Comp_FPULS(MIPSOpcode op)
} }
void ArmJit::Comp_FPUComp(MIPSOpcode op) { void ArmJit::Comp_FPUComp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU_COMP);
int opc = op & 0xF; int opc = op & 0xF;
if (opc >= 8) opc -= 8; // alias if (opc >= 8) opc -= 8; // alias
@ -258,7 +258,7 @@ void ArmJit::Comp_FPUComp(MIPSOpcode op) {
} }
void ArmJit::Comp_FPU2op(MIPSOpcode op) { void ArmJit::Comp_FPU2op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU);
int fs = _FS; int fs = _FS;
int fd = _FD; int fd = _FD;
@ -350,7 +350,7 @@ void ArmJit::Comp_FPU2op(MIPSOpcode op) {
void ArmJit::Comp_mxc1(MIPSOpcode op) void ArmJit::Comp_mxc1(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU_XFER);
int fs = _FS; int fs = _FS;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;

View File

@ -42,7 +42,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp namespace MIPSComp
@ -111,14 +111,14 @@ namespace MIPSComp
} }
void ArmJit::Comp_ITypeMemLR(MIPSOpcode op, bool load) { void ArmJit::Comp_ITypeMemLR(MIPSOpcode op, bool load) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
int offset = (signed short)(op & 0xFFFF); int offset = (signed short)(op & 0xFFFF);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
int o = op >> 26; int o = op >> 26;
if (!js.inDelaySlot) { if (!js.inDelaySlot && !jo.Disabled(JitDisable::LSU_UNALIGNED)) {
// Optimisation: Combine to single unaligned load/store // Optimisation: Combine to single unaligned load/store
bool isLeft = (o == 34 || o == 42); bool isLeft = (o == 34 || o == 42);
CheckMemoryBreakpoint(1); CheckMemoryBreakpoint(1);
@ -260,7 +260,7 @@ namespace MIPSComp
void ArmJit::Comp_ITypeMem(MIPSOpcode op) void ArmJit::Comp_ITypeMem(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
int offset = (signed short)(op&0xFFFF); int offset = (signed short)(op&0xFFFF);
bool load = false; bool load = false;

View File

@ -40,7 +40,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } #define DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define NEON_IF_AVAILABLE(func) { if (jo.useNEONVFPU) { func(op); return; } } #define NEON_IF_AVAILABLE(func) { if (jo.useNEONVFPU) { func(op); return; } }
@ -87,7 +87,7 @@ namespace MIPSComp
void ArmJit::Comp_VPFX(MIPSOpcode op) void ArmJit::Comp_VPFX(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int data = op & 0xFFFFF; int data = op & 0xFFFFF;
int regnum = (op >> 24) & 3; int regnum = (op >> 24) & 3;
switch (regnum) { switch (regnum) {
@ -225,7 +225,7 @@ namespace MIPSComp
void ArmJit::Comp_SV(MIPSOpcode op) { void ArmJit::Comp_SV(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_SV); NEON_IF_AVAILABLE(CompNEON_SV);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
s32 offset = (signed short)(op & 0xFFFC); s32 offset = (signed short)(op & 0xFFFC);
@ -332,7 +332,7 @@ namespace MIPSComp
void ArmJit::Comp_SVQ(MIPSOpcode op) void ArmJit::Comp_SVQ(MIPSOpcode op)
{ {
NEON_IF_AVAILABLE(CompNEON_SVQ); NEON_IF_AVAILABLE(CompNEON_SVQ);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
int imm = (signed short)(op&0xFFFC); int imm = (signed short)(op&0xFFFC);
@ -478,7 +478,7 @@ namespace MIPSComp
void ArmJit::Comp_VVectorInit(MIPSOpcode op) void ArmJit::Comp_VVectorInit(MIPSOpcode op)
{ {
NEON_IF_AVAILABLE(CompNEON_VVectorInit); NEON_IF_AVAILABLE(CompNEON_VVectorInit);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
// WARNING: No prefix support! // WARNING: No prefix support!
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
@ -515,7 +515,7 @@ namespace MIPSComp
void ArmJit::Comp_VIdt(MIPSOpcode op) { void ArmJit::Comp_VIdt(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_VIdt); NEON_IF_AVAILABLE(CompNEON_VIdt);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -553,7 +553,7 @@ namespace MIPSComp
void ArmJit::Comp_VMatrixInit(MIPSOpcode op) void ArmJit::Comp_VMatrixInit(MIPSOpcode op)
{ {
NEON_IF_AVAILABLE(CompNEON_VMatrixInit); NEON_IF_AVAILABLE(CompNEON_VMatrixInit);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
// Don't think matrix init ops care about prefixes. // Don't think matrix init ops care about prefixes.
// DISABLE; // DISABLE;
@ -601,7 +601,7 @@ namespace MIPSComp
void ArmJit::Comp_VHdp(MIPSOpcode op) { void ArmJit::Comp_VHdp(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_VHdp); NEON_IF_AVAILABLE(CompNEON_VHdp);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -644,7 +644,7 @@ namespace MIPSComp
void ArmJit::Comp_Vhoriz(MIPSOpcode op) { void ArmJit::Comp_Vhoriz(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vhoriz); NEON_IF_AVAILABLE(CompNEON_Vhoriz);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -687,7 +687,7 @@ namespace MIPSComp
void ArmJit::Comp_VDot(MIPSOpcode op) { void ArmJit::Comp_VDot(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_VDot); NEON_IF_AVAILABLE(CompNEON_VDot);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -724,7 +724,7 @@ namespace MIPSComp
void ArmJit::Comp_VecDo3(MIPSOpcode op) { void ArmJit::Comp_VecDo3(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_VecDo3); NEON_IF_AVAILABLE(CompNEON_VecDo3);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -884,7 +884,7 @@ namespace MIPSComp
void ArmJit::Comp_VV2Op(MIPSOpcode op) { void ArmJit::Comp_VV2Op(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_VV2Op); NEON_IF_AVAILABLE(CompNEON_VV2Op);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1077,7 +1077,7 @@ namespace MIPSComp
void ArmJit::Comp_Vi2f(MIPSOpcode op) { void ArmJit::Comp_Vi2f(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vi2f); NEON_IF_AVAILABLE(CompNEON_Vi2f);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1124,7 +1124,7 @@ namespace MIPSComp
void ArmJit::Comp_Vh2f(MIPSOpcode op) { void ArmJit::Comp_Vh2f(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vh2f); NEON_IF_AVAILABLE(CompNEON_Vh2f);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1186,7 +1186,7 @@ namespace MIPSComp
void ArmJit::Comp_Vf2i(MIPSOpcode op) { void ArmJit::Comp_Vf2i(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vf2i); NEON_IF_AVAILABLE(CompNEON_Vf2i);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
@ -1256,7 +1256,7 @@ namespace MIPSComp
void ArmJit::Comp_Mftv(MIPSOpcode op) { void ArmJit::Comp_Mftv(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Mftv); NEON_IF_AVAILABLE(CompNEON_Mftv);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int imm = op & 0xFF; int imm = op & 0xFF;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -1331,7 +1331,7 @@ namespace MIPSComp
void ArmJit::Comp_Vmfvc(MIPSOpcode op) { void ArmJit::Comp_Vmfvc(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vmtvc); NEON_IF_AVAILABLE(CompNEON_Vmtvc);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS; int vs = _VS;
int imm = op & 0xFF; int imm = op & 0xFF;
@ -1350,7 +1350,7 @@ namespace MIPSComp
void ArmJit::Comp_Vmtvc(MIPSOpcode op) { void ArmJit::Comp_Vmtvc(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vmtvc); NEON_IF_AVAILABLE(CompNEON_Vmtvc);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS; int vs = _VS;
int imm = op & 0xFF; int imm = op & 0xFF;
@ -1377,7 +1377,7 @@ namespace MIPSComp
void ArmJit::Comp_Vmmov(MIPSOpcode op) { void ArmJit::Comp_Vmmov(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vmmov); NEON_IF_AVAILABLE(CompNEON_Vmmov);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// This probably ignores prefixes for all sane intents and purposes. // This probably ignores prefixes for all sane intents and purposes.
if (_VS == _VD) { if (_VS == _VD) {
@ -1415,7 +1415,7 @@ namespace MIPSComp
void ArmJit::Comp_VScl(MIPSOpcode op) { void ArmJit::Comp_VScl(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_VScl); NEON_IF_AVAILABLE(CompNEON_VScl);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1464,7 +1464,7 @@ namespace MIPSComp
} }
void ArmJit::Comp_Vmmul(MIPSOpcode op) { void ArmJit::Comp_Vmmul(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1513,7 +1513,7 @@ namespace MIPSComp
void ArmJit::Comp_Vtfm(MIPSOpcode op) { void ArmJit::Comp_Vtfm(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vtfm); NEON_IF_AVAILABLE(CompNEON_Vtfm);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1584,7 +1584,7 @@ namespace MIPSComp
void ArmJit::Comp_Vi2x(MIPSOpcode op) { void ArmJit::Comp_Vi2x(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vi2x); NEON_IF_AVAILABLE(CompNEON_Vi2x);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1662,7 +1662,7 @@ namespace MIPSComp
void ArmJit::Comp_Vx2i(MIPSOpcode op) { void ArmJit::Comp_Vx2i(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vx2i); NEON_IF_AVAILABLE(CompNEON_Vx2i);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1751,7 +1751,7 @@ namespace MIPSComp
void ArmJit::Comp_VCrossQuat(MIPSOpcode op) { void ArmJit::Comp_VCrossQuat(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_VCrossQuat); NEON_IF_AVAILABLE(CompNEON_VCrossQuat);
// This op does not support prefixes anyway. // This op does not support prefixes anyway.
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1831,7 +1831,7 @@ namespace MIPSComp
void ArmJit::Comp_Vcmp(MIPSOpcode op) { void ArmJit::Comp_Vcmp(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vcmp); NEON_IF_AVAILABLE(CompNEON_Vcmp);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -2019,7 +2019,7 @@ namespace MIPSComp
void ArmJit::Comp_Vcmov(MIPSOpcode op) { void ArmJit::Comp_Vcmov(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vcmov); NEON_IF_AVAILABLE(CompNEON_Vcmov);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -2070,7 +2070,7 @@ namespace MIPSComp
void ArmJit::Comp_Viim(MIPSOpcode op) { void ArmJit::Comp_Viim(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Viim); NEON_IF_AVAILABLE(CompNEON_Viim);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -2088,7 +2088,7 @@ namespace MIPSComp
void ArmJit::Comp_Vfim(MIPSOpcode op) { void ArmJit::Comp_Vfim(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vfim); NEON_IF_AVAILABLE(CompNEON_Vfim);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -2108,7 +2108,7 @@ namespace MIPSComp
void ArmJit::Comp_Vcst(MIPSOpcode op) { void ArmJit::Comp_Vcst(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vcst); NEON_IF_AVAILABLE(CompNEON_Vcst);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -2178,7 +2178,7 @@ namespace MIPSComp
void ArmJit::Comp_VRot(MIPSOpcode op) { void ArmJit::Comp_VRot(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_VRot); NEON_IF_AVAILABLE(CompNEON_VRot);
// VRot probably doesn't accept prefixes anyway. // VRot probably doesn't accept prefixes anyway.
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -2244,7 +2244,7 @@ namespace MIPSComp
void ArmJit::Comp_Vsgn(MIPSOpcode op) { void ArmJit::Comp_Vsgn(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vsgn); NEON_IF_AVAILABLE(CompNEON_Vsgn);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -2293,7 +2293,7 @@ namespace MIPSComp
void ArmJit::Comp_Vocp(MIPSOpcode op) { void ArmJit::Comp_Vocp(MIPSOpcode op) {
NEON_IF_AVAILABLE(CompNEON_Vocp); NEON_IF_AVAILABLE(CompNEON_Vocp);
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }

View File

@ -53,7 +53,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } #define DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define DISABLE_UNKNOWN_PREFIX { WLOG("DISABLE: Unknown Prefix in %s", __FUNCTION__); fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } #define DISABLE_UNKNOWN_PREFIX { WLOG("DISABLE: Unknown Prefix in %s", __FUNCTION__); fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
@ -82,7 +82,7 @@ static const float zero = 0.0f;
void ArmJit::CompNEON_VecDo3(MIPSOpcode op) { void ArmJit::CompNEON_VecDo3(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -158,7 +158,7 @@ void ArmJit::CompNEON_VecDo3(MIPSOpcode op) {
// #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
void ArmJit::CompNEON_SV(MIPSOpcode op) { void ArmJit::CompNEON_SV(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
// Remember to use single lane stores here and not VLDR/VSTR - switching usage // Remember to use single lane stores here and not VLDR/VSTR - switching usage
@ -276,7 +276,7 @@ inline int MIPS_GET_VQVT(u32 op) {
} }
void ArmJit::CompNEON_SVQ(MIPSOpcode op) { void ArmJit::CompNEON_SVQ(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
int offset = (signed short)(op & 0xFFFC); int offset = (signed short)(op & 0xFFFC);
@ -425,7 +425,7 @@ void ArmJit::CompNEON_SVQ(MIPSOpcode op) {
} }
void ArmJit::CompNEON_VVectorInit(MIPSOpcode op) { void ArmJit::CompNEON_VVectorInit(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
// WARNING: No prefix support! // WARNING: No prefix support!
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
@ -450,7 +450,7 @@ void ArmJit::CompNEON_VVectorInit(MIPSOpcode op) {
} }
void ArmJit::CompNEON_VDot(MIPSOpcode op) { void ArmJit::CompNEON_VDot(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -484,7 +484,7 @@ void ArmJit::CompNEON_VDot(MIPSOpcode op) {
void ArmJit::CompNEON_VHdp(MIPSOpcode op) { void ArmJit::CompNEON_VHdp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -496,7 +496,7 @@ void ArmJit::CompNEON_VHdp(MIPSOpcode op) {
} }
void ArmJit::CompNEON_VScl(MIPSOpcode op) { void ArmJit::CompNEON_VScl(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -515,7 +515,7 @@ void ArmJit::CompNEON_VScl(MIPSOpcode op) {
} }
void ArmJit::CompNEON_VV2Op(MIPSOpcode op) { void ArmJit::CompNEON_VV2Op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -666,7 +666,7 @@ void ArmJit::CompNEON_VV2Op(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Mftv(MIPSOpcode op) { void ArmJit::CompNEON_Mftv(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int imm = op & 0xFF; int imm = op & 0xFF;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
switch ((op >> 21) & 0x1f) { switch ((op >> 21) & 0x1f) {
@ -746,7 +746,7 @@ void ArmJit::CompNEON_Vmfvc(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vmtvc(MIPSOpcode op) { void ArmJit::CompNEON_Vmtvc(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS; int vs = _VS;
int imm = op & 0xFF; int imm = op & 0xFF;
@ -767,7 +767,7 @@ void ArmJit::CompNEON_Vmtvc(MIPSOpcode op) {
} }
void ArmJit::CompNEON_VMatrixInit(MIPSOpcode op) { void ArmJit::CompNEON_VMatrixInit(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
MatrixSize msz = GetMtxSize(op); MatrixSize msz = GetMtxSize(op);
int n = GetMatrixSide(msz); int n = GetMatrixSide(msz);
@ -828,7 +828,7 @@ void ArmJit::CompNEON_VMatrixInit(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vmmov(MIPSOpcode op) { void ArmJit::CompNEON_Vmmov(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
if (_VS == _VD) { if (_VS == _VD) {
// A lot of these no-op matrix moves in Wipeout... Just drop the instruction entirely. // A lot of these no-op matrix moves in Wipeout... Just drop the instruction entirely.
return; return;
@ -856,7 +856,7 @@ void ArmJit::CompNEON_Vmmov(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vmmul(MIPSOpcode op) { void ArmJit::CompNEON_Vmmul(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
MatrixSize msz = GetMtxSize(op); MatrixSize msz = GetMtxSize(op);
int n = GetMatrixSide(msz); int n = GetMatrixSide(msz);
@ -895,7 +895,7 @@ void ArmJit::CompNEON_Vmmul(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vmscl(MIPSOpcode op) { void ArmJit::CompNEON_Vmscl(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
MatrixSize msz = GetMtxSize(op); MatrixSize msz = GetMtxSize(op);
@ -920,7 +920,7 @@ void ArmJit::CompNEON_Vmscl(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vtfm(MIPSOpcode op) { void ArmJit::CompNEON_Vtfm(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -986,7 +986,7 @@ void ArmJit::CompNEON_Vf2i(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vi2f(MIPSOpcode op) { void ArmJit::CompNEON_Vi2f(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1012,6 +1012,7 @@ void ArmJit::CompNEON_Vi2f(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vh2f(MIPSOpcode op) { void ArmJit::CompNEON_Vh2f(MIPSOpcode op) {
CONDITIONAL_DISABLE(VFPU_VEC);
if (!cpu_info.bHalf) { if (!cpu_info.bHalf) {
// No hardware support for half-to-float, fallback to interpreter // No hardware support for half-to-float, fallback to interpreter
// TODO: Translate the fast SSE solution to standard integer/VFP stuff // TODO: Translate the fast SSE solution to standard integer/VFP stuff
@ -1045,7 +1046,7 @@ void ArmJit::CompNEON_Vh2f(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vcst(MIPSOpcode op) { void ArmJit::CompNEON_Vcst(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -1063,7 +1064,7 @@ void ArmJit::CompNEON_Vcst(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vhoriz(MIPSOpcode op) { void ArmJit::CompNEON_Vhoriz(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -1102,7 +1103,7 @@ void ArmJit::CompNEON_Vhoriz(MIPSOpcode op) {
} }
void ArmJit::CompNEON_VRot(MIPSOpcode op) { void ArmJit::CompNEON_VRot(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
@ -1121,7 +1122,7 @@ void ArmJit::CompNEON_VRot(MIPSOpcode op) {
} }
void ArmJit::CompNEON_VIdt(MIPSOpcode op) { void ArmJit::CompNEON_VIdt(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -1167,7 +1168,7 @@ void ArmJit::CompNEON_VIdt(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vcmp(MIPSOpcode op) { void ArmJit::CompNEON_Vcmp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1298,7 +1299,7 @@ void ArmJit::CompNEON_Vcmp(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vcmov(MIPSOpcode op) { void ArmJit::CompNEON_Vcmov(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1341,7 +1342,7 @@ void ArmJit::CompNEON_Vcmov(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Viim(MIPSOpcode op) { void ArmJit::CompNEON_Viim(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1358,7 +1359,7 @@ void ArmJit::CompNEON_Viim(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vfim(MIPSOpcode op) { void ArmJit::CompNEON_Vfim(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1379,7 +1380,7 @@ void ArmJit::CompNEON_Vfim(MIPSOpcode op) {
// https://code.google.com/p/bullet/source/browse/branches/PhysicsEffects/include/vecmath/neon/vectormath_neon_assembly_implementations.S?r=2488 // https://code.google.com/p/bullet/source/browse/branches/PhysicsEffects/include/vecmath/neon/vectormath_neon_assembly_implementations.S?r=2488
void ArmJit::CompNEON_VCrossQuat(MIPSOpcode op) { void ArmJit::CompNEON_VCrossQuat(MIPSOpcode op) {
// This op does not support prefixes anyway. // This op does not support prefixes anyway.
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE_UNKNOWN_PREFIX; DISABLE_UNKNOWN_PREFIX;
} }
@ -1427,7 +1428,7 @@ void ArmJit::CompNEON_Vsgn(MIPSOpcode op) {
} }
void ArmJit::CompNEON_Vocp(MIPSOpcode op) { void ArmJit::CompNEON_Vocp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }

View File

@ -44,7 +44,7 @@ using namespace MIPSAnalyst;
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp { namespace MIPSComp {
@ -70,7 +70,7 @@ void Arm64Jit::CompImmLogic(MIPSGPReg rs, MIPSGPReg rt, u32 uimm, void (ARM64XEm
} }
void Arm64Jit::Comp_IType(MIPSOpcode op) { void Arm64Jit::Comp_IType(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_IMM);
s32 simm = (s32)(s16)(op & 0xFFFF); // sign extension s32 simm = (s32)(s16)(op & 0xFFFF); // sign extension
u32 uimm = op & 0xFFFF; u32 uimm = op & 0xFFFF;
u32 suimm = (u32)(s32)simm; u32 suimm = (u32)(s32)simm;
@ -146,7 +146,7 @@ void Arm64Jit::Comp_IType(MIPSOpcode op) {
} }
void Arm64Jit::Comp_RType2(MIPSOpcode op) { void Arm64Jit::Comp_RType2(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
@ -234,7 +234,7 @@ void Arm64Jit::CompType3(MIPSGPReg rd, MIPSGPReg rs, MIPSGPReg rt, void (ARM64XE
} }
void Arm64Jit::Comp_RType3(MIPSOpcode op) { void Arm64Jit::Comp_RType3(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -406,7 +406,7 @@ void Arm64Jit::CompShiftVar(MIPSOpcode op, Arm64Gen::ShiftType shiftType) {
} }
void Arm64Jit::Comp_ShiftType(MIPSOpcode op) { void Arm64Jit::Comp_ShiftType(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
int fd = _FD; int fd = _FD;
@ -431,7 +431,7 @@ void Arm64Jit::Comp_ShiftType(MIPSOpcode op) {
} }
void Arm64Jit::Comp_Special3(MIPSOpcode op) { void Arm64Jit::Comp_Special3(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -479,7 +479,7 @@ void Arm64Jit::Comp_Special3(MIPSOpcode op) {
} }
void Arm64Jit::Comp_Allegrex(MIPSOpcode op) { void Arm64Jit::Comp_Allegrex(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
// Don't change $zr. // Don't change $zr.
@ -529,7 +529,7 @@ void Arm64Jit::Comp_Allegrex(MIPSOpcode op) {
} }
void Arm64Jit::Comp_Allegrex2(MIPSOpcode op) { void Arm64Jit::Comp_Allegrex2(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
// Don't change $zr. // Don't change $zr.
@ -560,7 +560,7 @@ void Arm64Jit::Comp_Allegrex2(MIPSOpcode op) {
} }
void Arm64Jit::Comp_MulDivType(MIPSOpcode op) { void Arm64Jit::Comp_MulDivType(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(MULDIV);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;

View File

@ -52,7 +52,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp { namespace MIPSComp {
@ -60,7 +60,7 @@ namespace MIPSComp {
using namespace Arm64JitConstants; using namespace Arm64JitConstants;
void Arm64Jit::Comp_FPU3op(MIPSOpcode op) { void Arm64Jit::Comp_FPU3op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU);
int ft = _FT; int ft = _FT;
int fs = _FS; int fs = _FS;
@ -80,7 +80,7 @@ void Arm64Jit::Comp_FPU3op(MIPSOpcode op) {
void Arm64Jit::Comp_FPULS(MIPSOpcode op) void Arm64Jit::Comp_FPULS(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_FPU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
// Surprisingly, these work fine alraedy. // Surprisingly, these work fine alraedy.
@ -152,7 +152,7 @@ void Arm64Jit::Comp_FPULS(MIPSOpcode op)
} }
void Arm64Jit::Comp_FPUComp(MIPSOpcode op) { void Arm64Jit::Comp_FPUComp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU_COMP);
int opc = op & 0xF; int opc = op & 0xF;
if (opc >= 8) opc -= 8; // alias if (opc >= 8) opc -= 8; // alias
@ -198,7 +198,7 @@ void Arm64Jit::Comp_FPUComp(MIPSOpcode op) {
} }
void Arm64Jit::Comp_FPU2op(MIPSOpcode op) { void Arm64Jit::Comp_FPU2op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU);
int fs = _FS; int fs = _FS;
int fd = _FD; int fd = _FD;
@ -301,7 +301,7 @@ void Arm64Jit::Comp_FPU2op(MIPSOpcode op) {
void Arm64Jit::Comp_mxc1(MIPSOpcode op) void Arm64Jit::Comp_mxc1(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU_XFER);
int fs = _FS; int fs = _FS;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;

View File

@ -42,7 +42,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp { namespace MIPSComp {
@ -110,14 +110,14 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_ITypeMemLR(MIPSOpcode op, bool load) { void Arm64Jit::Comp_ITypeMemLR(MIPSOpcode op, bool load) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
int offset = (signed short)(op & 0xFFFF); int offset = (signed short)(op & 0xFFFF);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
int o = op >> 26; int o = op >> 26;
if (!js.inDelaySlot) { if (!js.inDelaySlot && !jo.Disabled(JitDisable::LSU_UNALIGNED)) {
// Optimisation: Combine to single unaligned load/store // Optimisation: Combine to single unaligned load/store
bool isLeft = (o == 34 || o == 42); bool isLeft = (o == 34 || o == 42);
CheckMemoryBreakpoint(1); CheckMemoryBreakpoint(1);
@ -256,7 +256,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_ITypeMem(MIPSOpcode op) { void Arm64Jit::Comp_ITypeMem(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
int offset = (signed short)(op & 0xFFFF); int offset = (signed short)(op & 0xFFFF);

View File

@ -38,7 +38,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } #define DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define _RS MIPS_GET_RS(op) #define _RS MIPS_GET_RS(op)
@ -80,7 +80,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VPFX(MIPSOpcode op) { void Arm64Jit::Comp_VPFX(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int data = op & 0xFFFFF; int data = op & 0xFFFFF;
int regnum = (op >> 24) & 3; int regnum = (op >> 24) & 3;
switch (regnum) { switch (regnum) {
@ -201,7 +201,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_SV(MIPSOpcode op) { void Arm64Jit::Comp_SV(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
s32 offset = (signed short)(op & 0xFFFC); s32 offset = (signed short)(op & 0xFFFC);
@ -275,7 +275,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_SVQ(MIPSOpcode op) { void Arm64Jit::Comp_SVQ(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
CheckMemoryBreakpoint(); CheckMemoryBreakpoint();
int imm = (signed short)(op&0xFFFC); int imm = (signed short)(op&0xFFFC);
@ -359,7 +359,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VVectorInit(MIPSOpcode op) { void Arm64Jit::Comp_VVectorInit(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
// WARNING: No prefix support! // WARNING: No prefix support!
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
@ -393,7 +393,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VIdt(MIPSOpcode op) { void Arm64Jit::Comp_VIdt(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -428,7 +428,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VMatrixInit(MIPSOpcode op) { void Arm64Jit::Comp_VMatrixInit(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
// Don't think matrix init ops care about prefixes. // Don't think matrix init ops care about prefixes.
// DISABLE; // DISABLE;
@ -475,7 +475,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VHdp(MIPSOpcode op) { void Arm64Jit::Comp_VHdp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -517,7 +517,7 @@ namespace MIPSComp {
alignas(16) static const float vavg_table[4] = { 1.0f, 1.0f / 2.0f, 1.0f / 3.0f, 1.0f / 4.0f }; alignas(16) static const float vavg_table[4] = { 1.0f, 1.0f / 2.0f, 1.0f / 3.0f, 1.0f / 4.0f };
void Arm64Jit::Comp_Vhoriz(MIPSOpcode op) { void Arm64Jit::Comp_Vhoriz(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -559,7 +559,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VDot(MIPSOpcode op) { void Arm64Jit::Comp_VDot(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -595,7 +595,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VecDo3(MIPSOpcode op) { void Arm64Jit::Comp_VecDo3(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -744,7 +744,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VV2Op(MIPSOpcode op) { void Arm64Jit::Comp_VV2Op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -884,7 +884,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vi2f(MIPSOpcode op) { void Arm64Jit::Comp_Vi2f(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -931,7 +931,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vh2f(MIPSOpcode op) { void Arm64Jit::Comp_Vh2f(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -978,6 +978,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Mftv(MIPSOpcode op) { void Arm64Jit::Comp_Mftv(MIPSOpcode op) {
CONDITIONAL_DISABLE(VFPU_XFER);
int imm = op & 0xFF; int imm = op & 0xFF;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
switch ((op >> 21) & 0x1f) { switch ((op >> 21) & 0x1f) {
@ -1063,7 +1064,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vmfvc(MIPSOpcode op) { void Arm64Jit::Comp_Vmfvc(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS; int vs = _VS;
int imm = op & 0xFF; int imm = op & 0xFF;
@ -1081,7 +1082,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vmtvc(MIPSOpcode op) { void Arm64Jit::Comp_Vmtvc(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS; int vs = _VS;
int imm = op & 0xFF; int imm = op & 0xFF;
@ -1107,7 +1108,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vmmov(MIPSOpcode op) { void Arm64Jit::Comp_Vmmov(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// This probably ignores prefixes for all sane intents and purposes. // This probably ignores prefixes for all sane intents and purposes.
if (_VS == _VD) { if (_VS == _VD) {
@ -1144,7 +1145,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_VScl(MIPSOpcode op) { void Arm64Jit::Comp_VScl(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1193,7 +1194,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vmmul(MIPSOpcode op) { void Arm64Jit::Comp_Vmmul(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1239,7 +1240,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vtfm(MIPSOpcode op) { void Arm64Jit::Comp_Vtfm(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1307,7 +1308,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vi2x(MIPSOpcode op) { void Arm64Jit::Comp_Vi2x(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1376,7 +1377,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vx2i(MIPSOpcode op) { void Arm64Jit::Comp_Vx2i(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1471,7 +1472,7 @@ namespace MIPSComp {
void Arm64Jit::Comp_VCrossQuat(MIPSOpcode op) { void Arm64Jit::Comp_VCrossQuat(MIPSOpcode op) {
// This op does not support prefixes anyway. // This op does not support prefixes anyway.
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1550,7 +1551,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vcmp(MIPSOpcode op) { void Arm64Jit::Comp_Vcmp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1727,7 +1728,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vcmov(MIPSOpcode op) { void Arm64Jit::Comp_Vcmov(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1778,7 +1779,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Viim(MIPSOpcode op) { void Arm64Jit::Comp_Viim(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1795,7 +1796,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vfim(MIPSOpcode op) { void Arm64Jit::Comp_Vfim(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1814,7 +1815,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vcst(MIPSOpcode op) { void Arm64Jit::Comp_Vcst(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1882,7 +1883,7 @@ namespace MIPSComp {
// calling the math library. // calling the math library.
void Arm64Jit::Comp_VRot(MIPSOpcode op) { void Arm64Jit::Comp_VRot(MIPSOpcode op) {
// VRot probably doesn't accept prefixes anyway. // VRot probably doesn't accept prefixes anyway.
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1943,7 +1944,7 @@ namespace MIPSComp {
} }
void Arm64Jit::Comp_Vocp(MIPSOpcode op) { void Arm64Jit::Comp_Vocp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }

View File

@ -38,14 +38,14 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (opts.disableFlags & (uint32_t)JitDisable::flag) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
#define INVALIDOP { Comp_Generic(op); return; } #define INVALIDOP { Comp_Generic(op); return; }
namespace MIPSComp { namespace MIPSComp {
void IRFrontend::Comp_IType(MIPSOpcode op) { void IRFrontend::Comp_IType(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_IMM);
s32 simm = (s32)_IMM16; // sign extension s32 simm = (s32)_IMM16; // sign extension
u32 uimm = (u16)_IMM16; u32 uimm = (u16)_IMM16;
@ -87,7 +87,7 @@ void IRFrontend::Comp_IType(MIPSOpcode op) {
} }
void IRFrontend::Comp_RType2(MIPSOpcode op) { void IRFrontend::Comp_RType2(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
@ -111,7 +111,7 @@ void IRFrontend::Comp_RType2(MIPSOpcode op) {
} }
void IRFrontend::Comp_RType3(MIPSOpcode op) { void IRFrontend::Comp_RType3(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -197,7 +197,7 @@ void IRFrontend::CompShiftVar(MIPSOpcode op, IROp shiftOp) {
} }
void IRFrontend::Comp_ShiftType(MIPSOpcode op) { void IRFrontend::Comp_ShiftType(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
int sa = _SA; int sa = _SA;
@ -222,7 +222,7 @@ void IRFrontend::Comp_ShiftType(MIPSOpcode op) {
} }
void IRFrontend::Comp_Special3(MIPSOpcode op) { void IRFrontend::Comp_Special3(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -265,7 +265,7 @@ void IRFrontend::Comp_Special3(MIPSOpcode op) {
void IRFrontend::Comp_Allegrex(MIPSOpcode op) { void IRFrontend::Comp_Allegrex(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
@ -293,7 +293,7 @@ void IRFrontend::Comp_Allegrex(MIPSOpcode op) {
} }
void IRFrontend::Comp_Allegrex2(MIPSOpcode op) { void IRFrontend::Comp_Allegrex2(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
@ -315,7 +315,7 @@ void IRFrontend::Comp_Allegrex2(MIPSOpcode op) {
} }
void IRFrontend::Comp_MulDivType(MIPSOpcode op) { void IRFrontend::Comp_MulDivType(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(MULDIV);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;

View File

@ -49,14 +49,14 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (opts.disableFlags & (uint32_t)JitDisable::flag) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
#define INVALIDOP { Comp_Generic(op); return; } #define INVALIDOP { Comp_Generic(op); return; }
namespace MIPSComp { namespace MIPSComp {
void IRFrontend::Comp_FPU3op(MIPSOpcode op) { void IRFrontend::Comp_FPU3op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU);
int ft = _FT; int ft = _FT;
int fs = _FS; int fs = _FS;
@ -74,7 +74,7 @@ void IRFrontend::Comp_FPU3op(MIPSOpcode op) {
} }
void IRFrontend::Comp_FPULS(MIPSOpcode op) { void IRFrontend::Comp_FPULS(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_FPU);
s32 offset = _IMM16; s32 offset = _IMM16;
int ft = _FT; int ft = _FT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -97,7 +97,7 @@ void IRFrontend::Comp_FPULS(MIPSOpcode op) {
} }
void IRFrontend::Comp_FPUComp(MIPSOpcode op) { void IRFrontend::Comp_FPUComp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU_COMP);
int opc = op & 0xF; int opc = op & 0xF;
if (opc >= 8) opc -= 8; // alias if (opc >= 8) opc -= 8; // alias
@ -139,7 +139,7 @@ void IRFrontend::Comp_FPUComp(MIPSOpcode op) {
} }
void IRFrontend::Comp_FPU2op(MIPSOpcode op) { void IRFrontend::Comp_FPU2op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU);
int fs = _FS; int fs = _FS;
int fd = _FD; int fd = _FD;
@ -185,7 +185,7 @@ void IRFrontend::Comp_FPU2op(MIPSOpcode op) {
} }
void IRFrontend::Comp_mxc1(MIPSOpcode op) { void IRFrontend::Comp_mxc1(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU_XFER);
int fs = _FS; int fs = _FS;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;

View File

@ -39,13 +39,13 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (opts.disableFlags & (uint32_t)JitDisable::flag) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
#define INVALIDOP { Comp_Generic(op); return; } #define INVALIDOP { Comp_Generic(op); return; }
namespace MIPSComp { namespace MIPSComp {
void IRFrontend::Comp_ITypeMem(MIPSOpcode op) { void IRFrontend::Comp_ITypeMem(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
int offset = _IMM16; int offset = _IMM16;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -106,7 +106,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Cache(MIPSOpcode op) { void IRFrontend::Comp_Cache(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
// int imm = (s16)(op & 0xFFFF); // int imm = (s16)(op & 0xFFFF);
// int rs = _RS; // int rs = _RS;

View File

@ -35,7 +35,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (opts.disableFlags & (uint32_t)JitDisable::flag) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
#define INVALIDOP { Comp_Generic(op); return; } #define INVALIDOP { Comp_Generic(op); return; }
@ -109,7 +109,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VPFX(MIPSOpcode op) { void IRFrontend::Comp_VPFX(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int data = op & 0xFFFFF; int data = op & 0xFFFFF;
int regnum = (op >> 24) & 3; int regnum = (op >> 24) & 3;
switch (regnum) { switch (regnum) {
@ -274,7 +274,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_SV(MIPSOpcode op) { void IRFrontend::Comp_SV(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
s32 offset = (signed short)(op & 0xFFFC); s32 offset = (signed short)(op & 0xFFFC);
int vt = ((op >> 16) & 0x1f) | ((op & 3) << 5); int vt = ((op >> 16) & 0x1f) | ((op & 3) << 5);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -296,7 +296,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_SVQ(MIPSOpcode op) { void IRFrontend::Comp_SVQ(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
int imm = (signed short)(op & 0xFFFC); int imm = (signed short)(op & 0xFFFC);
int vt = (((op >> 16) & 0x1f)) | ((op & 1) << 5); int vt = (((op >> 16) & 0x1f)) | ((op & 1) << 5);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -342,7 +342,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VVectorInit(MIPSOpcode op) { void IRFrontend::Comp_VVectorInit(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -368,7 +368,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VIdt(MIPSOpcode op) { void IRFrontend::Comp_VIdt(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -406,7 +406,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VMatrixInit(MIPSOpcode op) { void IRFrontend::Comp_VMatrixInit(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
MatrixSize sz = GetMtxSize(op); MatrixSize sz = GetMtxSize(op);
if (sz != M_4x4) { if (sz != M_4x4) {
DISABLE; DISABLE;
@ -447,7 +447,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VHdp(MIPSOpcode op) { void IRFrontend::Comp_VHdp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -487,7 +487,7 @@ namespace MIPSComp {
alignas(16) static const float vavg_table[4] = { 1.0f, 1.0f / 2.0f, 1.0f / 3.0f, 1.0f / 4.0f }; alignas(16) static const float vavg_table[4] = { 1.0f, 1.0f / 2.0f, 1.0f / 3.0f, 1.0f / 4.0f };
void IRFrontend::Comp_Vhoriz(MIPSOpcode op) { void IRFrontend::Comp_Vhoriz(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -524,7 +524,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VDot(MIPSOpcode op) { void IRFrontend::Comp_VDot(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -562,7 +562,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VecDo3(MIPSOpcode op) { void IRFrontend::Comp_VecDo3(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -721,7 +721,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VV2Op(MIPSOpcode op) { void IRFrontend::Comp_VV2Op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -847,7 +847,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vi2f(MIPSOpcode op) { void IRFrontend::Comp_Vi2f(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -894,7 +894,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vh2f(MIPSOpcode op) { void IRFrontend::Comp_Vh2f(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
// Vector expand half to float // Vector expand half to float
// d[N*2] = float(lowerhalf(s[N])), d[N*2+1] = float(upperhalf(s[N])) // d[N*2] = float(lowerhalf(s[N])), d[N*2+1] = float(upperhalf(s[N]))
@ -903,7 +903,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vf2i(MIPSOpcode op) { void IRFrontend::Comp_Vf2i(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
// Vector float to integer // Vector float to integer
// d[N] = int(S[N] * mult) // d[N] = int(S[N] * mult)
@ -913,7 +913,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Mftv(MIPSOpcode op) { void IRFrontend::Comp_Mftv(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int imm = op & 0xFF; int imm = op & 0xFF;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -966,7 +966,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vmfvc(MIPSOpcode op) { void IRFrontend::Comp_Vmfvc(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
// Vector Move from vector control reg (no prefixes) // Vector Move from vector control reg (no prefixes)
// S[0] = VFPU_CTRL[i] // S[0] = VFPU_CTRL[i]
@ -982,7 +982,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vmtvc(MIPSOpcode op) { void IRFrontend::Comp_Vmtvc(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
// Vector Move to vector control reg (no prefixes) // Vector Move to vector control reg (no prefixes)
// VFPU_CTRL[i] = S[0] // VFPU_CTRL[i] = S[0]
@ -1004,7 +1004,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vmmov(MIPSOpcode op) { void IRFrontend::Comp_Vmmov(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// Matrix move (no prefixes) // Matrix move (no prefixes)
// D[N,M] = S[N,M] // D[N,M] = S[N,M]
@ -1061,7 +1061,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vmscl(MIPSOpcode op) { void IRFrontend::Comp_Vmscl(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// Matrix scale, matrix by scalar (no prefixes) // Matrix scale, matrix by scalar (no prefixes)
// d[N,M] = s[N,M] * t[0] // d[N,M] = s[N,M] * t[0]
@ -1099,7 +1099,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VScl(MIPSOpcode op) { void IRFrontend::Comp_VScl(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1173,7 +1173,7 @@ namespace MIPSComp {
// This may or may not be a win when using the IR interpreter... // This may or may not be a win when using the IR interpreter...
// Many more instructions to interpret. // Many more instructions to interpret.
void IRFrontend::Comp_Vmmul(MIPSOpcode op) { void IRFrontend::Comp_Vmmul(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// Matrix multiply (no prefixes) // Matrix multiply (no prefixes)
// D[0 .. N,0 .. M] = S[0 .. N, 0 .. M] * T[0 .. N,0 .. M] // D[0 .. N,0 .. M] = S[0 .. N, 0 .. M] * T[0 .. N,0 .. M]
@ -1256,7 +1256,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vtfm(MIPSOpcode op) { void IRFrontend::Comp_Vtfm(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// Vertex transform, vector by matrix (no prefixes) // Vertex transform, vector by matrix (no prefixes)
// d[N] = s[N*m .. N*m + n-1] dot t[0 .. n-1] // d[N] = s[N*m .. N*m + n-1] dot t[0 .. n-1]
@ -1358,7 +1358,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VCrs(MIPSOpcode op) { void IRFrontend::Comp_VCrs(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1372,7 +1372,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VDet(MIPSOpcode op) { void IRFrontend::Comp_VDet(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1385,7 +1385,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vi2x(MIPSOpcode op) { void IRFrontend::Comp_Vi2x(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1470,7 +1470,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vx2i(MIPSOpcode op) { void IRFrontend::Comp_Vx2i(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1570,7 +1570,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_VCrossQuat(MIPSOpcode op) { void IRFrontend::Comp_VCrossQuat(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
// TODO: Does this instruction even look at prefixes at all? // TODO: Does this instruction even look at prefixes at all?
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1627,7 +1627,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vcmp(MIPSOpcode op) { void IRFrontend::Comp_Vcmp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1651,7 +1651,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vcmov(MIPSOpcode op) { void IRFrontend::Comp_Vcmov(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1690,7 +1690,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Viim(MIPSOpcode op) { void IRFrontend::Comp_Viim(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1705,7 +1705,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vfim(MIPSOpcode op) { void IRFrontend::Comp_Vfim(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1723,7 +1723,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vcst(MIPSOpcode op) { void IRFrontend::Comp_Vcst(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1747,7 +1747,7 @@ namespace MIPSComp {
// Very heavily used by FF:CC. Should be replaced by a fast approximation instead of // Very heavily used by FF:CC. Should be replaced by a fast approximation instead of
// calling the math library. // calling the math library.
void IRFrontend::Comp_VRot(MIPSOpcode op) { void IRFrontend::Comp_VRot(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (!js.HasNoPrefix()) { if (!js.HasNoPrefix()) {
// Prefixes work strangely for this: // Prefixes work strangely for this:
// * They never apply to cos (whether d or s prefixes.) // * They never apply to cos (whether d or s prefixes.)
@ -1797,7 +1797,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vsgn(MIPSOpcode op) { void IRFrontend::Comp_Vsgn(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1835,7 +1835,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vocp(MIPSOpcode op) { void IRFrontend::Comp_Vocp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -1872,7 +1872,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_ColorConv(MIPSOpcode op) { void IRFrontend::Comp_ColorConv(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1883,7 +1883,7 @@ namespace MIPSComp {
} }
void IRFrontend::Comp_Vbfy(MIPSOpcode op) { void IRFrontend::Comp_Vbfy(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;

View File

@ -369,6 +369,7 @@ private:
}; };
struct IROptions { struct IROptions {
uint32_t disableFlags;
bool unalignedLoadStore; bool unalignedLoadStore;
}; };

View File

@ -44,7 +44,8 @@ IRJit::IRJit(MIPSState *mips) : frontend_(mips->HasDefaultPrefix()), mips_(mips)
InitIR(); InitIR();
IROptions opts{}; IROptions opts{};
opts.unalignedLoadStore = true; opts.disableFlags = g_Config.uJitDisableFlags;
opts.unalignedLoadStore = opts.disableFlags & (uint32_t)JitDisable::LSU_UNALIGNED;
frontend_.SetOptions(opts); frontend_.SetOptions(opts);
} }

View File

@ -16,35 +16,38 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Common/CPUDetect.h" #include "Common/CPUDetect.h"
#include "Core/Config.h"
#include "Core/MIPS/JitCommon/JitState.h" #include "Core/MIPS/JitCommon/JitState.h"
#include "Common/MemoryUtil.h" #include "Common/MemoryUtil.h"
namespace MIPSComp { namespace MIPSComp {
JitOptions::JitOptions() { JitOptions::JitOptions() {
disableFlags = g_Config.uJitDisableFlags;
// x86 // x86
enableVFPUSIMD = true; enableVFPUSIMD = !Disabled(JitDisable::SIMD);
// Set by Asm if needed. // Set by Asm if needed.
reserveR15ForAsm = false; reserveR15ForAsm = false;
// ARM/ARM64 // ARM/ARM64
useBackJump = false; useBackJump = false;
useForwardJump = false; useForwardJump = false;
cachePointers = true; cachePointers = !Disabled(JitDisable::CACHE_POINTERS);
// ARM only // ARM only
downcountInRegister = true; downcountInRegister = true;
useNEONVFPU = false; // true useNEONVFPU = false; // true
if (!cpu_info.bNEON) if (!cpu_info.bNEON || Disabled(JitDisable::SIMD))
useNEONVFPU = false; useNEONVFPU = false;
//ARM64 //ARM64
useASIMDVFPU = false; // true useASIMDVFPU = false; // !Disabled(JitDisable::SIMD);
// Common // Common
// We can get block linking to work with W^X by doing even more unprotect/re-protect, but let's try without first. // We can get block linking to work with W^X by doing even more unprotect/re-protect, but let's try without first.
// enableBlocklink = !PlatformIsWXExclusive(); // Revert to this line if block linking is slow in W^X mode // enableBlocklink = !PlatformIsWXExclusive(); // Revert to this line if block linking is slow in W^X mode
enableBlocklink = true; enableBlocklink = !Disabled(JitDisable::BLOCKLINK);
immBranches = false; immBranches = false;
continueBranches = false; continueBranches = false;
continueJumps = false; continueJumps = false;
@ -53,9 +56,13 @@ namespace MIPSComp {
useStaticAlloc = false; useStaticAlloc = false;
enablePointerify = false; enablePointerify = false;
#if PPSSPP_ARCH(ARM64) #if PPSSPP_ARCH(ARM64)
useStaticAlloc = true; useStaticAlloc = !Disabled(JitDisable::STATIC_ALLOC);
// iOS/etc. may disable at runtime if Memory::base is not nicely aligned. // iOS/etc. may disable at runtime if Memory::base is not nicely aligned.
enablePointerify = true; enablePointerify = !Disabled(JitDisable::POINTERIFY);
#endif #endif
} }
bool JitOptions::Disabled(JitDisable bit) {
return (disableFlags & (uint32_t)bit) != 0;
}
} }

View File

@ -173,9 +173,40 @@ namespace MIPSComp {
} }
}; };
enum class JitDisable {
ALU = 0x0001,
ALU_IMM = 0x0002,
ALU_BIT = 0x0004,
MULDIV = 0x0008,
FPU = 0x0010,
FPU_COMP = 0x0040,
FPU_XFER = 0x0080,
VFPU_VEC = 0x0100,
VFPU_MTX = 0x0200,
VFPU_COMP = 0x0400,
VFPU_XFER = 0x0800,
LSU = 0x1000,
LSU_UNALIGNED = 0x2000,
LSU_FPU = 0x4000,
LSU_VFPU = 0x8000,
SIMD = 0x00100000,
BLOCKLINK = 0x00200000,
POINTERIFY = 0x00400000,
STATIC_ALLOC = 0x00800000,
CACHE_POINTERS = 0x01000000,
};
struct JitOptions { struct JitOptions {
JitOptions(); JitOptions();
bool Disabled(JitDisable bit);
uint32_t disableFlags;
// x86 // x86
bool enableVFPUSIMD; bool enableVFPUSIMD;
bool reserveR15ForAsm; bool reserveR15ForAsm;

View File

@ -40,8 +40,8 @@ using namespace MIPSAnalyst;
// All functions should have CONDITIONAL_DISABLE, so we can narrow things down to a file quickly. // All functions should have CONDITIONAL_DISABLE, so we can narrow things down to a file quickly.
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE(ignore) { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp namespace MIPSComp
@ -74,7 +74,7 @@ namespace MIPSComp
void Jit::Comp_IType(MIPSOpcode op) void Jit::Comp_IType(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_IMM);
s32 simm = (s32)_IMM16; // sign extension s32 simm = (s32)_IMM16; // sign extension
u32 uimm = op & 0xFFFF; u32 uimm = op & 0xFFFF;
u32 suimm = (u32)(s32)simm; u32 suimm = (u32)(s32)simm;
@ -197,7 +197,7 @@ namespace MIPSComp
void Jit::Comp_RType2(MIPSOpcode op) void Jit::Comp_RType2(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
@ -378,7 +378,7 @@ namespace MIPSComp
void Jit::Comp_RType3(MIPSOpcode op) void Jit::Comp_RType3(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE CONDITIONAL_DISABLE(ALU);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -668,7 +668,7 @@ namespace MIPSComp
void Jit::Comp_ShiftType(MIPSOpcode op) void Jit::Comp_ShiftType(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU);
int rs = (op>>21) & 0x1F; int rs = (op>>21) & 0x1F;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
int fd = (op>>6) & 0x1F; int fd = (op>>6) & 0x1F;
@ -696,7 +696,7 @@ namespace MIPSComp
void Jit::Comp_Special3(MIPSOpcode op) void Jit::Comp_Special3(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -786,7 +786,7 @@ namespace MIPSComp
void Jit::Comp_Allegrex(MIPSOpcode op) void Jit::Comp_Allegrex(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
// Don't change $zr. // Don't change $zr.
@ -894,7 +894,7 @@ namespace MIPSComp
void Jit::Comp_Allegrex2(MIPSOpcode op) void Jit::Comp_Allegrex2(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE CONDITIONAL_DISABLE(ALU_BIT);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;
// Don't change $zr. // Don't change $zr.
@ -938,7 +938,7 @@ namespace MIPSComp
void Jit::Comp_MulDivType(MIPSOpcode op) void Jit::Comp_MulDivType(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(MULDIV);
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
MIPSGPReg rd = _RD; MIPSGPReg rd = _RD;

View File

@ -42,7 +42,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp { namespace MIPSComp {
@ -86,7 +86,7 @@ void Jit::CompFPTriArith(MIPSOpcode op, void (XEmitter::*arith)(X64Reg reg, OpAr
} }
void Jit::Comp_FPU3op(MIPSOpcode op) { void Jit::Comp_FPU3op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU);
switch (op & 0x3f) { switch (op & 0x3f) {
case 0: CompFPTriArith(op, &XEmitter::ADDSS, false); break; //F(fd) = F(fs) + F(ft); //add case 0: CompFPTriArith(op, &XEmitter::ADDSS, false); break; //F(fd) = F(fs) + F(ft); //add
case 1: CompFPTriArith(op, &XEmitter::SUBSS, true); break; //F(fd) = F(fs) - F(ft); //sub case 1: CompFPTriArith(op, &XEmitter::SUBSS, true); break; //F(fd) = F(fs) - F(ft); //sub
@ -99,7 +99,7 @@ void Jit::Comp_FPU3op(MIPSOpcode op) {
} }
void Jit::Comp_FPULS(MIPSOpcode op) { void Jit::Comp_FPULS(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_FPU);
s32 offset = _IMM16; s32 offset = _IMM16;
int ft = _FT; int ft = _FT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -174,7 +174,7 @@ void Jit::CompFPComp(int lhs, int rhs, u8 compare, bool allowNaN) {
} }
void Jit::Comp_FPUComp(MIPSOpcode op) { void Jit::Comp_FPUComp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU_COMP);
int fs = _FS; int fs = _FS;
int ft = _FT; int ft = _FT;
@ -226,7 +226,7 @@ void Jit::Comp_FPUComp(MIPSOpcode op) {
} }
void Jit::Comp_FPU2op(MIPSOpcode op) { void Jit::Comp_FPU2op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU);
int fs = _FS; int fs = _FS;
int fd = _FD; int fd = _FD;
@ -355,7 +355,7 @@ void Jit::Comp_FPU2op(MIPSOpcode op) {
} }
void Jit::Comp_mxc1(MIPSOpcode op) { void Jit::Comp_mxc1(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(FPU_XFER);
int fs = _FS; int fs = _FS;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;

View File

@ -42,7 +42,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { Comp_Generic(op); return; } #define DISABLE { Comp_Generic(op); return; }
namespace MIPSComp { namespace MIPSComp {
@ -50,7 +50,7 @@ namespace MIPSComp {
void Jit::CompITypeMemRead(MIPSOpcode op, u32 bits, void (XEmitter::*mov)(int, int, X64Reg, OpArg), const void *safeFunc) void Jit::CompITypeMemRead(MIPSOpcode op, u32 bits, void (XEmitter::*mov)(int, int, X64Reg, OpArg), const void *safeFunc)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
int offset = _IMM16; int offset = _IMM16;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -81,7 +81,7 @@ namespace MIPSComp {
void Jit::CompITypeMemWrite(MIPSOpcode op, u32 bits, const void *safeFunc) void Jit::CompITypeMemWrite(MIPSOpcode op, u32 bits, const void *safeFunc)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
int offset = _IMM16; int offset = _IMM16;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -137,7 +137,7 @@ namespace MIPSComp {
void Jit::CompITypeMemUnpairedLR(MIPSOpcode op, bool isStore) void Jit::CompITypeMemUnpairedLR(MIPSOpcode op, bool isStore)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
int o = op>>26; int o = op>>26;
int offset = _IMM16; int offset = _IMM16;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -193,7 +193,7 @@ namespace MIPSComp {
void Jit::CompITypeMemUnpairedLRInner(MIPSOpcode op, X64Reg shiftReg) void Jit::CompITypeMemUnpairedLRInner(MIPSOpcode op, X64Reg shiftReg)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
int o = op>>26; int o = op>>26;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -285,7 +285,7 @@ namespace MIPSComp {
void Jit::Comp_ITypeMem(MIPSOpcode op) void Jit::Comp_ITypeMem(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU);
int offset = _IMM16; int offset = _IMM16;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
MIPSGPReg rs = _RS; MIPSGPReg rs = _RS;
@ -334,7 +334,7 @@ namespace MIPSComp {
MIPSOpcode nextOp = GetOffsetInstruction(1); MIPSOpcode nextOp = GetOffsetInstruction(1);
// Looking for lwr rd, offset-3(rs) which makes a pair. // Looking for lwr rd, offset-3(rs) which makes a pair.
u32 desiredOp = ((op & 0xFFFF0000) + (4 << 26)) + (offset - 3); u32 desiredOp = ((op & 0xFFFF0000) + (4 << 26)) + (offset - 3);
if (!js.inDelaySlot && nextOp == desiredOp) if (!js.inDelaySlot && nextOp == desiredOp && !jo.Disabled(JitDisable::LSU_UNALIGNED))
{ {
EatInstruction(nextOp); EatInstruction(nextOp);
// nextOp has the correct address. // nextOp has the correct address.
@ -350,7 +350,7 @@ namespace MIPSComp {
MIPSOpcode nextOp = GetOffsetInstruction(1); MIPSOpcode nextOp = GetOffsetInstruction(1);
// Looking for lwl rd, offset+3(rs) which makes a pair. // Looking for lwl rd, offset+3(rs) which makes a pair.
u32 desiredOp = ((op & 0xFFFF0000) - (4 << 26)) + (offset + 3); u32 desiredOp = ((op & 0xFFFF0000) - (4 << 26)) + (offset + 3);
if (!js.inDelaySlot && nextOp == desiredOp) if (!js.inDelaySlot && nextOp == desiredOp && !jo.Disabled(JitDisable::LSU_UNALIGNED))
{ {
EatInstruction(nextOp); EatInstruction(nextOp);
// op has the correct address. // op has the correct address.
@ -366,7 +366,7 @@ namespace MIPSComp {
MIPSOpcode nextOp = GetOffsetInstruction(1); MIPSOpcode nextOp = GetOffsetInstruction(1);
// Looking for swr rd, offset-3(rs) which makes a pair. // Looking for swr rd, offset-3(rs) which makes a pair.
u32 desiredOp = ((op & 0xFFFF0000) + (4 << 26)) + (offset - 3); u32 desiredOp = ((op & 0xFFFF0000) + (4 << 26)) + (offset - 3);
if (!js.inDelaySlot && nextOp == desiredOp) if (!js.inDelaySlot && nextOp == desiredOp && !jo.Disabled(JitDisable::LSU_UNALIGNED))
{ {
EatInstruction(nextOp); EatInstruction(nextOp);
// nextOp has the correct address. // nextOp has the correct address.
@ -382,7 +382,7 @@ namespace MIPSComp {
MIPSOpcode nextOp = GetOffsetInstruction(1); MIPSOpcode nextOp = GetOffsetInstruction(1);
// Looking for swl rd, offset+3(rs) which makes a pair. // Looking for swl rd, offset+3(rs) which makes a pair.
u32 desiredOp = ((op & 0xFFFF0000) - (4 << 26)) + (offset + 3); u32 desiredOp = ((op & 0xFFFF0000) - (4 << 26)) + (offset + 3);
if (!js.inDelaySlot && nextOp == desiredOp) if (!js.inDelaySlot && nextOp == desiredOp && !jo.Disabled(JitDisable::LSU_UNALIGNED))
{ {
EatInstruction(nextOp); EatInstruction(nextOp);
// op has the correct address. // op has the correct address.

View File

@ -42,7 +42,7 @@
// Currently known non working ones should have DISABLE. // Currently known non working ones should have DISABLE.
// #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocks(); Comp_Generic(op); return; } // #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocks(); Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE ; #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { fpr.ReleaseSpillLocks(); Comp_Generic(op); return; } #define DISABLE { fpr.ReleaseSpillLocks(); Comp_Generic(op); return; }
#define _RS MIPS_GET_RS(op) #define _RS MIPS_GET_RS(op)
@ -74,7 +74,7 @@ alignas(16) const float identityMatrix[4][4] = { { 1.0f, 0, 0, 0 }, { 0, 1.0f, 0
void Jit::Comp_VPFX(MIPSOpcode op) void Jit::Comp_VPFX(MIPSOpcode op)
{ {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int data = op & 0xFFFFF; int data = op & 0xFFFFF;
int regnum = (op >> 24) & 3; int regnum = (op >> 24) & 3;
switch (regnum) { switch (regnum) {
@ -239,7 +239,7 @@ bool IsOverlapSafe(int dreg, int di, int sn, u8 sregs[], int tn = 0, u8 tregs[]
alignas(16) static u32 ssLoadStoreTemp; alignas(16) static u32 ssLoadStoreTemp;
void Jit::Comp_SV(MIPSOpcode op) { void Jit::Comp_SV(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
s32 imm = (signed short)(op&0xFFFC); s32 imm = (signed short)(op&0xFFFC);
int vt = ((op >> 16) & 0x1f) | ((op & 3) << 5); int vt = ((op >> 16) & 0x1f) | ((op & 3) << 5);
@ -294,7 +294,7 @@ void Jit::Comp_SV(MIPSOpcode op) {
} }
void Jit::Comp_SVQ(MIPSOpcode op) { void Jit::Comp_SVQ(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(LSU_VFPU);
int imm = (signed short)(op&0xFFFC); int imm = (signed short)(op&0xFFFC);
int vt = (((op >> 16) & 0x1f)) | ((op&1) << 5); int vt = (((op >> 16) & 0x1f)) | ((op&1) << 5);
@ -502,7 +502,7 @@ void Jit::Comp_SVQ(MIPSOpcode op) {
} }
void Jit::Comp_VVectorInit(MIPSOpcode op) { void Jit::Comp_VVectorInit(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -557,7 +557,7 @@ void Jit::Comp_VVectorInit(MIPSOpcode op) {
} }
void Jit::Comp_VIdt(MIPSOpcode op) { void Jit::Comp_VIdt(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -608,7 +608,7 @@ void Jit::Comp_VIdt(MIPSOpcode op) {
} }
void Jit::Comp_VDot(MIPSOpcode op) { void Jit::Comp_VDot(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -739,7 +739,7 @@ void Jit::Comp_VDot(MIPSOpcode op) {
void Jit::Comp_VHdp(MIPSOpcode op) { void Jit::Comp_VHdp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -788,7 +788,7 @@ void Jit::Comp_VHdp(MIPSOpcode op) {
} }
void Jit::Comp_VCrossQuat(MIPSOpcode op) { void Jit::Comp_VCrossQuat(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -921,7 +921,7 @@ void Jit::Comp_VCrossQuat(MIPSOpcode op) {
} }
void Jit::Comp_Vcmov(MIPSOpcode op) { void Jit::Comp_Vcmov(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -997,7 +997,7 @@ static s32 DoVmaxSS(s32 treg) {
} }
void Jit::Comp_VecDo3(MIPSOpcode op) { void Jit::Comp_VecDo3(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1269,7 +1269,7 @@ alignas(16) static const u32 vcmpMask[4][4] = {
}; };
void Jit::Comp_Vcmp(MIPSOpcode op) { void Jit::Comp_Vcmp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_COMP);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1512,7 +1512,7 @@ extern const float mulTableVi2f[32] = {
}; };
void Jit::Comp_Vi2f(MIPSOpcode op) { void Jit::Comp_Vi2f(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1599,7 +1599,7 @@ void Jit::Comp_Vi2f(MIPSOpcode op) {
// Translation of ryg's half_to_float5_SSE2 // Translation of ryg's half_to_float5_SSE2
void Jit::Comp_Vh2f(MIPSOpcode op) { void Jit::Comp_Vh2f(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1688,7 +1688,7 @@ alignas(16) static s8 vc2i_shuffle[16] = { -1, -1, -1, 0, -1, -1, -1, 1, -1, -
alignas(16) static s8 vuc2i_shuffle[16] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3 }; alignas(16) static s8 vuc2i_shuffle[16] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3 };
void Jit::Comp_Vx2i(MIPSOpcode op) { void Jit::Comp_Vx2i(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1811,7 +1811,7 @@ static const float half = 0.5f;
static const double maxMinIntAsDouble[2] = { (double)0x7fffffff, (double)(int)0x80000000 }; // that's not equal to 0x80000000 static const double maxMinIntAsDouble[2] = { (double)0x7fffffff, (double)(int)0x80000000 }; // that's not equal to 0x80000000
void Jit::Comp_Vf2i(MIPSOpcode op) { void Jit::Comp_Vf2i(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1920,7 +1920,7 @@ void Jit::Comp_Vf2i(MIPSOpcode op) {
} }
void Jit::Comp_Vcst(MIPSOpcode op) { void Jit::Comp_Vcst(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -1957,7 +1957,7 @@ void Jit::Comp_Vcst(MIPSOpcode op) {
} }
void Jit::Comp_Vsgn(MIPSOpcode op) { void Jit::Comp_Vsgn(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -2018,7 +2018,7 @@ void Jit::Comp_Vsgn(MIPSOpcode op) {
} }
void Jit::Comp_Vocp(MIPSOpcode op) { void Jit::Comp_Vocp(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -2067,7 +2067,7 @@ void Jit::Comp_Vocp(MIPSOpcode op) {
} }
void Jit::Comp_Vbfy(MIPSOpcode op) { void Jit::Comp_Vbfy(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -2181,7 +2181,7 @@ void SinCosNegSin(SinCosArg angle, float *output) {
} }
void Jit::Comp_VV2Op(MIPSOpcode op) { void Jit::Comp_VV2Op(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -2419,7 +2419,7 @@ void Jit::Comp_VV2Op(MIPSOpcode op) {
} }
void Jit::Comp_Mftv(MIPSOpcode op) { void Jit::Comp_Mftv(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int imm = op & 0xFF; int imm = op & 0xFF;
MIPSGPReg rt = _RT; MIPSGPReg rt = _RT;
@ -2509,7 +2509,7 @@ void Jit::Comp_Mftv(MIPSOpcode op) {
} }
void Jit::Comp_Vmfvc(MIPSOpcode op) { void Jit::Comp_Vmfvc(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS; int vs = _VS;
int imm = op & 0xFF; int imm = op & 0xFF;
if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) { if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) {
@ -2525,7 +2525,7 @@ void Jit::Comp_Vmfvc(MIPSOpcode op) {
} }
void Jit::Comp_Vmtvc(MIPSOpcode op) { void Jit::Comp_Vmtvc(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
int vs = _VS; int vs = _VS;
int imm = op & 0xFF; int imm = op & 0xFF;
if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) { if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) {
@ -2549,7 +2549,7 @@ void Jit::Comp_Vmtvc(MIPSOpcode op) {
} }
void Jit::Comp_VMatrixInit(MIPSOpcode op) { void Jit::Comp_VMatrixInit(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -2632,7 +2632,7 @@ void Jit::Comp_VMatrixInit(MIPSOpcode op) {
} }
void Jit::Comp_Vmmov(MIPSOpcode op) { void Jit::Comp_Vmmov(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// TODO: This probably ignores prefixes? // TODO: This probably ignores prefixes?
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
@ -2718,7 +2718,7 @@ void Jit::Comp_Vmmov(MIPSOpcode op) {
} }
void Jit::Comp_VScl(MIPSOpcode op) { void Jit::Comp_VScl(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -2780,7 +2780,7 @@ void Jit::Comp_VScl(MIPSOpcode op) {
} }
void Jit::Comp_Vmmul(MIPSOpcode op) { void Jit::Comp_Vmmul(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// TODO: This probably ignores prefixes? // TODO: This probably ignores prefixes?
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
@ -2974,7 +2974,7 @@ void Jit::Comp_Vmmul(MIPSOpcode op) {
} }
void Jit::Comp_Vmscl(MIPSOpcode op) { void Jit::Comp_Vmscl(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// TODO: This op probably ignores prefixes? // TODO: This op probably ignores prefixes?
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
@ -3020,7 +3020,7 @@ void Jit::Comp_Vmscl(MIPSOpcode op) {
} }
void Jit::Comp_Vtfm(MIPSOpcode op) { void Jit::Comp_Vtfm(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_MTX);
// TODO: This probably ignores prefixes? Or maybe uses D? // TODO: This probably ignores prefixes? Or maybe uses D?
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
@ -3163,7 +3163,7 @@ alignas(16) static const s8 vi2xc_shuffle[16] = { 3, 7, 11, 15, -1, -1, -1, -1,
alignas(16) static const s8 vi2xs_shuffle[16] = { 2, 3, 6, 7, 10, 11, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1 }; alignas(16) static const s8 vi2xs_shuffle[16] = { 2, 3, 6, 7, 10, 11, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1 };
void Jit::Comp_Vi2x(MIPSOpcode op) { void Jit::Comp_Vi2x(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -3295,7 +3295,7 @@ void Jit::Comp_Vi2x(MIPSOpcode op) {
alignas(16) static const float vavg_table[4] = { 1.0f, 1.0f / 2.0f, 1.0f / 3.0f, 1.0f / 4.0f }; alignas(16) static const float vavg_table[4] = { 1.0f, 1.0f / 2.0f, 1.0f / 3.0f, 1.0f / 4.0f };
void Jit::Comp_Vhoriz(MIPSOpcode op) { void Jit::Comp_Vhoriz(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -3412,7 +3412,7 @@ void Jit::Comp_Vhoriz(MIPSOpcode op) {
} }
void Jit::Comp_Viim(MIPSOpcode op) { void Jit::Comp_Viim(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -3435,7 +3435,7 @@ void Jit::Comp_Viim(MIPSOpcode op) {
} }
void Jit::Comp_Vfim(MIPSOpcode op) { void Jit::Comp_Vfim(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_XFER);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;
@ -3497,7 +3497,7 @@ void Jit::CompVrotShuffle(u8 *dregs, int imm, int n, bool negSin) {
// Very heavily used by FF:CC // Very heavily used by FF:CC
void Jit::Comp_VRot(MIPSOpcode op) { void Jit::Comp_VRot(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) { if (js.HasUnknownPrefix()) {
DISABLE; DISABLE;
} }
@ -3569,7 +3569,7 @@ void Jit::Comp_VRot(MIPSOpcode op) {
} }
void Jit::Comp_ColorConv(MIPSOpcode op) { void Jit::Comp_ColorConv(MIPSOpcode op) {
CONDITIONAL_DISABLE; CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) if (js.HasUnknownPrefix())
DISABLE; DISABLE;

View File

@ -462,6 +462,8 @@ namespace Reporting
return false; return false;
if (g_Config.iLockedCPUSpeed != 0) if (g_Config.iLockedCPUSpeed != 0)
return false; return false;
if (g_Config.uJitDisableFlags != 0)
return false;
// Don't allow builds without version info from git. They're useless for reporting. // Don't allow builds without version info from git. They're useless for reporting.
if (strcmp(PPSSPP_GIT_VERSION, "unknown") == 0) if (strcmp(PPSSPP_GIT_VERSION, "unknown") == 0)
return false; return false;

View File

@ -658,10 +658,16 @@ void PopupHeader::Draw(UIContext &dc) {
} }
} }
void CheckBox::Toggle(){ void CheckBox::Toggle() {
if (toggle_) if (toggle_)
*toggle_ = !(*toggle_); *toggle_ = !(*toggle_);
}; }
bool CheckBox::Toggled() const {
if (toggle_)
return toggle_;
return false;
}
EventReturn CheckBox::OnClicked(EventParams &e) { EventReturn CheckBox::OnClicked(EventParams &e) {
Toggle(); Toggle();
@ -676,7 +682,7 @@ void CheckBox::Draw(UIContext &dc) {
ClickableItem::Draw(dc); ClickableItem::Draw(dc);
int image = *toggle_ ? dc.theme->checkOn : dc.theme->checkOff; int image = Toggled() ? dc.theme->checkOn : dc.theme->checkOff;
float imageW, imageH; float imageW, imageH;
dc.Draw()->MeasureImage(image, &imageW, &imageH); dc.Draw()->MeasureImage(image, &imageW, &imageH);
@ -703,7 +709,7 @@ float CheckBox::CalculateTextScale(const UIContext &dc, float availWidth) const
} }
void CheckBox::GetContentDimensions(const UIContext &dc, float &w, float &h) const { void CheckBox::GetContentDimensions(const UIContext &dc, float &w, float &h) const {
int image = *toggle_ ? dc.theme->checkOn : dc.theme->checkOff; int image = Toggled() ? dc.theme->checkOn : dc.theme->checkOff;
float imageW, imageH; float imageW, imageH;
dc.Draw()->MeasureImage(image, &imageW, &imageH); dc.Draw()->MeasureImage(image, &imageW, &imageH);
@ -724,6 +730,17 @@ void CheckBox::GetContentDimensions(const UIContext &dc, float &w, float &h) con
h = std::max(actualHeight, ITEM_HEIGHT); h = std::max(actualHeight, ITEM_HEIGHT);
} }
void BitCheckBox::Toggle() {
if (bitfield_)
*bitfield_ = *bitfield_ ^ bit_;
}
bool BitCheckBox::Toggled() const {
if (bitfield_)
return (bit_ & *bitfield_) == bit_;
return false;
}
void Button::GetContentDimensions(const UIContext &dc, float &w, float &h) const { void Button::GetContentDimensions(const UIContext &dc, float &w, float &h) const {
if (imageID_ != -1) { if (imageID_ != -1) {
const AtlasImage *img = &dc.Draw()->GetAtlas()->images[imageID_]; const AtlasImage *img = &dc.Draw()->GetAtlas()->images[imageID_];

View File

@ -742,7 +742,8 @@ public:
EventReturn OnClicked(EventParams &e); EventReturn OnClicked(EventParams &e);
//allow external agents to toggle the checkbox //allow external agents to toggle the checkbox
void Toggle(); virtual void Toggle();
virtual bool Toggled() const;
private: private:
float CalculateTextScale(const UIContext &dc, float availWidth) const; float CalculateTextScale(const UIContext &dc, float availWidth) const;
@ -751,6 +752,20 @@ private:
std::string smallText_; std::string smallText_;
}; };
class BitCheckBox : public CheckBox {
public:
BitCheckBox(uint32_t *bitfield, uint32_t bit, const std::string &text, const std::string &smallText = "", LayoutParams *layoutParams = nullptr)
: CheckBox(nullptr, text, smallText, layoutParams), bitfield_(bitfield), bit_(bit) {
}
void Toggle() override;
bool Toggled() const override;
private:
uint32_t *bitfield_;
uint32_t bit_;
};
// These are for generic use. // These are for generic use.
class Spacer : public InertView { class Spacer : public InertView {