use alternative logic for roundz detect exponent increase
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 31 Jul 2019 23:24:14 +0000 (00:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 31 Jul 2019 23:24:14 +0000 (00:24 +0100)
src/ieee754/fpcommon/roundz.py

index e061d2a1cc2e4da0646e017ab635a431ccc82fca..a9ef2e768d0ff7351ac8202689eee6e34d3219dd 100644 (file)
@@ -47,7 +47,7 @@ class FPRoundMod(PipeModBase):
         with m.If(~self.i.out_do_z):  # bypass wasn't enabled
             with m.If(self.i.roundz):
                 comb += self.o.z.m.eq(self.i.z.m + 1)  # mantissa up
-                with m.If(self.i.z.m == self.i.z.m1s):  # all 1s
+                with m.If(~(~self.i.z.m).bool()):  # all 1s
                     # exponent up
                     comb += self.o.z.e.eq(self.i.z.e + 1)