diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp index 7a3ad1bad1..6ae1224df6 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp @@ -71,9 +71,68 @@ namespace Jit64 MOV(32, R(ABI_PARAM1), gpr.R(b)); if (a) ADD(32, R(ABI_PARAM1), gpr.R(a)); - //SafeLoadRegToEAX(ABI_PARAM1, 8, 0); +#if 0 + SafeLoadRegToEAX(ABI_PARAM1, 8, 0); + MOV(32, gpr.R(d), R(EAX)); +#else UnsafeLoadRegToReg(ABI_PARAM1, gpr.RX(d), 8, 0, false); - //MOV(32, gpr.R(d), R(EAX)); +#endif + gpr.UnlockAll(); + gpr.UnlockAllX(); + } + + void lwzx(UGeckoInstruction inst) + { +#ifdef JIT_OFF_OPTIONS + if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) + {Default(inst); return;} // turn off from debugger +#endif + INSTRUCTION_START; + + int a = inst.RA, b = inst.RB, d = inst.RD; + gpr.Lock(a, b, d); + gpr.FlushLockX(ABI_PARAM1); + if (b == d || a == d) + gpr.LoadToX64(d, true, true); + else + gpr.LoadToX64(d, false, true); + MOV(32, R(ABI_PARAM1), gpr.R(b)); + if (a) + ADD(32, R(ABI_PARAM1), gpr.R(a)); +#if 1 + SafeLoadRegToEAX(ABI_PARAM1, 32, 0); + MOV(32, gpr.R(d), R(EAX)); +#else + UnsafeLoadRegToReg(ABI_PARAM1, gpr.RX(d), 32, 0, false); +#endif + gpr.UnlockAll(); + gpr.UnlockAllX(); + } + + void lhax(UGeckoInstruction inst) + { +#ifdef JIT_OFF_OPTIONS + if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) + {Default(inst); return;} // turn off from debugger +#endif + INSTRUCTION_START; + + int a = inst.RA, b = inst.RB, d = inst.RD; + gpr.Lock(a, b, d); + gpr.FlushLockX(ABI_PARAM1); + if (b == d || a == d) + gpr.LoadToX64(d, true, true); + else + gpr.LoadToX64(d, false, true); + MOV(32, R(ABI_PARAM1), gpr.R(b)); + if (a) + ADD(32, R(ABI_PARAM1), gpr.R(a)); +#if 1 + SafeLoadRegToEAX(ABI_PARAM1, 16, 0, true); + MOV(32, gpr.R(d), R(EAX)); +#else + UnsafeLoadRegToReg(ABI_PARAM1, gpr.RX(d), 16, 0, true); +#endif gpr.UnlockAll(); gpr.UnlockAllX(); } diff --git a/Source/Core/Core/Src/PowerPC/PPCTables.cpp b/Source/Core/Core/Src/PowerPC/PPCTables.cpp index 4f4a67f38d..a8e3bf8c0a 100644 --- a/Source/Core/Core/Src/PowerPC/PPCTables.cpp +++ b/Source/Core/Core/Src/PowerPC/PPCTables.cpp @@ -288,7 +288,7 @@ GekkoOPTemplate table31[] = {922, Interpreter::extshx, Jit64::extshx, {"extshx", OPTYPE_INTEGER, FL_IN_A | FL_OUT_S | FL_RC_BIT}}, {954, Interpreter::extsbx, Jit64::extsbx, {"extsbx", OPTYPE_INTEGER, FL_IN_A | FL_OUT_S | FL_RC_BIT}}, {536, Interpreter::srwx, Jit64::srwx, {"srwx", OPTYPE_INTEGER, FL_RC_BIT}}, - {792, Interpreter::srawx, Jit64::srawx, {"srawx", OPTYPE_INTEGER, FL_RC_BIT}}, + {792, Interpreter::srawx, Jit64::srawx, {"srawx", OPTYPE_INTEGER, FL_RC_BIT}}, {824, Interpreter::srawix, Jit64::srawix, {"srawix", OPTYPE_INTEGER, FL_RC_BIT}}, {24, Interpreter::slwx, Jit64::slwx, {"slwx", OPTYPE_INTEGER, FL_RC_BIT}}, @@ -301,7 +301,7 @@ GekkoOPTemplate table31[] = {1014, Interpreter::dcbz, Jit64::dcbz, {"dcbz", OPTYPE_DCACHE, 0, 4}}, //load word - {23, Interpreter::lwzx, Jit64::Default, {"lwzx", OPTYPE_LOAD, FL_OUT_D | FL_IN_A0 | FL_IN_B}}, + {23, Interpreter::lwzx, Jit64::lwzx, {"lwzx", OPTYPE_LOAD, FL_OUT_D | FL_IN_A0 | FL_IN_B}}, {55, Interpreter::lwzux, Jit64::Default, {"lwzux", OPTYPE_LOAD, FL_OUT_D | FL_IN_A | FL_IN_B}}, //load halfword @@ -309,7 +309,7 @@ GekkoOPTemplate table31[] = {311, Interpreter::lhzux, Jit64::Default, {"lhzux", OPTYPE_LOAD, FL_OUT_D | FL_IN_A | FL_IN_B}}, //load halfword signextend - {343, Interpreter::lhax, Jit64::Default, {"lhax", OPTYPE_LOAD, FL_OUT_D | FL_IN_A0 | FL_IN_B}}, + {343, Interpreter::lhax, Jit64::lhax, {"lhax", OPTYPE_LOAD, FL_OUT_D | FL_IN_A0 | FL_IN_B}}, {375, Interpreter::lhaux, Jit64::Default, {"lhaux", OPTYPE_LOAD, FL_OUT_D | FL_IN_A | FL_IN_B}}, //load byte