diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.h b/Source/Core/Core/PowerPC/Jit64/Jit.h index 23fe386ef0..5a515f1f81 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.h +++ b/Source/Core/Core/PowerPC/Jit64/Jit.h @@ -188,6 +188,7 @@ public: void fcmpx(UGeckoInstruction inst); void fctiwx(UGeckoInstruction inst); void fmrx(UGeckoInstruction inst); + void frspx(UGeckoInstruction inst); void cmpXX(UGeckoInstruction inst); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp index 03a59a0011..5bf4493777 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp @@ -342,7 +342,7 @@ static GekkoOPTemplate table63[] = {72, &Jit64::fmrx}, //"fmrx", OPTYPE_FPU, FL_RC_BIT_F}}, {136, &Jit64::fsign}, //"fnabsx", OPTYPE_FPU, FL_RC_BIT_F}}, {40, &Jit64::fsign}, //"fnegx", OPTYPE_FPU, FL_RC_BIT_F}}, - {12, &Jit64::FallBackToInterpreter}, //"frspx", OPTYPE_FPU, FL_RC_BIT_F}}, + {12, &Jit64::frspx}, //"frspx", OPTYPE_FPU, FL_RC_BIT_F}}, {64, &Jit64::FallBackToInterpreter}, //"mcrfs", OPTYPE_SYSTEMFP, 0}}, {583, &Jit64::FallBackToInterpreter}, //"mffsx", OPTYPE_SYSTEMFP, 0}}, diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp index 52ca8791f9..206f55f3d6 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp @@ -349,3 +349,20 @@ void Jit64::fctiwx(UGeckoInstruction inst) MOVSD(fpr.R(d), XMM0); fpr.UnlockAll(); } + +void Jit64::frspx(UGeckoInstruction inst) +{ + INSTRUCTION_START + JITDISABLE(bJITFloatingPointOff); + int b = inst.FB; + int d = inst.FD; + + fpr.Lock(b, d); + fpr.BindToRegister(d, d == b); + if (b != d) + MOVAPD(fpr.RX(d), fpr.R(b)); + ForceSinglePrecisionS(fpr.RX(d)); + MOVDDUP(fpr.RX(d), fpr.R(d)); + SetFPRFIfNeeded(inst, fpr.RX(d)); + fpr.UnlockAll(); +}