FPU: Normalize B for fmadd family instructions

If B is denormalized, but the A*C product is much smaller, then the
result is B; in the UE=1 case we need to normalize the result, and the
left shift to do that can bring in low-order product bits from S and
corrupt the result.  To avoid this, make sure B is normalized.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
pull/457/head
Paul Mackerras 2 weeks ago
parent 32919435a3
commit a0755935f4

@ -1824,7 +1824,7 @@ begin
if r.c.denorm = '1' then
-- must be either fmul or fmadd/sub
v.state := RENORM_C;
elsif r.b.denorm = '1' and r.is_addition = '0' then
elsif r.b.denorm = '1' and (r.is_addition = '0' or r.is_multiply = '1') then
v.state := RENORM_B;
elsif r.is_multiply = '1' and r.b.class = ZERO then
v.state := DO_FMUL;

Loading…
Cancel
Save