diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-06-09 18:41:57 +0200 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-06-09 19:53:44 +0200 |
commit | 1667ad658b3aefd3b5418dace6403d3990029fb9 (patch) | |
tree | 02266fe5b4cc93024bd13739ebc3b3302988aedf /kernel/rtlil.h | |
parent | 12b3a9765dafeb8766265c82dee9e06435343e66 (diff) | |
download | yosys-1667ad658b3aefd3b5418dace6403d3990029fb9.tar.gz yosys-1667ad658b3aefd3b5418dace6403d3990029fb9.tar.bz2 yosys-1667ad658b3aefd3b5418dace6403d3990029fb9.zip |
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).
Diffstat (limited to 'kernel/rtlil.h')
-rw-r--r-- | kernel/rtlil.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 6ecca7370..d876d7831 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -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; |