hdl.ast: implement shape for modulo operator.

This commit is contained in:
whitequark 2019-01-19 09:26:26 +00:00
parent 5e2b46f727
commit 38b3c4af31

View file

@ -341,6 +341,8 @@ class Operator(Value):
return a_bits + b_bits - 1, True
# one operand signed, the other unsigned (add sign bit)
return a_bits + b_bits + 1 - 1, True
if self.op == "%":
return a_bits, a_sign
if self.op in ("<", "<=", "==", "!=", ">", ">=", "b"):
return 1, False
if self.op in ("&", "^", "|"):