diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/celltypes.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/celltypes.h b/kernel/celltypes.h index cc84251c3..cd72192af 100644 --- a/kernel/celltypes.h +++ b/kernel/celltypes.h @@ -185,6 +185,14 @@ struct CellTypes static RTLIL::Const eval(std::string type, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len) { + if (type == "$sshr" && !signed1) + type = "$shr"; + if (type == "$sshl" && !signed1) + type = "$shl"; + + if (!signed1 || !signed2) + signed1 = false, signed2 = false; + #define HANDLE_CELL_TYPE(_t) if (type == "$" #_t) return const_ ## _t(arg1, arg2, signed1, signed2, result_len); HANDLE_CELL_TYPE(not) HANDLE_CELL_TYPE(and) |