[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/17] softfloat: Add float_round_nearest_even_max
From: |
Richard Henderson |
Subject: |
[PATCH 05/17] softfloat: Add float_round_nearest_even_max |
Date: |
Sun, 8 Dec 2024 16:48:32 -0600 |
This rounding mode is used by Hexagon.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/fpu/softfloat-types.h | 2 ++
fpu/softfloat-parts.c.inc | 3 +++
2 files changed, 5 insertions(+)
diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h
index 8f39691dfd..c6429665ce 100644
--- a/include/fpu/softfloat-types.h
+++ b/include/fpu/softfloat-types.h
@@ -138,6 +138,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;
/*
diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc
index 5b5969725b..2b6adeef4c 100644
--- a/fpu/softfloat-parts.c.inc
+++ b/fpu/softfloat-parts.c.inc
@@ -155,6 +155,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
--
2.43.0
- [PATCH 01/17] softfloat: Add float{16,32,64}_muladd_scalbn, (continued)
- [PATCH 01/17] softfloat: Add float{16,32,64}_muladd_scalbn, Richard Henderson, 2024/12/08
- [PATCH 02/17] target/arm: Use float*_muladd_scalbn, Richard Henderson, 2024/12/08
- [PATCH 03/17] target/sparc: Use float*_muladd_scalbn, Richard Henderson, 2024/12/08
- [PATCH 04/17] softfloat: Remove float_muladd_halve_result, Richard Henderson, 2024/12/08
- [PATCH 07/17] target/hexagon: Use float32_mul in helper_sfmpy, Richard Henderson, 2024/12/08
- [PATCH 05/17] softfloat: Add float_round_nearest_even_max,
Richard Henderson <=
- [PATCH 06/17] softfloat: Add float_muladd_suppress_add_product_zero, Richard Henderson, 2024/12/08
- [PATCH 08/17] target/hexagon: Use float32_muladd for helper_sffma, Richard Henderson, 2024/12/08
- [PATCH 09/17] target/hexagon: Use float32_muladd for helper_sffms, Richard Henderson, 2024/12/08
- [PATCH 10/17] target/hexagon: Use float32_muladd_scalbn for helper_sffma_sc, Richard Henderson, 2024/12/08
- [PATCH 11/17] target/hexagon: Use float32_muladd for helper_sffm[as]_lib, Richard Henderson, 2024/12/08
- [PATCH 12/17] target/hexagon: Remove internal_fmafx, Richard Henderson, 2024/12/08