remove use of out_do_z in add align
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 25 Aug 2019 10:46:25 +0000 (11:46 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 25 Aug 2019 10:46:25 +0000 (11:46 +0100)
src/ieee754/fpadd/align.py

index 0e2ad11904e3a2f1c606ad8b66f23f9f730fa12d..16f6da3977f0da32ef447c86701ebcb8c3ac3d1b 100644 (file)
@@ -85,38 +85,37 @@ class FPAddAlignSingleMod(PipeModBase):
         elz = Signal(reset_less=True)
         egz = Signal(reset_less=True)
 
-        with m.If(~self.i.out_do_z):
-            # connect multi-shifter to t_inp/out mantissa (and tdiff)
-            # (only one: input/output is muxed)
-            comb += msr.inp.eq(t_inp.m)
-            comb += msr.diff.eq(tdiff)
-            comb += t_out.m.eq(msr.m)
-            comb += t_out.e.eq(t_inp.e + tdiff)
-            comb += t_out.s.eq(t_inp.s)
-
-            comb += ediff.eq(self.i.a.e - self.i.b.e)   # a - b
-            comb += ediffr.eq(-ediff)                   # b - a
-            comb += elz.eq(self.i.a.e < self.i.b.e)     # ae < be
-            comb += egz.eq(self.i.a.e > self.i.b.e)     # ae > be
-
-            # default: A-exp == B-exp, A and B untouched (fall through)
-            comb += self.o.a.eq(self.i.a)
-            comb += self.o.b.eq(self.i.b)
-
-            # exponent of a greater than b: shift b down
-            with m.If(egz):
-                comb += [t_inp.eq(self.i.b),
-                             tdiff.eq(ediff),
-                             self.o.b.eq(t_out),
-                             self.o.b.s.eq(self.i.b.s), # whoops forgot sign
-                            ]
-            # exponent of b greater than a: shift a down
-            with m.Elif(elz):
-                comb += [t_inp.eq(self.i.a),
-                             tdiff.eq(ediffr),
-                             self.o.a.eq(t_out),
-                             self.o.a.s.eq(self.i.a.s), # whoops forgot sign
-                            ]
+        # connect multi-shifter to t_inp/out mantissa (and tdiff)
+        # (only one: input/output is muxed)
+        comb += msr.inp.eq(t_inp.m)
+        comb += msr.diff.eq(tdiff)
+        comb += t_out.m.eq(msr.m)
+        comb += t_out.e.eq(t_inp.e + tdiff)
+        comb += t_out.s.eq(t_inp.s)
+
+        comb += ediff.eq(self.i.a.e - self.i.b.e)   # a - b
+        comb += ediffr.eq(-ediff)                   # b - a
+        comb += elz.eq(self.i.a.e < self.i.b.e)     # ae < be
+        comb += egz.eq(self.i.a.e > self.i.b.e)     # ae > be
+
+        # default: A-exp == B-exp, A and B untouched (fall through)
+        comb += self.o.a.eq(self.i.a)
+        comb += self.o.b.eq(self.i.b)
+
+        # exponent of a greater than b: shift b down
+        with m.If(egz):
+            comb += [t_inp.eq(self.i.b),
+                         tdiff.eq(ediff),
+                         self.o.b.eq(t_out),
+                         self.o.b.s.eq(self.i.b.s), # whoops forgot sign
+                        ]
+        # exponent of b greater than a: shift a down
+        with m.Elif(elz):
+            comb += [t_inp.eq(self.i.a),
+                         tdiff.eq(ediffr),
+                         self.o.a.eq(t_out),
+                         self.o.a.s.eq(self.i.a.s), # whoops forgot sign
+                        ]
 
         comb += self.o.ctx.eq(self.i.ctx)
         comb += self.o.z.eq(self.i.z)