From 3e65b565b5ff8fd0fd8f1fe3090202ed4bf39de5 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 23 Jul 2019 16:43:04 +0100 Subject: [PATCH] add more fpsqrt specialcases --- src/ieee754/fpdiv/specialcases.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ieee754/fpdiv/specialcases.py b/src/ieee754/fpdiv/specialcases.py index 56a76657..47e87abb 100644 --- a/src/ieee754/fpdiv/specialcases.py +++ b/src/ieee754/fpdiv/specialcases.py @@ -108,6 +108,17 @@ class FPDIVSpecialCasesMod(Elaboratable): with m.If(a1.s): m.d.comb += self.o.out_do_z.eq(1) m.d.comb += self.o.z.nan(0) + + # if a is inf return inf + with m.Elif(a1.is_inf): + m.d.comb += self.o.out_do_z.eq(1) + m.d.comb += self.o.z.inf(sabx) + + # if a is zero return zero + with m.Elif(a1.is_zero): + m.d.comb += self.o.out_do_z.eq(1) + m.d.comb += self.o.z.zero(0) + # Denormalised Number checks next, so pass a/b data through with m.Else(): m.d.comb += self.o.out_do_z.eq(0) -- 2.30.2