From: Luke Kenneth Casson Leighton Date: Tue, 23 Jul 2019 15:43:04 +0000 (+0100) Subject: add more fpsqrt specialcases X-Git-Tag: ls180-24jan2020~750 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3e65b565b5ff8fd0fd8f1fe3090202ed4bf39de5;p=ieee754fpu.git add more fpsqrt specialcases --- 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)