fpu: Sink exp_bias adjustment in float64r32_pack_raw
Share the float32->float64 bias adjustment from both the normal and denormal paths. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Richard Henderson committed
Apr 26, 2026 at 10:50 UTC
558c92ed740b765260ba31a328d5d78b7ced0347
1 file changed
+2
-4
fpu/softfloat.c
+2
-4
@@ -1412,14 +1412,12 @@ static float64 float64r32_pack_raw(FloatParts64 *p)
1412
* in normalized form for float64. Adjust, per canonicalize.
1413
*/
1414
int shift = frac64_normalize(p);
1415
- p->exp = (float32_params.frac_shift -
1416
- float32_params.exp_bias - shift + 1 +
1417
- float64_params.exp_bias);
1415
frac64_shr(p, float64_params.frac_shift);
1416
+ p->exp = float32_params.frac_shift - shift + 1;
1417
} else {
1418
frac64_shl(p, float32_params.frac_shift - float64_params.frac_shift);
1421
- p->exp += float64_params.exp_bias - float32_params.exp_bias;
1419
}
1420
+ p->exp += float64_params.exp_bias - float32_params.exp_bias;
1421
break;
1422
case float_class_snan:
1423
case float_class_qnan: