mirror of
https://github.com/verilator/verilator.git
synced 2025-04-21 12:06:55 +00:00
Internals: remove extra width sets
This commit is contained in:
parent
fdeb6bcae0
commit
b32f925468
@ -48,11 +48,12 @@ class EmitCInlines : EmitCBaseVisitor {
|
||||
virtual void visit(AstVar* nodep, AstNUser*) {
|
||||
// All wide constants load into variables, so we can just hunt for them
|
||||
nodep->iterateChildren(*this);
|
||||
if (nodep->widthWords() >= EMITCINLINES_NUM_CONSTW ) {
|
||||
if (int(m_wordWidths.size()) <= nodep->widthWords()) {
|
||||
m_wordWidths.resize(nodep->widthWords()+5);
|
||||
int words = nodep->widthWords();
|
||||
if (words >= EMITCINLINES_NUM_CONSTW ) {
|
||||
if (int(m_wordWidths.size()) <= words) {
|
||||
m_wordWidths.resize(words+5);
|
||||
}
|
||||
++ m_wordWidths.at(nodep->widthWords());
|
||||
++ m_wordWidths.at(words);
|
||||
v3Global.needHInlines(true);
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +229,6 @@ private:
|
||||
constwidthp),
|
||||
nodep,
|
||||
constzerop);
|
||||
newp->widthSignedFrom(nodep);
|
||||
replaceHandle.relink(newp);
|
||||
}
|
||||
}
|
||||
|
@ -108,14 +108,15 @@ private:
|
||||
AstNode* newp = new AstConst(lhsp->fileline(), num);
|
||||
return newp;
|
||||
} else if (rhs > 0) {
|
||||
// We must make sure sub gets sign of original value
|
||||
AstNode* newp = new AstSub(lhsp->fileline(), lhsp,
|
||||
new AstConst(lhsp->fileline(), AstConst::Unsized32(), rhs));
|
||||
// We must make sure sub gets sign of original value
|
||||
newp->numericFrom(lhsp);
|
||||
return newp;
|
||||
} else { // rhs < 0;
|
||||
AstNode* newp = new AstAdd(lhsp->fileline(), lhsp,
|
||||
new AstConst(lhsp->fileline(), AstConst::Unsized32(), -rhs));
|
||||
// We must make sure sub gets sign of original value
|
||||
newp->numericFrom(lhsp);
|
||||
return newp;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user