@samitouri / QOSamiQemu / commits / a9969b575b

fpu: Drop parts_uncanon

Use parts{64,128}_uncanon at each call site. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Richard Henderson committed Apr 25, 2026 at 21:38 UTC a9969b575bea2071676d194b8427f16c38040854
1 file changed +18 -26
fpu/softfloat.c
+18 -26
@@ -814,14 +814,6 @@ static void parts128_uncanon_normal(FloatParts128 *p, float_status *status,
814 #define parts_uncanon_normal(A, S, F, X) \
815 PARTS_GENERIC_64_128(uncanon_normal, A)(A, S, F, X)
816
817 -static void parts64_uncanon(FloatParts64 *p, float_status *status,
818 - const FloatFmt *fmt, bool saturate);
819 -static void parts128_uncanon(FloatParts128 *p, float_status *status,
820 - const FloatFmt *fmt, bool saturate);
821 -
822 -#define parts_uncanon(A, S, F, X) \
823 - PARTS_GENERIC_64_128(uncanon, A)(A, S, F, X)
824 -
817 static void parts64_add_normal(FloatParts64 *a, FloatParts64 *b);
818 static void parts128_add_normal(FloatParts128 *a, FloatParts128 *b);
819 static void parts256_add_normal(FloatParts256 *a, FloatParts256 *b);
@@ -1756,7 +1748,7 @@ static float8_e4m3 float8_e4m3_round_pack_canonical(FloatParts64 *p,
1748 float_status *s,
1749 bool saturate)
1750 {
1759 - parts_uncanon(p, s, &float8_e4m3_params, saturate);
1751 + parts64_uncanon(p, s, &float8_e4m3_params, saturate);
1752 return float8_e4m3_pack_raw(p);
1753 }
1754
@@ -1764,7 +1756,7 @@ static float8_e5m2 float8_e5m2_round_pack_canonical(FloatParts64 *p,
1756 float_status *s,
1757 bool saturate)
1758 {
1767 - parts_uncanon(p, s, &float8_e5m2_params, saturate);
1759 + parts64_uncanon(p, s, &float8_e5m2_params, saturate);
1760 return float8_e5m2_pack_raw(p);
1761 }
1762
@@ -1772,7 +1764,7 @@ static float16 float16a_round_pack_canonical(FloatParts64 *p,
1764 float_status *s,
1765 const FloatFmt *params)
1766 {
1775 - parts_uncanon(p, s, params, false);
1767 + parts64_uncanon(p, s, params, false);
1768 return float16_pack_raw(p);
1769 }
1770
@@ -1785,7 +1777,7 @@ static float16 float16_round_pack_canonical(FloatParts64 *p,
1777 static bfloat16 bfloat16_round_pack_canonical(FloatParts64 *p,
1778 float_status *s)
1779 {
1788 - parts_uncanon(p, s, &bfloat16_params, false);
1780 + parts64_uncanon(p, s, &bfloat16_params, false);
1781 return bfloat16_pack_raw(p);
1782 }
1783
@@ -1799,7 +1791,7 @@ static void float32_unpack_canonical(FloatParts64 *p, float32 f,
1791 static float32 float32_round_pack_canonical(FloatParts64 *p,
1792 float_status *s)
1793 {
1802 - parts_uncanon(p, s, &float32_params, false);
1794 + parts64_uncanon(p, s, &float32_params, false);
1795 return float32_pack_raw(p);
1796 }
1797
@@ -1813,14 +1805,14 @@ static void float64_unpack_canonical(FloatParts64 *p, float64 f,
1805 static float64 float64_round_pack_canonical(FloatParts64 *p,
1806 float_status *s)
1807 {
1816 - parts_uncanon(p, s, &float64_params, false);
1808 + parts64_uncanon(p, s, &float64_params, false);
1809 return float64_pack_raw(p);
1810 }
1811
1812 static float64 float64r32_pack_raw(FloatParts64 *p)
1813 {
1814 /*
1823 - * In parts_uncanon, we placed the fraction for float32 at the lsb.
1815 + * In parts64_uncanon, we placed the fraction for float32 at the lsb.
1816 * We need to adjust the fraction higher so that the least N bits are
1817 * zero, and the fraction is adjacent to the float64 implicit bit.
1818 */
@@ -1862,7 +1854,7 @@ static float64 float64r32_pack_raw(FloatParts64 *p)
1854 static float64 float64r32_round_pack_canonical(FloatParts64 *p,
1855 float_status *s)
1856 {
1865 - parts_uncanon(p, s, &float32_params, false);
1857 + parts64_uncanon(p, s, &float32_params, false);
1858 return float64r32_pack_raw(p);
1859 }
1860
@@ -1876,7 +1868,7 @@ static void float128_unpack_canonical(FloatParts128 *p, float128 f,
1868 static float128 float128_round_pack_canonical(FloatParts128 *p,
1869 float_status *s)
1870 {
1879 - parts_uncanon(p, s, &float128_params, false);
1871 + parts128_uncanon(p, s, &float128_params, false);
1872 return float128_pack_raw(p);
1873 }
1874
@@ -1924,7 +1916,7 @@ static floatx80 floatx80_round_pack_canonical(FloatParts128 *p,
1916 case float_class_normal:
1917 case float_class_denormal:
1918 if (s->floatx80_rounding_precision == floatx80_precision_x) {
1927 - parts_uncanon_normal(p, s, fmt, false);
1919 + parts128_uncanon_normal(p, s, fmt, false);
1920 frac = p->frac_hi;
1921 exp = p->exp;
1922 } else {
@@ -1933,7 +1925,7 @@ static floatx80 floatx80_round_pack_canonical(FloatParts128 *p,
1925 p64.sign = p->sign;
1926 p64.exp = p->exp;
1927 frac_truncjam(&p64, p);
1936 - parts_uncanon_normal(&p64, s, fmt, false);
1928 + parts64_uncanon_normal(&p64, s, fmt, false);
1929 frac = p64.frac;
1930 exp = p64.exp;
1931 }
@@ -2331,7 +2323,7 @@ float16_muladd_scalbn(float16 a, float16 b, float16 c,
2323 pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2324
2325 /* Round before applying negate result. */
2334 - parts_uncanon(pr, status, &float16_params, false);
2326 + parts64_uncanon(pr, status, &float16_params, false);
2327 if ((flags & float_muladd_negate_result) && !is_nan(pr->cls)) {
2328 pr->sign ^= 1;
2329 }
@@ -2356,7 +2348,7 @@ float32_muladd_scalbn(float32 a, float32 b, float32 c,
2348 pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2349
2350 /* Round before applying negate result. */
2359 - parts_uncanon(pr, status, &float32_params, false);
2351 + parts64_uncanon(pr, status, &float32_params, false);
2352 if ((flags & float_muladd_negate_result) && !is_nan(pr->cls)) {
2353 pr->sign ^= 1;
2354 }
@@ -2375,7 +2367,7 @@ float64_muladd_scalbn(float64 a, float64 b, float64 c,
2367 pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2368
2369 /* Round before applying negate result. */
2378 - parts_uncanon(pr, status, &float64_params, false);
2370 + parts64_uncanon(pr, status, &float64_params, false);
2371 if ((flags & float_muladd_negate_result) && !is_nan(pr->cls)) {
2372 pr->sign ^= 1;
2373 }
@@ -2534,7 +2526,7 @@ float64 float64r32_muladd(float64 a, float64 b, float64 c,
2526 pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2527
2528 /* Round before applying negate result. */
2537 - parts_uncanon(pr, status, &float32_params, false);
2529 + parts64_uncanon(pr, status, &float32_params, false);
2530 if ((flags & float_muladd_negate_result) && !is_nan(pr->cls)) {
2531 pr->sign ^= 1;
2532 }
@@ -2552,7 +2544,7 @@ bfloat16 QEMU_FLATTEN bfloat16_muladd(bfloat16 a, bfloat16 b, bfloat16 c,
2544 pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2545
2546 /* Round before applying negate result. */
2555 - parts_uncanon(pr, status, &bfloat16_params, false);
2547 + parts64_uncanon(pr, status, &bfloat16_params, false);
2548 if ((flags & float_muladd_negate_result) && !is_nan(pr->cls)) {
2549 pr->sign ^= 1;
2550 }
@@ -2570,7 +2562,7 @@ float128 QEMU_FLATTEN float128_muladd(float128 a, float128 b, float128 c,
2562 pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2563
2564 /* Round before applying negate result. */
2573 - parts_uncanon(pr, status, &float128_params, false);
2565 + parts128_uncanon(pr, status, &float128_params, false);
2566 if ((flags & float_muladd_negate_result) && !is_nan(pr->cls)) {
2567 pr->sign ^= 1;
2568 }
@@ -5600,7 +5592,7 @@ static void parts_s390_divide_to_integer(FloatParts64 *a, FloatParts64 *b,
5592 /* Round remainder to the target format */
5593 *r = *r_precise;
5594 status->float_exception_flags = 0;
5603 - parts_uncanon(r, status, fmt, false);
5595 + parts64_uncanon(r, status, fmt, false);
5596 r_flags = status->float_exception_flags;
5597 r->frac &= (1ULL << fmt->frac_size) - 1;
5598 parts64_canonicalize(r, status, fmt);