From 1f4978a29941dc57cbc984a9717c92b7cc90c3c7 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 21 Nov 2020 17:29:55 +0000 Subject: [PATCH] hdl.ast: remove dead code. NFC. See #548. --- nmigen/hdl/ast.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/nmigen/hdl/ast.py b/nmigen/hdl/ast.py index c922d26..165e67d 100644 --- a/nmigen/hdl/ast.py +++ b/nmigen/hdl/ast.py @@ -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 -- 2.30.2