mirror of https://github.com/YosysHQ/yosys.git
peepopt: fix sign check in shiftadd
This commit is contained in:
parent
34b5c6d062
commit
74e504330a
|
@ -63,7 +63,8 @@ match add
|
|||
|
||||
define <bool> constport_signed param(add, !varport_A ? \A_SIGNED : \B_SIGNED).as_bool()
|
||||
define <bool> varport_signed param(add, varport_A ? \A_SIGNED : \B_SIGNED).as_bool();
|
||||
define <bool> offset_negative ((port(add, constport).bits().back() == State::S1) ^ (is_sub && varport_A))
|
||||
define <bool> const_negative (constport_signed && (port(add, constport).bits().back() == State::S1))
|
||||
define <bool> offset_negative ((is_sub && varport_A) ^ const_negative)
|
||||
|
||||
// checking some value boundaries as well:
|
||||
// data[...-c +:W1] is fine for any signed var (pad at LSB, all data still accessible)
|
||||
|
|
Loading…
Reference in New Issue