From a98bddc3521ce22768bdfe425883171c7e9f7f1e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 9 Dec 2015 12:50:50 -0500 Subject: [PATCH 1/3] Interpreter: Remove underscore from frsp's parameter --- .../Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index d797766126..2a415e634d 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -272,15 +272,14 @@ void Interpreter::fselx(UGeckoInstruction _inst) // !!! warning !!! // PS1 must be set to the value of PS0 or DragonballZ will be f**ked up // PS1 is said to be undefined -void Interpreter::frspx(UGeckoInstruction _inst) // round to single +void Interpreter::frspx(UGeckoInstruction inst) // round to single { - double b = rPS0(_inst.FB); + double b = rPS0(inst.FB); double rounded = ForceSingle(b); SetFI(b != rounded); FPSCR.FR = fabs(rounded) > fabs(b); UpdateFPRF(rounded); - rPS0(_inst.FD) = rPS1(_inst.FD) = rounded; - return; + rPS0(inst.FD) = rPS1(inst.FD) = rounded; } From 3acf1657872c7639ac811d5dcdd703ca4cfc7803 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 9 Dec 2015 12:51:53 -0500 Subject: [PATCH 2/3] Interpreter: Update CR when FRSP's record bit is set --- .../Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index 2a415e634d..d61d8e6231 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -280,6 +280,9 @@ void Interpreter::frspx(UGeckoInstruction inst) // round to single FPSCR.FR = fabs(rounded) > fabs(b); UpdateFPRF(rounded); rPS0(inst.FD) = rPS1(inst.FD) = rounded; + + if (inst.Rc) + Helper_UpdateCR1(); } From f7977fdee5eb0a288f1b40bcd50969b1ad54f657 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 9 Dec 2015 14:08:55 -0500 Subject: [PATCH 3/3] Jit: Fall back to interpreter when frsp's record bit is set --- Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp | 1 + Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp index 8295c8a230..aa3ca677ae 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp @@ -609,6 +609,7 @@ void Jit64::frspx(UGeckoInstruction inst) { INSTRUCTION_START JITDISABLE(bJITFloatingPointOff); + FALLBACK_IF(inst.Rc); int b = inst.FB; int d = inst.FD; bool packed = jit->js.op->fprIsDuplicated[b] && !cpu_info.bAtom; diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp index ec506964cc..df88501693 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp @@ -329,6 +329,7 @@ void JitArm64::frspx(UGeckoInstruction inst) { INSTRUCTION_START JITDISABLE(bJITFloatingPointOff); + FALLBACK_IF(inst.Rc); u32 b = inst.FB, d = inst.FD;