projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6bf75be
)
static cast: simplify
author
Kazuki Sakamoto
<sakamoto@splhack.org>
Sat, 20 Jun 2020 02:09:43 +0000
(19:09 -0700)
committer
Kazuki Sakamoto
<sakamoto@splhack.org>
Sat, 20 Jun 2020 02:09:43 +0000
(19:09 -0700)
frontends/ast/simplify.cc
patch
|
blob
|
history
diff --git
a/frontends/ast/simplify.cc
b/frontends/ast/simplify.cc
index 1d5dd91a7ac602012ddd1b1458d09c12c6496071..e2da17c0909ec2cd6e2bea233c2e8e9b093ea2ae 100644
(file)
--- a/
frontends/ast/simplify.cc
+++ b/
frontends/ast/simplify.cc
@@
-3484,6
+3484,13
@@
replace_fcall_later:;
}
}
break;
+ case AST_CAST_SIZE:
+ if (children.at(0)->type == AST_CONSTANT && children.at(1)->type == AST_CONSTANT) {
+ int width = children[0]->bitsAsConst().as_int();
+ RTLIL::Const val = children[1]->bitsAsConst(width);
+ newNode = mkconst_bits(val.bits, children[1]->is_signed);
+ }
+ break;
case AST_CONCAT:
string_op = !children.empty();
for (auto it = children.begin(); it != children.end(); it++) {