@samitouri / QOSamiQemu / commits / 128413ac6d

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>

Richard Henderson committed Jun 8, 2026 at 12:01 UTC 128413ac6de3fef08f7a9498a066cac562395ab5
1 file changed +4
fpu/softfloat-parts.c.inc
+4
@@ -1127,6 +1127,7 @@ static bool partsN(round_to_int_normal)(FloatPartsN *a, FloatRoundMode rmode,
1127 /* All fractional */
1128 switch (rmode) {
1129 case float_round_nearest_even:
1130 + case float_round_nearest_even_max:
1131 one = false;
1132 if (a->exp == -1) {
1133 FloatPartsN tmp;
@@ -1149,6 +1150,7 @@ static bool partsN(round_to_int_normal)(FloatPartsN *a, FloatRoundMode rmode,
1150 one = a->sign;
1151 break;
1152 case float_round_to_odd:
1153 + case float_round_to_odd_inf:
1154 one = true;
1155 break;
1156 default:
@@ -1195,6 +1197,7 @@ static bool partsN(round_to_int_normal)(FloatPartsN *a, FloatRoundMode rmode,
1197
1198 switch (rmode) {
1199 case float_round_nearest_even:
1200 + case float_round_nearest_even_max:
1201 inc = ((a->frac_lo & rnd_even_mask) != frac_lsbm1 ? frac_lsbm1 : 0);
1202 break;
1203 case float_round_ties_away:
@@ -1210,6 +1213,7 @@ static bool partsN(round_to_int_normal)(FloatPartsN *a, FloatRoundMode rmode,
1213 inc = a->sign ? rnd_mask : 0;
1214 break;
1215 case float_round_to_odd:
1216 + case float_round_to_odd_inf:
1217 inc = a->frac_lo & frac_lsb ? 0 : rnd_mask;
1218 break;
1219 default: