[Project64] WriteBack_GPR instead of unmap

This commit is contained in:
zilmar 2016-11-22 22:39:24 +11:00
parent 7cf0fe045f
commit 13fa7446df
4 changed files with 156 additions and 124 deletions

View File

@ -1883,7 +1883,7 @@ void CArmRecompilerOps::ADDIU()
void CArmRecompilerOps::SLTI()
{
UnMap_GPR(m_Opcode.rt, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SLTI, "R4300iOp32::SLTI");
@ -1897,7 +1897,7 @@ void CArmRecompilerOps::SLTI()
void CArmRecompilerOps::SLTIU()
{
UnMap_GPR(m_Opcode.rt, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SLTIU, "R4300iOp32::SLTIU");
@ -1911,7 +1911,7 @@ void CArmRecompilerOps::SLTIU()
void CArmRecompilerOps::ANDI()
{
UnMap_GPR(m_Opcode.rt, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::ANDI, "R4300iOp32::ANDI");
@ -1925,7 +1925,7 @@ void CArmRecompilerOps::ANDI()
void CArmRecompilerOps::ORI()
{
UnMap_GPR(m_Opcode.rt, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::ORI, "R4300iOp32::ORI");
@ -1939,7 +1939,7 @@ void CArmRecompilerOps::ORI()
void CArmRecompilerOps::XORI()
{
UnMap_GPR(m_Opcode.rt, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::XORI, "R4300iOp32::XORI");
@ -1965,7 +1965,7 @@ void CArmRecompilerOps::LUI()
void CArmRecompilerOps::DADDIU()
{
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (g_Settings->LoadBool(Game_32Bit))
{
@ -1979,7 +1979,7 @@ void CArmRecompilerOps::DADDIU()
void CArmRecompilerOps::LDL()
{
if (m_Opcode.base != 0) { UnMap_GPR(m_Opcode.base, true); }
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -1993,7 +1993,7 @@ void CArmRecompilerOps::LDL()
void CArmRecompilerOps::LDR()
{
if (m_Opcode.base != 0) { UnMap_GPR(m_Opcode.base, true); }
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2052,7 +2052,7 @@ void CArmRecompilerOps::LB()
void CArmRecompilerOps::LH()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2066,7 +2066,7 @@ void CArmRecompilerOps::LH()
void CArmRecompilerOps::LWL()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2098,7 +2098,7 @@ void CArmRecompilerOps::LW()
void CArmRecompilerOps::LBU()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2112,7 +2112,7 @@ void CArmRecompilerOps::LBU()
void CArmRecompilerOps::LHU()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2126,7 +2126,7 @@ void CArmRecompilerOps::LHU()
void CArmRecompilerOps::LWR()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2140,7 +2140,7 @@ void CArmRecompilerOps::LWR()
void CArmRecompilerOps::LWU()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2154,8 +2154,8 @@ void CArmRecompilerOps::LWU()
void CArmRecompilerOps::SB()
{
if (m_Opcode.base != 0) { UnMap_GPR(m_Opcode.base, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SB, "R4300iOp32::SB");
@ -2168,8 +2168,8 @@ void CArmRecompilerOps::SB()
void CArmRecompilerOps::SH()
{
if (m_Opcode.base != 0) { UnMap_GPR(m_Opcode.base, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SH, "R4300iOp32::SH");
@ -2182,8 +2182,8 @@ void CArmRecompilerOps::SH()
void CArmRecompilerOps::SWL()
{
if (m_Opcode.base != 0) { UnMap_GPR(m_Opcode.base, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SWL, "R4300iOp32::SWL");
@ -2214,8 +2214,8 @@ void CArmRecompilerOps::SW()
void CArmRecompilerOps::SWR()
{
if (m_Opcode.base != 0) { UnMap_GPR(m_Opcode.base, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SWR, "R4300iOp32::SWR");
@ -2228,8 +2228,8 @@ void CArmRecompilerOps::SWR()
void CArmRecompilerOps::SDL()
{
if (m_Opcode.base != 0) { UnMap_GPR(m_Opcode.base, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SDL, "R4300iOp32::SDL");
@ -2242,8 +2242,8 @@ void CArmRecompilerOps::SDL()
void CArmRecompilerOps::SDR()
{
if (m_Opcode.base != 0) { UnMap_GPR(m_Opcode.base, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SDR, "R4300iOp32::SDR");
@ -2260,8 +2260,7 @@ void CArmRecompilerOps::CACHE()
{
return;
}
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
switch (m_Opcode.rt)
{
@ -2297,7 +2296,7 @@ void CArmRecompilerOps::CACHE()
void CArmRecompilerOps::LL()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2360,7 +2359,7 @@ void CArmRecompilerOps::LWC1()
void CArmRecompilerOps::LDC1()
{
CompileCop1Test();
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::LDC1, "R4300iOp32::LDC1");
@ -2373,7 +2372,7 @@ void CArmRecompilerOps::LDC1()
void CArmRecompilerOps::LD()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
UnMap_GPR(m_Opcode.rt, true);
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2387,8 +2386,8 @@ void CArmRecompilerOps::LD()
void CArmRecompilerOps::SC()
{
UnMap_GPR(m_Opcode.base, true);
UnMap_GPR(m_Opcode.rt, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SC, "R4300iOp32::SC");
@ -2402,7 +2401,7 @@ void CArmRecompilerOps::SC()
void CArmRecompilerOps::SWC1()
{
CompileCop1Test();
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SWC1, "R4300iOp32::SWC1");
@ -2416,7 +2415,7 @@ void CArmRecompilerOps::SWC1()
void CArmRecompilerOps::SDC1()
{
CompileCop1Test();
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SDC1, "R4300iOp32::SDC1");
@ -2429,7 +2428,7 @@ void CArmRecompilerOps::SDC1()
void CArmRecompilerOps::SD()
{
UnMap_GPR(m_Opcode.base, true);
if (m_Opcode.base != 0) { WriteBack_GPR(m_Opcode.base, false); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (g_Settings->LoadBool(Game_32Bit))
{
@ -2448,7 +2447,7 @@ void CArmRecompilerOps::SPECIAL_SLL()
return;
}
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_SLL, "R4300iOp32::SPECIAL_SLL");
@ -2462,7 +2461,7 @@ void CArmRecompilerOps::SPECIAL_SLL()
void CArmRecompilerOps::SPECIAL_SRL()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_SRL, "R4300iOp32::SPECIAL_SRL");
@ -2476,7 +2475,7 @@ void CArmRecompilerOps::SPECIAL_SRL()
void CArmRecompilerOps::SPECIAL_SRA()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_SRA, "R4300iOp32::SPECIAL_SRA");
@ -2490,8 +2489,8 @@ void CArmRecompilerOps::SPECIAL_SRA()
void CArmRecompilerOps::SPECIAL_SLLV()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
UnMap_GPR(m_Opcode.rs, true);
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_SLLV, "R4300iOp32::SPECIAL_SLLV");
@ -2505,8 +2504,8 @@ void CArmRecompilerOps::SPECIAL_SLLV()
void CArmRecompilerOps::SPECIAL_SRLV()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
UnMap_GPR(m_Opcode.rs, true);
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_SRLV, "R4300iOp32::SPECIAL_SRLV");
@ -2520,8 +2519,8 @@ void CArmRecompilerOps::SPECIAL_SRLV()
void CArmRecompilerOps::SPECIAL_SRAV()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
UnMap_GPR(m_Opcode.rs, true);
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_SRAV, "R4300iOp32::SPECIAL_SRAV");
@ -2839,8 +2838,8 @@ void CArmRecompilerOps::SPECIAL_MULT()
void CArmRecompilerOps::SPECIAL_MULTU()
{
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_MULTU, "R4300iOp32::SPECIAL_MULTU");
@ -2853,8 +2852,8 @@ void CArmRecompilerOps::SPECIAL_MULTU()
void CArmRecompilerOps::SPECIAL_DIV()
{
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_DIV, "R4300iOp32::SPECIAL_DIV");
@ -2867,8 +2866,8 @@ void CArmRecompilerOps::SPECIAL_DIV()
void CArmRecompilerOps::SPECIAL_DIVU()
{
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_DIVU, "R4300iOp32::SPECIAL_DIVU");
@ -2895,8 +2894,8 @@ void CArmRecompilerOps::SPECIAL_DMULT()
void CArmRecompilerOps::SPECIAL_DMULTU()
{
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_DMULTU, "R4300iOp32::SPECIAL_DMULTU");
@ -2909,8 +2908,8 @@ void CArmRecompilerOps::SPECIAL_DMULTU()
void CArmRecompilerOps::SPECIAL_DDIV()
{
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_DDIV, "R4300iOp32::SPECIAL_DDIV");
@ -2923,8 +2922,8 @@ void CArmRecompilerOps::SPECIAL_DDIV()
void CArmRecompilerOps::SPECIAL_DDIVU()
{
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_DDIVU, "R4300iOp32::SPECIAL_DDIVU");
@ -2953,8 +2952,8 @@ void CArmRecompilerOps::SPECIAL_ADD()
void CArmRecompilerOps::SPECIAL_ADDU()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_ADDU, "R4300iOp32::SPECIAL_ADDU");
@ -2998,8 +2997,8 @@ void CArmRecompilerOps::SPECIAL_SUBU()
void CArmRecompilerOps::SPECIAL_AND()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_AND, "R4300iOp32::SPECIAL_AND");
@ -3013,8 +3012,8 @@ void CArmRecompilerOps::SPECIAL_AND()
void CArmRecompilerOps::SPECIAL_OR()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_OR, "R4300iOp32::SPECIAL_OR");
@ -3228,8 +3227,8 @@ void CArmRecompilerOps::SPECIAL_SLT()
void CArmRecompilerOps::SPECIAL_SLTU()
{
UnMap_GPR(m_Opcode.rd, true);
if (m_Opcode.rs != 0) { UnMap_GPR(m_Opcode.rs, true); }
if (m_Opcode.rt != 0) { UnMap_GPR(m_Opcode.rt, true); }
if (m_Opcode.rs != 0) { WriteBack_GPR(m_Opcode.rs, false); }
if (m_Opcode.rt != 0) { WriteBack_GPR(m_Opcode.rt, false); }
if (g_Settings->LoadBool(Game_32Bit))
{
CompileInterpterCall((void *)R4300iOp32::SPECIAL_SLTU, "R4300iOp32::SPECIAL_SLTU");

View File

@ -237,6 +237,7 @@ public:
static inline void Map_GPR_32bit(int32_t Reg, bool SignValue, int32_t MipsRegToLoad) { m_RegWorkingSet.Map_GPR_32bit(Reg, SignValue, MipsRegToLoad); }
static inline void Map_GPR_64bit(int32_t Reg, int32_t MipsRegToLoad) { m_RegWorkingSet.Map_GPR_64bit(Reg, MipsRegToLoad); }
static inline void UnMap_GPR(uint32_t Reg, bool WriteBackValue){ m_RegWorkingSet.UnMap_GPR(Reg, WriteBackValue); }
static inline void WriteBack_GPR(uint32_t Reg, bool Unmapping){ m_RegWorkingSet.WriteBack_GPR(Reg, Unmapping); }
static inline ArmReg Map_TempReg(ArmReg Reg, int32_t MipsReg, bool LoadHiWord) { return m_RegWorkingSet.Map_TempReg(Reg, MipsReg, LoadHiWord); }
static inline ArmReg Map_Variable(CArmRegInfo::VARIABLE_MAPPED variable) { return m_RegWorkingSet.Map_Variable(variable); }

View File

@ -409,6 +409,11 @@ void CArmRegInfo::UnMap_GPR(uint32_t MipsReg, bool WriteBackValue)
g_Notify->BreakPoint(__FILE__, __LINE__);
return;
}
if (WriteBackValue)
{
WriteBack_GPR(MipsReg,true);
}
if (MipsReg == 0)
{
if (bHaveDebugger())
@ -422,27 +427,6 @@ void CArmRegInfo::UnMap_GPR(uint32_t MipsReg, bool WriteBackValue)
//CPU_Message("UnMap_GPR: State: %X\tReg: %s\tWriteBack: %s",State,CRegName::GPR[Reg],WriteBackValue?"true":"false");
if (IsConst(MipsReg))
{
if (!WriteBackValue)
{
SetMipsRegState(MipsReg, STATE_UNKNOWN);
return;
}
if (Is64Bit(MipsReg))
{
MoveConstToVariable(GetMipsRegHi(MipsReg), &_GPR[MipsReg].UW[1], CRegName::GPR_Hi[MipsReg]);
MoveConstToVariable(GetMipsRegLo(MipsReg), &_GPR[MipsReg].UW[0], CRegName::GPR_Lo[MipsReg]);
SetMipsRegState(MipsReg, STATE_UNKNOWN);
return;
}
if ((GetMipsRegLo(MipsReg) & 0x80000000) != 0)
{
MoveConstToVariable(0xFFFFFFFF, &_GPR[MipsReg].UW[1], CRegName::GPR_Hi[MipsReg]);
}
else
{
MoveConstToVariable(0, &_GPR[MipsReg].UW[1], CRegName::GPR_Hi[MipsReg]);
}
MoveConstToVariable(GetMipsRegLo(MipsReg), &_GPR[MipsReg].UW[0], CRegName::GPR_Lo[MipsReg]);
SetMipsRegState(MipsReg, STATE_UNKNOWN);
return;
}
@ -455,36 +439,83 @@ void CArmRegInfo::UnMap_GPR(uint32_t MipsReg, bool WriteBackValue)
CPU_Message(" regcache: unallocate %s from %s", ArmRegName(GetMipsRegMapLo(MipsReg)), CRegName::GPR_Lo[MipsReg]);
SetArmRegMapped(GetMipsRegMapLo(MipsReg), NotMapped);
SetArmRegProtected(GetMipsRegMapLo(MipsReg), false);
if (!WriteBackValue)
{
SetMipsRegState(MipsReg, STATE_UNKNOWN);
}
void CArmRegInfo::WriteBack_GPR(uint32_t MipsReg, bool Unmapping)
{
if (m_InCallDirect)
{
CPU_Message("%s: in CallDirect",__FUNCTION__);
g_Notify->BreakPoint(__FILE__, __LINE__);
return;
}
if (MipsReg == 0)
{
if (bHaveDebugger())
{
g_Notify->DisplayError(stdstr_f("%s\n\nWhy are you trying to unmap reg 0", __FUNCTION__).c_str());
}
return;
}
if (IsUnknown(MipsReg))
{
return;
}
ArmReg GprReg = Map_Variable(VARIABLE_GPR);
StoreArmRegToArmRegPointer(GetMipsRegMapLo(MipsReg), GprReg, (uint8_t)(MipsReg << 3));
if (IsConst(MipsReg))
{
ArmReg TempReg = m_RegWorkingSet.Map_TempReg(Arm_Any, -1, false);
if (Is64Bit(MipsReg))
{
SetMipsRegMapLo(MipsReg, Arm_Unknown);
StoreArmRegToArmRegPointer(GetMipsRegMapHi(MipsReg), GprReg, (uint8_t)(MipsReg << 3) + 4);
SetMipsRegMapHi(MipsReg, Arm_Unknown);
MoveConstToArmReg(TempReg, GetMipsRegHi(MipsReg));
StoreArmRegToArmRegPointer(TempReg, GprReg, (uint8_t)(MipsReg << 3) + 4, CRegName::GPR_Hi[MipsReg]);
}
else if (!g_System->b32BitCore())
{
MoveConstToArmReg(TempReg, (GetMipsRegLo(MipsReg) & 0x80000000) != 0 ? 0xFFFFFFFF : 0);
StoreArmRegToArmRegPointer(TempReg, GprReg, (uint8_t)(MipsReg << 3) + 4, CRegName::GPR_Hi[MipsReg]);
}
MoveConstToArmReg(TempReg, GetMipsRegLo(MipsReg));
StoreArmRegToArmRegPointer(TempReg, GprReg, (uint8_t)(MipsReg << 3), CRegName::GPR_Lo[MipsReg]);
m_RegWorkingSet.SetArmRegProtected(TempReg, false);
}
else
{
if (!g_System->b32BitCore())
StoreArmRegToArmRegPointer(GetMipsRegMapLo(MipsReg), GprReg, (uint8_t)(MipsReg << 3), CRegName::GPR_Lo[MipsReg]);
if (Is64Bit(MipsReg))
{
StoreArmRegToArmRegPointer(GetMipsRegMapHi(MipsReg), GprReg, (uint8_t)(MipsReg << 3) + 4, CRegName::GPR_Hi[MipsReg]);
}
else if (!g_System->b32BitCore())
{
bool loProtected = GetArmRegProtected(GetMipsRegMapLo(MipsReg));
if (!Unmapping)
{
SetArmRegProtected(GetMipsRegMapLo(MipsReg), true);
ArmReg TempReg = m_RegWorkingSet.Map_TempReg(Arm_Any, -1, false);
if (IsSigned(MipsReg))
{
ShiftRightSignImmed(GetMipsRegMapLo(MipsReg), GetMipsRegMapLo(MipsReg), 31);
ShiftRightSignImmed(TempReg, GetMipsRegMapLo(MipsReg), 31);
}
else
{
MoveConstToArmReg(GetMipsRegMapLo(MipsReg),(uint32_t)0);
MoveConstToArmReg(TempReg, (uint32_t)0);
}
StoreArmRegToArmRegPointer(GetMipsRegMapLo(MipsReg), GprReg, (uint8_t)(MipsReg << 3) + 4);
StoreArmRegToArmRegPointer(TempReg, GprReg, (uint8_t)(MipsReg << 3) + 4, CRegName::GPR_Hi[MipsReg]);
m_RegWorkingSet.SetArmRegProtected(TempReg, false);
}
else
{
ShiftRightSignImmed(GetMipsRegMapLo(MipsReg), GetMipsRegMapLo(MipsReg), 31);
StoreArmRegToArmRegPointer(GetMipsRegMapLo(MipsReg), GprReg, (uint8_t)(MipsReg << 3) + 4, CRegName::GPR_Hi[MipsReg]);
}
m_RegWorkingSet.SetArmRegProtected(GetMipsRegMapLo(MipsReg), loProtected);
}
SetMipsRegMapLo(MipsReg, Arm_Unknown);
}
SetMipsRegState(MipsReg, STATE_UNKNOWN);
SetArmRegProtected(GprReg, false);
}

View File

@ -63,6 +63,7 @@ public:
void UnMap_AllFPRs();
ArmReg UnMap_TempReg();
void UnMap_GPR(uint32_t Reg, bool WriteBackValue);
void WriteBack_GPR(uint32_t MipsReg, bool Unmapping);
bool UnMap_ArmReg(ArmReg Reg);
void ResetRegProtection();