From 33c9591a4b8654f9d424f0ab3e703a78159c381c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 29 Apr 2012 11:34:25 -0400 Subject: [PATCH] Internals: Move widthPow2. No functional change. --- src/V3Ast.cpp | 9 --------- src/V3Ast.h | 1 - src/V3AstNodes.cpp | 9 +++++++++ src/V3EmitC.cpp | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index f223e58c2..f8a24422f 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -230,15 +230,6 @@ string AstNode::quoteName(const string& namein) { return out; } -int AstNode::widthPow2() const { - // I.e. width 30 returns 32, width 32 returns 32. - uint32_t width = this->width(); - for (int p2=30; p2>=0; p2--) { - if (width > (1UL<VL_WORDSIZE && width()<=VL_QUADSIZE); } bool isWide() const { return (width()>VL_QUADSIZE); } bool isDouble() const; diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index 3e8d1e886..923859376 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -326,6 +326,15 @@ pair AstNodeDType::dimensions() { return make_pair(packed, unpacked); } +int AstNodeDType::widthPow2() const { + // I.e. width 30 returns 32, width 32 returns 32. + uint32_t width = this->width(); + for (int p2=30; p2>=0; p2--) { + if (width > (1UL<castNodeUniop(), vup); } else { putbs("VL_REDXOR_"); - puts(cvtToStr(nodep->lhsp()->widthPow2())); + puts(cvtToStr(nodep->lhsp()->dtypep()->widthPow2())); puts("("); nodep->lhsp()->iterateAndNext(*this); puts(")");