parent
c1ed90807b
commit
39ff7203ba
|
@ -702,17 +702,11 @@ class Operator(Value):
|
||||||
if self.operator in ("&", "^", "|"):
|
if self.operator in ("&", "^", "|"):
|
||||||
return _bitwise_binary_shape(*op_shapes)
|
return _bitwise_binary_shape(*op_shapes)
|
||||||
if self.operator == "<<":
|
if self.operator == "<<":
|
||||||
if b_signed:
|
assert not b_signed
|
||||||
extra = 2 ** (b_width - 1) - 1
|
return Shape(a_width + 2 ** b_width - 1, a_signed)
|
||||||
else:
|
|
||||||
extra = 2 ** (b_width) - 1
|
|
||||||
return Shape(a_width + extra, a_signed)
|
|
||||||
if self.operator == ">>":
|
if self.operator == ">>":
|
||||||
if b_signed:
|
assert not b_signed
|
||||||
extra = 2 ** (b_width - 1)
|
return Shape(a_width, a_signed)
|
||||||
else:
|
|
||||||
extra = 0
|
|
||||||
return Shape(a_width + extra, a_signed)
|
|
||||||
elif len(op_shapes) == 3:
|
elif len(op_shapes) == 3:
|
||||||
if self.operator == "m":
|
if self.operator == "m":
|
||||||
s_shape, a_shape, b_shape = op_shapes
|
s_shape, a_shape, b_shape = op_shapes
|
||||||
|
|
Loading…
Reference in a new issue