fpu: Handle all rounding modes in partsN_round_to_int_normal

Missed float_round_nearest_even_max and float_round_to_odd_inf
in both switch statements.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-id: 20260608190155.637067-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson
2026-06-08 12:01:55 -07:00
committed by Peter Maydell
parent a6a1f92d5a
commit 128413ac6d

View File

@@ -1127,6 +1127,7 @@ static bool partsN(round_to_int_normal)(FloatPartsN *a, FloatRoundMode rmode,
/* All fractional */ /* All fractional */
switch (rmode) { switch (rmode) {
case float_round_nearest_even: case float_round_nearest_even:
case float_round_nearest_even_max:
one = false; one = false;
if (a->exp == -1) { if (a->exp == -1) {
FloatPartsN tmp; FloatPartsN tmp;
@@ -1149,6 +1150,7 @@ static bool partsN(round_to_int_normal)(FloatPartsN *a, FloatRoundMode rmode,
one = a->sign; one = a->sign;
break; break;
case float_round_to_odd: case float_round_to_odd:
case float_round_to_odd_inf:
one = true; one = true;
break; break;
default: default:
@@ -1195,6 +1197,7 @@ static bool partsN(round_to_int_normal)(FloatPartsN *a, FloatRoundMode rmode,
switch (rmode) { switch (rmode) {
case float_round_nearest_even: case float_round_nearest_even:
case float_round_nearest_even_max:
inc = ((a->frac_lo & rnd_even_mask) != frac_lsbm1 ? frac_lsbm1 : 0); inc = ((a->frac_lo & rnd_even_mask) != frac_lsbm1 ? frac_lsbm1 : 0);
break; break;
case float_round_ties_away: case float_round_ties_away:
@@ -1210,6 +1213,7 @@ static bool partsN(round_to_int_normal)(FloatPartsN *a, FloatRoundMode rmode,
inc = a->sign ? rnd_mask : 0; inc = a->sign ? rnd_mask : 0;
break; break;
case float_round_to_odd: case float_round_to_odd:
case float_round_to_odd_inf:
inc = a->frac_lo & frac_lsb ? 0 : rnd_mask; inc = a->frac_lo & frac_lsb ? 0 : rnd_mask;
break; break;
default: default: