From c359d65dfe30a7046e7216489a73fa2d5a65c2a1 Mon Sep 17 00:00:00 2001 From: Fiora Date: Tue, 26 Aug 2014 00:07:49 -0700 Subject: [PATCH] JIT64: add frspx implementation --- Source/Core/Core/PowerPC/Jit64/Jit.h | 1 + Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp | 2 +- .../Core/PowerPC/Jit64/Jit_FloatingPoint.cpp | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.h b/Source/Core/Core/PowerPC/Jit64/Jit.h index 8962a66761..ec5eaaf336 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 c64cbdca66..69aa205da9 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 18bb8e94db..3642001ff8 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp @@ -343,3 +343,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(); +}