From: Luke Kenneth Casson Leighton Date: Mon, 22 Jul 2019 08:50:09 +0000 (+0100) Subject: fix div specialcases X-Git-Tag: ls180-24jan2020~778 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d144527855a050642dcf0644822bf6ec52382893;p=ieee754fpu.git fix div specialcases --- diff --git a/src/ieee754/fpdiv/specialcases.py b/src/ieee754/fpdiv/specialcases.py index 4a73e435..5bbe5c40 100644 --- a/src/ieee754/fpdiv/specialcases.py +++ b/src/ieee754/fpdiv/specialcases.py @@ -66,12 +66,12 @@ class FPDIVSpecialCasesMod(Elaboratable): # if a is NaN or b is NaN return NaN with m.If(abnan): m.d.comb += self.o.out_do_z.eq(1) - m.d.comb += self.o.z.nan(1) + m.d.comb += self.o.z.nan(0) # if a is inf and b is Inf return NaN - with m.Elif(abnan): + with m.Elif(abinf): m.d.comb += self.o.out_do_z.eq(1) - m.d.comb += self.o.z.nan(1) + m.d.comb += self.o.z.nan(0) # if a is inf return inf with m.Elif(a1.is_inf): @@ -89,7 +89,7 @@ class FPDIVSpecialCasesMod(Elaboratable): m.d.comb += self.o.z.zero(sabx) # b is zero return NaN with m.If(b1.is_zero): - m.d.comb += self.o.z.nan(1) + m.d.comb += self.o.z.nan(0) # if b is zero return Inf with m.Elif(b1.is_zero):