- 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)
+ comb += sabx.eq(a1.s ^ b1.s)
+ comb += t_obz.eq(a1.is_zero | b1.is_zero)
+ comb += t_a1inf.eq(a1.is_inf)
+ comb += t_b1inf.eq(b1.is_inf)
+ comb += t_abnan.eq(a1.is_nan | b1.is_nan)
+ comb += t_special.eq(Cat(t_obz, t_abnan, t_b1inf, t_a1inf).bool())
+
+ # prepare inf/zero/nans
+ z_zero = FPNumBaseRecord(width, False, name="z_zero")
+ z_nan = FPNumBaseRecord(width, False, name="z_nan")
+ z_inf = FPNumBaseRecord(width, False, name="z_inf")
+ comb += z_zero.zero(sabx)
+ comb += z_nan.nan(0)
+ comb += z_inf.inf(sabx)
+
+ # special case pipeline bypass enabled y/n
+ comb += self.o.out_do_z.eq(t_special)