[PATCH 18/84] fpu: Drop parts_round_to_int

Richard Henderson posted 84 patches 2 months, 2 weeks ago
Maintainers: Aurelien Jarno <aurelien@aurel32.net>, Peter Maydell <peter.maydell@linaro.org>, "Alex Bennée" <alex.bennee@linaro.org>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>
There is a newer version of this series
[PATCH 18/84] fpu: Drop parts_round_to_int
Posted by Richard Henderson 2 months, 2 weeks ago
Use parts{64,128}_round_to_int at each call site.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 fpu/softfloat.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 1f03fcf687..e2341871bd 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -779,16 +779,6 @@ static float128 QEMU_FLATTEN float128_pack_raw(const FloatParts128 *p)
                   FloatParts128 *: parts128_##NAME, \
                   FloatParts256 *: parts256_##NAME)
 
-static void parts64_round_to_int(FloatParts64 *a, FloatRoundMode rm,
-                                 int scale, float_status *s,
-                                 const FloatFmt *fmt);
-static void parts128_round_to_int(FloatParts128 *a, FloatRoundMode r,
-                                  int scale, float_status *s,
-                                  const FloatFmt *fmt);
-
-#define parts_round_to_int(A, R, C, S, F) \
-    PARTS_GENERIC_64_128(round_to_int, A)(A, R, C, S, F)
-
 static int64_t parts64_float_to_sint(FloatParts64 *p, FloatRoundMode rmode,
                                      int scale, int64_t min, int64_t max,
                                      float_status *s);
@@ -3128,7 +3118,7 @@ float16 float16_round_to_int(float16 a, float_status *s)
     FloatParts64 p;
 
     float16_unpack_canonical(&p, a, s);
-    parts_round_to_int(&p, s->float_rounding_mode, 0, s, &float16_params);
+    parts64_round_to_int(&p, s->float_rounding_mode, 0, s, &float16_params);
     return float16_round_pack_canonical(&p, s);
 }
 
@@ -3137,7 +3127,7 @@ float32 float32_round_to_int(float32 a, float_status *s)
     FloatParts64 p;
 
     float32_unpack_canonical(&p, a, s);
-    parts_round_to_int(&p, s->float_rounding_mode, 0, s, &float32_params);
+    parts64_round_to_int(&p, s->float_rounding_mode, 0, s, &float32_params);
     return float32_round_pack_canonical(&p, s);
 }
 
@@ -3146,7 +3136,7 @@ float64 float64_round_to_int(float64 a, float_status *s)
     FloatParts64 p;
 
     float64_unpack_canonical(&p, a, s);
-    parts_round_to_int(&p, s->float_rounding_mode, 0, s, &float64_params);
+    parts64_round_to_int(&p, s->float_rounding_mode, 0, s, &float64_params);
     return float64_round_pack_canonical(&p, s);
 }
 
@@ -3155,7 +3145,7 @@ bfloat16 bfloat16_round_to_int(bfloat16 a, float_status *s)
     FloatParts64 p;
 
     bfloat16_unpack_canonical(&p, a, s);
-    parts_round_to_int(&p, s->float_rounding_mode, 0, s, &bfloat16_params);
+    parts64_round_to_int(&p, s->float_rounding_mode, 0, s, &bfloat16_params);
     return bfloat16_round_pack_canonical(&p, s);
 }
 
@@ -3164,7 +3154,7 @@ float128 float128_round_to_int(float128 a, float_status *s)
     FloatParts128 p;
 
     float128_unpack_canonical(&p, a, s);
-    parts_round_to_int(&p, s->float_rounding_mode, 0, s, &float128_params);
+    parts128_round_to_int(&p, s->float_rounding_mode, 0, s, &float128_params);
     return float128_round_pack_canonical(&p, s);
 }
 
@@ -3176,7 +3166,7 @@ floatx80 floatx80_round_to_int(floatx80 a, float_status *status)
         return floatx80_default_nan(status);
     }
 
-    parts_round_to_int(&p, status->float_rounding_mode, 0, status,
+    parts128_round_to_int(&p, status->float_rounding_mode, 0, status,
                        &floatx80_params[status->floatx80_rounding_precision]);
     return floatx80_round_pack_canonical(&p, status);
 }
-- 
2.43.0
Re: [PATCH 18/84] fpu: Drop parts_round_to_int
Posted by Philippe Mathieu-Daudé 2 months, 1 week ago
On 26/4/26 15:38, Richard Henderson wrote:
> Use parts{64,128}_round_to_int at each call site.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   fpu/softfloat.c | 22 ++++++----------------
>   1 file changed, 6 insertions(+), 16 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>