mirror of
https://github.com/antonblanchard/microwatt.git
synced 2026-01-11 23:43:15 +00:00
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>
This commit is contained in:
parent
32919435a3
commit
a0755935f4
2
fpu.vhdl
2
fpu.vhdl
@ -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…
x
Reference in New Issue
Block a user