From d78fe3b4d4de35dc0dd34ac8911969f36f51ea6f Mon Sep 17 00:00:00 2001 From: Andrew Church Date: Sun, 18 Jan 2015 07:03:02 +0900 Subject: [PATCH] Fix detection of denormals in frsp. --- rpcs3/Emu/Cell/PPUInterpreter.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index 31bddf28e0..d5be7293b9 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -3795,7 +3795,10 @@ private: const double r = static_cast(b0); CPU.FPSCR.FR = fabs(r) > fabs(b); CPU.SetFPSCR_FI(b != r); - CPU.FPSCR.FPRF = PPCdouble(r).GetType(); + u32 type = PPCdouble(r).GetType(); + if (type == FPR_PN && r < ldexp(1.0, -126)) type = FPR_PD; + else if (type == FPR_NN && r > ldexp(-1.0, -126)) type = FPR_ND; + CPU.FPSCR.FPRF = type; CPU.FPR[frd] = r; } void FCTIW(u32 frd, u32 frb, bool rc)