From 3aa290cddb687e5a4d065d52cd69a09958a1a963 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 10 May 2014 08:24:51 -0400 Subject: [PATCH] Add error on power > 64-bits, bug761. --- src/V3Number.cpp | 4 ++-- src/V3Width.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/V3Number.cpp b/src/V3Number.cpp index 8daee0f80..2882d6660 100644 --- a/src/V3Number.cpp +++ b/src/V3Number.cpp @@ -1417,8 +1417,8 @@ V3Number& V3Number::opPow (const V3Number& lhs, const V3Number& rhs, bool lsign, if (lhs.isFourState() || rhs.isFourState()) return setAllBitsX(); if (rhs.isEqZero()) return setQuad(1); // Overrides lhs 0 -> return 0 // We may want to special case when the lhs is 2, so we can get larger outputs - if (lhs.width()>64) m_fileline->v3fatalSrc("Unsupported: Large >64bit ** math not implemented yet: "<<*this); - if (rhs.width()>64) m_fileline->v3fatalSrc("Unsupported: Large >64bit ** math not implemented yet: "<<*this); + if (lhs.width()>64) m_fileline->v3fatalSrc("Unsupported: Large >64bit ** power operator not implemented yet: "<<*this); + if (rhs.width()>64) m_fileline->v3fatalSrc("Unsupported: Large >64bit ** power operator not implemented yet: "<<*this); if (rsign && rhs.isNegative()) { if (lhs.isEqZero()) return setAllBitsX(); else if (lhs.isEqOne()) return setQuad(1); diff --git a/src/V3Width.cpp b/src/V3Width.cpp index fefd746cf..67568e335 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -700,6 +700,7 @@ private: nodep->dtypeFrom(expDTypep); // rhs already finalized in iterate_shift_prelim iterateCheck(nodep,"LHS",nodep->lhsp(),SELF,FINAL,nodep->dtypep(),EXTEND_EXP); + if (nodep->width()>64) nodep->v3error("Unsupported: Large >64bit ** power operator not implemented."); AstNode* newp = NULL; // No change if (nodep->lhsp()->isSigned() && nodep->rhsp()->isSigned()) { newp = new AstPowSS (nodep->fileline(), nodep->lhsp()->unlinkFrBack(),