From 2231e8d6c0533cee0e85aaa90c695f117f6180d7 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 18 Jan 2024 16:53:14 +1030 Subject: [PATCH] Core: Remove usage of fpclassify from R4300iOp::CheckFPUResult64 --- .../Project64-core/N64System/Interpreter/InterpreterOps.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp b/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp index 95e98e7fa..d68f110e0 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp +++ b/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp @@ -3506,8 +3506,7 @@ bool R4300iOp::CheckFPUResult64(double & Result) { int Except = fetestexcept(FE_ALL_EXCEPT); bool DoException = false; - int fptype = fpclassify(Result); - if (fptype == FP_NAN) + if ((*((uint64_t *)&Result) & 0x7FF0000000000000ULL) == 0x7FF0000000000000ULL && (*((uint64_t *)&Result) & 0x000FFFFFFFFFFFFFULL) != 0x0000000000000000ULL) // NaN { if (Except == 0 || !SetFPUException()) { @@ -3518,7 +3517,7 @@ bool R4300iOp::CheckFPUResult64(double & Result) DoException = true; } } - else if (fptype == FP_SUBNORMAL) + else if ((*((uint64_t *)&Result) & 0x7FF0000000000000ULL) == 0x0000000000000000ULL && (*((uint64_t *)&Result) & 0x000FFFFFFFFFFFFFULL) != 0x0000000000000000ULL) { FPStatusReg & StatusReg = (FPStatusReg &)m_FPCR[31]; if (!StatusReg.FlushSubnormals || StatusReg.Enable.Underflow || StatusReg.Enable.Inexact)