Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
fpu/softfloat.c | 22 +++++++---------------
fpu/softfloat-parts.c.inc | 10 +++++-----
2 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 0a6bc6d580..1f03fcf687 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -779,14 +779,6 @@ static float128 QEMU_FLATTEN float128_pack_raw(const FloatParts128 *p)
FloatParts128 *: parts128_##NAME, \
FloatParts256 *: parts256_##NAME)
-static bool parts64_round_to_int_normal(FloatParts64 *a, FloatRoundMode rm,
- int scale, int frac_size);
-static bool parts128_round_to_int_normal(FloatParts128 *a, FloatRoundMode r,
- int scale, int frac_size);
-
-#define parts_round_to_int_normal(A, R, C, F) \
- PARTS_GENERIC_64_128(round_to_int_normal, A)(A, R, C, F)
-
static void parts64_round_to_int(FloatParts64 *a, FloatRoundMode rm,
int scale, float_status *s,
const FloatFmt *fmt);
@@ -3365,7 +3357,7 @@ static Int128 float128_to_int128_scalbn(float128 a, FloatRoundMode rmode,
case float_class_normal:
case float_class_denormal:
- if (parts_round_to_int_normal(&p, rmode, scale, 128 - 2)) {
+ if (parts128_round_to_int_normal(&p, rmode, scale, 128 - 2)) {
flags = float_flag_inexact;
}
@@ -3793,7 +3785,7 @@ static Int128 float128_to_uint128_scalbn(float128 a, FloatRoundMode rmode,
case float_class_normal:
case float_class_denormal:
- if (parts_round_to_int_normal(&p, rmode, scale, 128 - 2)) {
+ if (parts128_round_to_int_normal(&p, rmode, scale, 128 - 2)) {
flags = float_flag_inexact;
if (p.cls == float_class_zero) {
r = int128_zero();
@@ -5482,11 +5474,11 @@ static void parts_s390_divide_to_integer(FloatParts64 *a, FloatParts64 *b,
* of distinguishing partial quotients, so ignore the exception.
*/
*n = *q;
- parts_round_to_int_normal(n,
- is_q_smallish ?
- final_quotient_rounding_mode :
- float_round_to_zero,
- 0, fmt->frac_size);
+ parts64_round_to_int_normal(n,
+ is_q_smallish
+ ? final_quotient_rounding_mode
+ : float_round_to_zero,
+ 0, fmt->frac_size);
/* Compute precise remainder */
r_precise_buf = *b;
diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc
index 6e1800b117..9b719ac5cf 100644
--- a/fpu/softfloat-parts.c.inc
+++ b/fpu/softfloat-parts.c.inc
@@ -1127,7 +1127,7 @@ static void partsN(sqrt)(FloatPartsN *a, float_status *status,
* according to the IEC/IEEE Standard for Binary Floating-Point
* Arithmetic.
*
- * parts_round_to_int_normal is an internal helper function for
+ * partsN(round_to_int_normal) is an internal helper function for
* normal numbers only, returning true for inexact but not directly
* raising float_flag_inexact.
*/
@@ -1270,7 +1270,7 @@ static void partsN(round_to_int)(FloatPartsN *a, FloatRoundMode rmode,
break;
case float_class_normal:
case float_class_denormal:
- if (parts_round_to_int_normal(a, rmode, scale, fmt->frac_size)) {
+ if (partsN(round_to_int_normal)(a, rmode, scale, fmt->frac_size)) {
float_raise(float_flag_inexact, s);
}
break;
@@ -1316,7 +1316,7 @@ static int64_t partsN(float_to_sint)(FloatPartsN *p, FloatRoundMode rmode,
case float_class_normal:
case float_class_denormal:
/* TODO: N - 2 is frac_size for rounding; could use input fmt. */
- if (parts_round_to_int_normal(p, rmode, scale, N - 2)) {
+ if (partsN(round_to_int_normal)(p, rmode, scale, N - 2)) {
flags = float_flag_inexact;
}
@@ -1384,7 +1384,7 @@ static uint64_t partsN(float_to_uint)(FloatPartsN *p, FloatRoundMode rmode,
case float_class_normal:
case float_class_denormal:
/* TODO: N - 2 is frac_size for rounding; could use input fmt. */
- if (parts_round_to_int_normal(p, rmode, scale, N - 2)) {
+ if (partsN(round_to_int_normal)(p, rmode, scale, N - 2)) {
flags = float_flag_inexact;
if (p->cls == float_class_zero) {
r = 0;
@@ -1448,7 +1448,7 @@ static int64_t partsN(float_to_sint_modulo)(FloatPartsN *p,
case float_class_normal:
case float_class_denormal:
/* TODO: N - 2 is frac_size for rounding; could use input fmt. */
- if (parts_round_to_int_normal(p, rmode, 0, N - 2)) {
+ if (partsN(round_to_int_normal)(p, rmode, 0, N - 2)) {
flags = float_flag_inexact;
}
--
2.43.0