From: Richard Henderson Date: Sun, 8 Dec 2024 14:54:41 +0000 (-0600) Subject: softfloat: Add float_round_nearest_even_max X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=72330260cdb42015ae72096bae37e6fdaf361737;p=qemu.git softfloat: Add float_round_nearest_even_max This rounding mode is used by Hexagon. Signed-off-by: Richard Henderson --- diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index a724f317c5..37d046cfe9 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -241,6 +241,9 @@ static void partsN(uncanon_normal)(FloatPartsN *p, float_status *s, int exp, flags = 0; switch (s->float_rounding_mode) { + case float_round_nearest_even_max: + overflow_norm = true; + /* fall through */ case float_round_nearest_even: if (N > 64 && frac_lsb == 0) { inc = ((p->frac_hi & 1) || (p->frac_lo & round_mask) != frac_lsbm1 diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index 79ca44dcc3..9d37cdfaa8 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -140,6 +140,8 @@ typedef enum __attribute__((__packed__)) { float_round_to_odd = 5, /* Not an IEEE rounding mode: round to closest odd, overflow to inf */ float_round_to_odd_inf = 6, + /* Not an IEEE rounding mode: round to nearest even, overflow to max */ + float_round_nearest_even_max = 7, } FloatRoundMode; /*