replace ~bool() with all()
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 9 Feb 2020 18:35:35 +0000 (18:35 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 9 Feb 2020 18:35:35 +0000 (18:35 +0000)
src/ieee754/fcvt/downsize.py

index 0ca477128aff70aca81d26696fb29ff63be9867d..cfc8a69e03c3fb9828aa2f5a200eeb028dc3a299 100644 (file)
@@ -106,10 +106,10 @@ class FPCVTDownConvertMod(PipeModBase):
             mo = Signal(self.o.z.m_width-1)
             comb += mo.eq(a1.m[ms:me])
             with m.If(self.o.of.roundz):
-                with m.If(((~mo).bool())):  # mantissa-out is all 1s
-                    comb += self.o.z.create(a1.s, a1.e, mo+1)
-                with m.Else():
+                with m.If((mo.all())):  # mantissa-out is all 1s
                     comb += self.o.z.create(a1.s, a1.e+1, mo+1)
+                with m.Else():
+                    comb += self.o.z.create(a1.s, a1.e, mo+1)
             with m.Else():
                 comb += self.o.z.create(a1.s, a1.e, a1.m[-self.o.z.rmw-1:])