hdl.ast: remove dead code. NFC.
authorwhitequark <whitequark@whitequark.org>
Sat, 21 Nov 2020 17:29:55 +0000 (17:29 +0000)
committerwhitequark <whitequark@whitequark.org>
Sat, 21 Nov 2020 17:30:28 +0000 (17:30 +0000)
See #548.

nmigen/hdl/ast.py

index c922d269b1bac5b59b16adfb3b42ef8b7553c680..165e67d8e9b78328e727aee50f21aefe35798964 100644 (file)
@@ -702,17 +702,11 @@ class Operator(Value):
             if self.operator in ("&", "^", "|"):
                 return _bitwise_binary_shape(*op_shapes)
             if self.operator == "<<":
-                if b_signed:
-                    extra = 2 ** (b_width - 1) - 1
-                else:
-                    extra = 2 ** (b_width)     - 1
-                return Shape(a_width + extra, a_signed)
+                assert not b_signed
+                return Shape(a_width + 2 ** b_width - 1, a_signed)
             if self.operator == ">>":
-                if b_signed:
-                    extra = 2 ** (b_width - 1)
-                else:
-                    extra = 0
-                return Shape(a_width + extra, a_signed)
+                assert not b_signed
+                return Shape(a_width, a_signed)
         elif len(op_shapes) == 3:
             if self.operator == "m":
                 s_shape, a_shape, b_shape = op_shapes