diff --git a/src/common/fp/op/FPRoundInt.cpp b/src/common/fp/op/FPRoundInt.cpp index c0a17f1f..5ecb34be 100644 --- a/src/common/fp/op/FPRoundInt.cpp +++ b/src/common/fp/op/FPRoundInt.cpp @@ -72,11 +72,12 @@ u64 FPRoundInt(FPT op, FPCR fpcr, RoundingMode rounding, bool exact, FPSR& fpsr) int_result++; } - const u64 abs_int_result = Common::MostSignificantBit(int_result) ? Safe::Negate(int_result) : static_cast(int_result); + const bool new_sign = Common::MostSignificantBit(int_result); + const u64 abs_int_result = new_sign ? Safe::Negate(int_result) : static_cast(int_result); const FPT result = int_result == 0 ? FPInfo::Zero(sign) - : FPRound(FPUnpacked{sign, 0, abs_int_result}, fpcr, RoundingMode::TowardsZero, fpsr); + : FPRound(FPUnpacked{new_sign, 0, abs_int_result}, fpcr, RoundingMode::TowardsZero, fpsr); if (error != ResidualError::Zero && exact) { FPProcessException(FPExc::Inexact, fpcr, fpsr);