@samitouri / QOSamiQemu / commits / 7e197ed383

fpu: Drop parts_muladd_scalbn

Use parts{64,128}_muladd_scalbn 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 26, 2026 at 19:45 UTC 7e197ed383d5b23009f301aedf470babce9e7a62
1 file changed +9 -19
fpu/softfloat.c
+9 -19
@@ -779,16 +779,6 @@ static float128 QEMU_FLATTEN float128_pack_raw(const FloatParts128 *p)
779 FloatParts128 *: parts128_##NAME, \
780 FloatParts256 *: parts256_##NAME)
781
782 -static FloatParts64 *parts64_muladd_scalbn(FloatParts64 *a, FloatParts64 *b,
783 - FloatParts64 *c, int scale,
784 - int flags, float_status *s);
785 -static FloatParts128 *parts128_muladd_scalbn(FloatParts128 *a, FloatParts128 *b,
786 - FloatParts128 *c, int scale,
787 - int flags, float_status *s);
788 -
789 -#define parts_muladd_scalbn(A, B, C, Z, Y, S) \
790 - PARTS_GENERIC_64_128(muladd_scalbn, A)(A, B, C, Z, Y, S)
791 -
782 static FloatParts64 *parts64_div(FloatParts64 *a, FloatParts64 *b,
783 float_status *s);
784 static FloatParts128 *parts128_div(FloatParts128 *a, FloatParts128 *b,
@@ -2256,7 +2246,7 @@ float16_muladd_scalbn(float16 a, float16 b, float16 c,
2246 float16_unpack_canonical(&pa, a, status);
2247 float16_unpack_canonical(&pb, b, status);
2248 float16_unpack_canonical(&pc, c, status);
2259 - pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2249 + pr = parts64_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2250
2251 /* Round before applying negate result. */
2252 parts64_uncanon(pr, status, &float16_params, false);
@@ -2281,7 +2271,7 @@ float32_muladd_scalbn(float32 a, float32 b, float32 c,
2271 float32_unpack_canonical(&pa, a, status);
2272 float32_unpack_canonical(&pb, b, status);
2273 float32_unpack_canonical(&pc, c, status);
2284 - pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2274 + pr = parts64_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2275
2276 /* Round before applying negate result. */
2277 parts64_uncanon(pr, status, &float32_params, false);
@@ -2300,7 +2290,7 @@ float64_muladd_scalbn(float64 a, float64 b, float64 c,
2290 float64_unpack_canonical(&pa, a, status);
2291 float64_unpack_canonical(&pb, b, status);
2292 float64_unpack_canonical(&pc, c, status);
2303 - pr = parts_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2293 + pr = parts64_muladd_scalbn(&pa, &pb, &pc, scale, flags, status);
2294
2295 /* Round before applying negate result. */
2296 parts64_uncanon(pr, status, &float64_params, false);
@@ -2459,7 +2449,7 @@ float64 float64r32_muladd(float64 a, float64 b, float64 c,
2449 float64_unpack_canonical(&pa, a, status);
2450 float64_unpack_canonical(&pb, b, status);
2451 float64_unpack_canonical(&pc, c, status);
2462 - pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2452 + pr = parts64_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2453
2454 /* Round before applying negate result. */
2455 parts64_uncanon(pr, status, &float32_params, false);
@@ -2477,7 +2467,7 @@ bfloat16 QEMU_FLATTEN bfloat16_muladd(bfloat16 a, bfloat16 b, bfloat16 c,
2467 bfloat16_unpack_canonical(&pa, a, status);
2468 bfloat16_unpack_canonical(&pb, b, status);
2469 bfloat16_unpack_canonical(&pc, c, status);
2480 - pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2470 + pr = parts64_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2471
2472 /* Round before applying negate result. */
2473 parts64_uncanon(pr, status, &bfloat16_params, false);
@@ -2495,7 +2485,7 @@ float128 QEMU_FLATTEN float128_muladd(float128 a, float128 b, float128 c,
2485 float128_unpack_canonical(&pa, a, status);
2486 float128_unpack_canonical(&pb, b, status);
2487 float128_unpack_canonical(&pc, c, status);
2498 - pr = parts_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2488 + pr = parts128_muladd_scalbn(&pa, &pb, &pc, 0, flags, status);
2489
2490 /* Round before applying negate result. */
2491 parts128_uncanon(pr, status, &float128_params, false);
@@ -5442,7 +5432,7 @@ float32 float32_exp2(float32 a, float_status *status)
5432 for (i = 0 ; i < 15 ; i++) {
5433
5434 float64_unpack_canonical(&tp, float32_exp2_coefficients[i], status);
5445 - rp = *parts_muladd_scalbn(&tp, &xnp, &rp, 0, 0, status);
5435 + rp = *parts64_muladd_scalbn(&tp, &xnp, &rp, 0, 0, status);
5436 xnp = *parts64_mul(&xnp, &xp, status);
5437 }
5438
@@ -5522,8 +5512,8 @@ static void parts_s390_divide_to_integer(FloatParts64 *a, FloatParts64 *b,
5512
5513 /* Compute precise remainder */
5514 r_precise_buf = *b;
5525 - r_precise = parts_muladd_scalbn(&r_precise_buf, n, a, 0,
5526 - float_muladd_negate_product, status);
5515 + r_precise = parts64_muladd_scalbn(&r_precise_buf, n, a, 0,
5516 + float_muladd_negate_product, status);
5517
5518 /* Round remainder to the target format */
5519 *r = *r_precise;