From 11433357838a8812c0644b92bd4e256e608e76e9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 23 Jul 2019 16:43:45 +0100 Subject: [PATCH] add more fpsqrt specialcases --- src/ieee754/fpdiv/specialcases.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ieee754/fpdiv/specialcases.py b/src/ieee754/fpdiv/specialcases.py index 47e87abb..5c491638 100644 --- a/src/ieee754/fpdiv/specialcases.py +++ b/src/ieee754/fpdiv/specialcases.py @@ -114,6 +114,11 @@ class FPDIVSpecialCasesMod(Elaboratable): m.d.comb += self.o.out_do_z.eq(1) m.d.comb += self.o.z.inf(sabx) + # if a is NaN return NaN + with m.If(a1.is_nan): + m.d.comb += self.o.out_do_z.eq(1) + m.d.comb += self.o.z.nan(0) + # if a is zero return zero with m.Elif(a1.is_zero): m.d.comb += self.o.out_do_z.eq(1) -- 2.30.2