summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-06-13 19:51:13 +0200
committerClifford Wolf <clifford@clifford.at>2013-06-13 19:51:13 +0200
commit30db70b1baaad1f299234b419ac2dc581eee1e14 (patch)
treeeaa40205b162ec41f9fa2fbc37f1bcdb024341b4 /kernel
parent7f6c83a853e1d127365169e018f44faaac405326 (diff)
Added consteval testing to xsthammer and fixed bugs
Diffstat (limited to 'kernel')
-rw-r--r--kernel/celltypes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/celltypes.h b/kernel/celltypes.h
index cc84251c..cd72192a 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)