projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
656685f
)
Improved AstNode::realAsConst for large numbers
author
Clifford Wolf
<clifford@clifford.at>
Sun, 15 Jun 2014 07:27:09 +0000
(09:27 +0200)
committer
Clifford Wolf
<clifford@clifford.at>
Sun, 15 Jun 2014 07:27:09 +0000
(09:27 +0200)
frontends/ast/ast.cc
patch
|
blob
|
history
diff --git
a/frontends/ast/ast.cc
b/frontends/ast/ast.cc
index cc7f442bb9c0e36b12064f991fa5df2dbe734ccd..967111d306333ffa760352d2f9fb38cd3847d4f5 100644
(file)
--- a/
frontends/ast/ast.cc
+++ b/
frontends/ast/ast.cc
@@
-808,7
+808,7
@@
RTLIL::Const AstNode::realAsConst(int width)
if (is_negative)
v *= -1;
for (int i = 0; i < width; i++, v /= 2)
- result.bits.push_back((
int(v) & 1
) ? RTLIL::State::S1 : RTLIL::State::S0);
+ result.bits.push_back((
fmod(floor(v), 2) != 0
) ? RTLIL::State::S1 : RTLIL::State::S0);
if (is_negative)
result = const_neg(result, result, false, false, result.bits.size());
}