From: Luke Kenneth Casson Leighton Date: Mon, 18 Feb 2019 11:55:33 +0000 (+0000) Subject: fix a - b = zero by adding special case X-Git-Tag: ls180-24jan2020~1914 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40e7f99d07484253630d09a339547f2db1ddd4ce;p=ieee754fpu.git fix a - b = zero by adding special case --- diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index a751ea2e..7d9ccb71 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -88,6 +88,10 @@ class FPADD(FPBase): m.next = "put_z" m.d.sync += z.create(a.s, a.e, a.m[3:-1]) + with m.Elif((a.s != b.s) & (a.m == b.m) & (a.e == b.e)): + m.next = "put_z" + m.d.sync += z.zero(0) + # Denormalised Number checks with m.Else(): m.next = "align"