Skip to content

Commit 39ff720

Browse files
committed
hdl.ast: remove dead code. NFC.
See #548.
1 parent c1ed908 commit 39ff720

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

nmigen/hdl/ast.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -702,17 +702,11 @@ def _bitwise_binary_shape(a_shape, b_shape):
702702
if self.operator in ("&", "^", "|"):
703703
return _bitwise_binary_shape(*op_shapes)
704704
if self.operator == "<<":
705-
if b_signed:
706-
extra = 2 ** (b_width - 1) - 1
707-
else:
708-
extra = 2 ** (b_width) - 1
709-
return Shape(a_width + extra, a_signed)
705+
assert not b_signed
706+
return Shape(a_width + 2 ** b_width - 1, a_signed)
710707
if self.operator == ">>":
711-
if b_signed:
712-
extra = 2 ** (b_width - 1)
713-
else:
714-
extra = 0
715-
return Shape(a_width + extra, a_signed)
708+
assert not b_signed
709+
return Shape(a_width, a_signed)
716710
elif len(op_shapes) == 3:
717711
if self.operator == "m":
718712
s_shape, a_shape, b_shape = op_shapes

0 commit comments

Comments
 (0)