diff --git a/src/common/fp/op/FPRSqrtEstimate.cpp b/src/common/fp/op/FPRSqrtEstimate.cpp index 895fa418..969ade1c 100644 --- a/src/common/fp/op/FPRSqrtEstimate.cpp +++ b/src/common/fp/op/FPRSqrtEstimate.cpp @@ -19,7 +19,7 @@ namespace Dynarmic::FP { template FPT FPRSqrtEstimate(FPT op, FPCR fpcr, FPSR& fpsr) { - auto [type, sign, value] = FPUnpack(op, fpcr, fpsr); + const auto [type, sign, value] = FPUnpack(op, fpcr, fpsr); if (type == FPType::SNaN || type == FPType::QNaN) { return FPProcessNaN(type, op, fpcr, fpsr); @@ -27,16 +27,16 @@ FPT FPRSqrtEstimate(FPT op, FPCR fpcr, FPSR& fpsr) { if (type == FPType::Zero) { FPProcessException(FPExc::DivideByZero, fpcr, fpsr); - return FPInfo::Infinity(sign); + return FPT(FPInfo::Infinity(sign)); } if (sign) { FPProcessException(FPExc::InvalidOp, fpcr, fpsr); - return FPInfo::DefaultNaN(); + return FPT(FPInfo::DefaultNaN()); } if (type == FPType::Infinity) { - return FPInfo::Zero(false); + return FPT(FPInfo::Zero(false)); } const int result_exponent = (-(value.exponent + 1)) >> 1; @@ -50,6 +50,7 @@ FPT FPRSqrtEstimate(FPT op, FPCR fpcr, FPSR& fpsr) { return (bits_exponent << FPInfo::explicit_mantissa_width) | (bits_mantissa & FPInfo::mantissa_mask); } +template u16 FPRSqrtEstimate(u16 op, FPCR fpcr, FPSR& fpsr); template u32 FPRSqrtEstimate(u32 op, FPCR fpcr, FPSR& fpsr); template u64 FPRSqrtEstimate(u64 op, FPCR fpcr, FPSR& fpsr);