From a9208287f2b3dac2247decfd67a2ffa1bb79502a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 31 Jul 2019 13:20:43 +0100 Subject: [PATCH] initialise out_do_z at beginning of ifs, set to zero if required --- src/ieee754/fpmul/specialcases.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ieee754/fpmul/specialcases.py b/src/ieee754/fpmul/specialcases.py index d4eb3c82..52b01fbb 100644 --- a/src/ieee754/fpmul/specialcases.py +++ b/src/ieee754/fpmul/specialcases.py @@ -52,14 +52,15 @@ class FPMulSpecialCasesMod(FPModBase): abnan = Signal(reset_less=True) comb += abnan.eq(a1.is_nan | b1.is_nan) + # initialise and override if needed + comb += self.o.out_do_z.eq(1) + # if a is NaN or b is NaN return NaN with m.If(abnan): - comb += self.o.out_do_z.eq(1) comb += self.o.z.nan(0) # if a is inf return inf (or NaN) with m.Elif(a1.is_inf): - comb += self.o.out_do_z.eq(1) comb += self.o.z.inf(sabx) # b is zero return NaN with m.If(b1.is_zero): @@ -67,7 +68,6 @@ class FPMulSpecialCasesMod(FPModBase): # if b is inf return inf (or NaN) with m.Elif(b1.is_inf): - comb += self.o.out_do_z.eq(1) comb += self.o.z.inf(sabx) # a is zero return NaN with m.If(a1.is_zero): @@ -75,7 +75,6 @@ class FPMulSpecialCasesMod(FPModBase): # if a is zero or b zero return signed-a/b with m.Elif(obz): - comb += self.o.out_do_z.eq(1) comb += self.o.z.zero(sabx) # Denormalised Number checks next, so pass a/b data through -- 2.30.2