mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-22 22:03:40 +00:00
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).
This commit is contained in:
parent
12b3a9765d
commit
1667ad658b
3 changed files with 122 additions and 124 deletions
|
@ -662,6 +662,7 @@ struct RTLIL::Const
|
|||
bool is_fully_ones() const;
|
||||
bool is_fully_def() const;
|
||||
bool is_fully_undef() const;
|
||||
bool is_onehot(int *pos = nullptr) const;
|
||||
|
||||
inline RTLIL::Const extract(int offset, int len = 1, RTLIL::State padding = RTLIL::State::S0) const {
|
||||
RTLIL::Const ret;
|
||||
|
@ -934,6 +935,7 @@ public:
|
|||
bool is_fully_undef() const;
|
||||
bool has_const() const;
|
||||
bool has_marked_bits() const;
|
||||
bool is_onehot(int *pos = nullptr) const;
|
||||
|
||||
bool as_bool() const;
|
||||
int as_int(bool is_signed = false) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue