opt_expr: Fix mul/div/mod by POT patterns to support >= 32 bits.
authorMarcelina Kościelnicka <mwk@0x04.net>
Wed, 9 Jun 2021 16:41:57 +0000 (18:41 +0200)
committerMarcelina Kościelnicka <mwk@0x04.net>
Wed, 9 Jun 2021 17:53:44 +0000 (19:53 +0200)
commit1667ad658b3aefd3b5418dace6403d3990029fb9
tree02266fe5b4cc93024bd13739ebc3b3302988aedf
parent12b3a9765dafeb8766265c82dee9e06435343e66
opt_expr: Fix mul/div/mod by POT patterns to support >= 32 bits.

The previous code, in addition to being needlessly limitted to 32 bits
in the first place, also had UB for the 31th bit (doing 1 << 31).
kernel/rtlil.cc
kernel/rtlil.h
passes/opt/opt_expr.cc