From 7c244766dc27d05d07e6a7c9d80c05a4de12f3c8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 20 Feb 2015 19:57:14 -0500 Subject: [PATCH] Interpreter: Use correct destination for psq_l, psq_lx, psq_lu, and psq_lux. Gekko manual defines these as storing to rD, not rS. Also removed FL_OUT_FLOAT_S, since nothing uses it now. --- .../Interpreter_LoadStorePaired.cpp | 32 +++++++++---------- .../Interpreter/Interpreter_Tables.cpp | 8 ++--- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 3 +- Source/Core/Core/PowerPC/PPCTables.h | 1 - 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp index 1382fb31b4..2a0975a411 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp @@ -155,8 +155,8 @@ void Interpreter::psq_l(UGeckoInstruction _inst) { return; } - rPS0(_inst.RS) = ps0; - rPS1(_inst.RS) = ps1; + rPS0(_inst.RD) = ps0; + rPS1(_inst.RD) = ps1; } else { @@ -165,8 +165,8 @@ void Interpreter::psq_l(UGeckoInstruction _inst) { return; } - rPS0(_inst.RS) = ps0; - rPS1(_inst.RS) = 1.0f; + rPS0(_inst.RD) = ps0; + rPS1(_inst.RD) = 1.0f; } } @@ -191,8 +191,8 @@ void Interpreter::psq_lu(UGeckoInstruction _inst) { return; } - rPS0(_inst.RS) = ps0; - rPS1(_inst.RS) = ps1; + rPS0(_inst.RD) = ps0; + rPS1(_inst.RD) = ps1; } else { @@ -201,8 +201,8 @@ void Interpreter::psq_lu(UGeckoInstruction _inst) { return; } - rPS0(_inst.RS) = ps0; - rPS1(_inst.RS) = 1.0f; + rPS0(_inst.RD) = ps0; + rPS1(_inst.RD) = 1.0f; } rGPR[_inst.RA] = EA; } @@ -284,8 +284,8 @@ void Interpreter::psq_lx(UGeckoInstruction _inst) return; } - rPS0(_inst.RS) = ps0; - rPS1(_inst.RS) = ps1; + rPS0(_inst.RD) = ps0; + rPS1(_inst.RD) = ps1; } else { @@ -297,8 +297,8 @@ void Interpreter::psq_lx(UGeckoInstruction _inst) return; } - rPS0(_inst.RS) = ps0; - rPS1(_inst.RS) = ps1; + rPS0(_inst.RD) = ps0; + rPS1(_inst.RD) = ps1; } } @@ -347,8 +347,8 @@ void Interpreter::psq_lux(UGeckoInstruction _inst) { return; } - rPS0(_inst.RS) = ps0; - rPS1(_inst.RS) = ps1; + rPS0(_inst.RD) = ps0; + rPS1(_inst.RD) = ps1; } else { @@ -357,8 +357,8 @@ void Interpreter::psq_lux(UGeckoInstruction _inst) { return; } - rPS0(_inst.RS) = ps0; - rPS1(_inst.RS) = 1.0f; + rPS0(_inst.RD) = ps0; + rPS1(_inst.RD) = 1.0f; } rGPR[_inst.RA] = EA; } diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp index f02fc8e765..eadc5d36de 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp @@ -81,8 +81,8 @@ static GekkoOPTemplate primarytable[] = {54, Interpreter::stfd, {"stfd", OPTYPE_STOREFP, FL_IN_FLOAT_S | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, {55, Interpreter::stfdu, {"stfdu", OPTYPE_STOREFP, FL_IN_FLOAT_S | FL_OUT_A | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, - {56, Interpreter::psq_l, {"psq_l", OPTYPE_LOADPS, FL_OUT_FLOAT_S | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, - {57, Interpreter::psq_lu, {"psq_lu", OPTYPE_LOADPS, FL_OUT_FLOAT_S | FL_OUT_A | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, + {56, Interpreter::psq_l, {"psq_l", OPTYPE_LOADPS, FL_OUT_FLOAT_D | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, + {57, Interpreter::psq_lu, {"psq_lu", OPTYPE_LOADPS, FL_OUT_FLOAT_D | FL_OUT_A | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, {60, Interpreter::psq_st, {"psq_st", OPTYPE_STOREPS, FL_IN_FLOAT_S | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, {61, Interpreter::psq_stu, {"psq_stu", OPTYPE_STOREPS, FL_IN_FLOAT_S | FL_OUT_A | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, @@ -131,9 +131,9 @@ static GekkoOPTemplate table4_2[] = static GekkoOPTemplate table4_3[] = { - {6, Interpreter::psq_lx, {"psq_lx", OPTYPE_LOADPS, FL_OUT_FLOAT_S | FL_IN_A0B | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, + {6, Interpreter::psq_lx, {"psq_lx", OPTYPE_LOADPS, FL_OUT_FLOAT_D | FL_IN_A0B | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, {7, Interpreter::psq_stx, {"psq_stx", OPTYPE_STOREPS, FL_IN_FLOAT_S | FL_IN_A0B | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, - {38, Interpreter::psq_lux, {"psq_lux", OPTYPE_LOADPS, FL_OUT_FLOAT_S | FL_OUT_A | FL_IN_AB | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, + {38, Interpreter::psq_lux, {"psq_lux", OPTYPE_LOADPS, FL_OUT_FLOAT_D | FL_OUT_A | FL_IN_AB | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, {39, Interpreter::psq_stux, {"psq_stux", OPTYPE_STOREPS, FL_IN_FLOAT_S | FL_OUT_A | FL_IN_AB | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, }; diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 32105f468a..3ff2001353 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -589,8 +589,7 @@ void PPCAnalyzer::SetInstructionStats(CodeBlock *block, CodeOp *code, GekkoOPInf code->fregOut = -1; if (opinfo->flags & FL_OUT_FLOAT_D) code->fregOut = code->inst.FD; - else if (opinfo->flags & FL_OUT_FLOAT_S) - code->fregOut = code->inst.FS; + code->fregsIn = BitSet32(0); if (opinfo->flags & FL_IN_FLOAT_A) code->fregsIn[code->inst.FA] = true; diff --git a/Source/Core/Core/PowerPC/PPCTables.h b/Source/Core/Core/PowerPC/PPCTables.h index a28bc4b684..8cd6b86c65 100644 --- a/Source/Core/Core/PowerPC/PPCTables.h +++ b/Source/Core/Core/PowerPC/PPCTables.h @@ -51,7 +51,6 @@ enum FL_IN_FLOAT_AC = FL_IN_FLOAT_A | FL_IN_FLOAT_C, FL_IN_FLOAT_ABC = FL_IN_FLOAT_A | FL_IN_FLOAT_B | FL_IN_FLOAT_C, FL_OUT_FLOAT_D = (1<<28), // frD is used as a destination. - FL_OUT_FLOAT_S = (1<<29), // frS is used as a destination. // Used in the case of double ops (they don't modify the top half of the output) FL_INOUT_FLOAT_D = FL_IN_FLOAT_D | FL_OUT_FLOAT_D, };