From f79539e2576ae0c38359389dc5b693090acdf56b Mon Sep 17 00:00:00 2001 From: Aina Niemetz Date: Tue, 1 Dec 2020 18:05:27 -0800 Subject: Remove use of this-> in FP literal. (#5565) --- src/util/floatingpoint_literal_symfpu.cpp | 78 +++++++++++++++--------------- src/util/floatingpoint_literal_symfpu.h.in | 7 ++- 2 files changed, 45 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/util/floatingpoint_literal_symfpu.cpp b/src/util/floatingpoint_literal_symfpu.cpp index fb5c0b7b5..77ab910fa 100644 --- a/src/util/floatingpoint_literal_symfpu.cpp +++ b/src/util/floatingpoint_literal_symfpu.cpp @@ -65,12 +65,12 @@ wrappedBitVector wrappedBitVector::allOnes( template CVC4Prop wrappedBitVector::isAllOnes() const { - return (*this == wrappedBitVector::allOnes(this->getWidth())); + return (*this == wrappedBitVector::allOnes(getWidth())); } template CVC4Prop wrappedBitVector::isAllZeros() const { - return (*this == wrappedBitVector::zero(this->getWidth())); + return (*this == wrappedBitVector::zero(getWidth())); } template @@ -110,101 +110,101 @@ template wrappedBitVector wrappedBitVector::operator<<( const wrappedBitVector& op) const { - return this->BitVector::leftShift(op); + return BitVector::leftShift(op); } template <> wrappedBitVector wrappedBitVector::operator>>( const wrappedBitVector& op) const { - return this->BitVector::arithRightShift(op); + return BitVector::arithRightShift(op); } template <> wrappedBitVector wrappedBitVector::operator>>( const wrappedBitVector& op) const { - return this->BitVector::logicalRightShift(op); + return BitVector::logicalRightShift(op); } template wrappedBitVector wrappedBitVector::operator|( const wrappedBitVector& op) const { - return this->BitVector::operator|(op); + return BitVector::operator|(op); } template wrappedBitVector wrappedBitVector::operator&( const wrappedBitVector& op) const { - return this->BitVector::operator&(op); + return BitVector::operator&(op); } template wrappedBitVector wrappedBitVector::operator+( const wrappedBitVector& op) const { - return this->BitVector::operator+(op); + return BitVector::operator+(op); } template wrappedBitVector wrappedBitVector::operator-( const wrappedBitVector& op) const { - return this->BitVector::operator-(op); + return BitVector::operator-(op); } template wrappedBitVector wrappedBitVector::operator*( const wrappedBitVector& op) const { - return this->BitVector::operator*(op); + return BitVector::operator*(op); } template <> wrappedBitVector wrappedBitVector::operator/( const wrappedBitVector& op) const { - return this->BitVector::unsignedDivTotal(op); + return BitVector::unsignedDivTotal(op); } template <> wrappedBitVector wrappedBitVector::operator%( const wrappedBitVector& op) const { - return this->BitVector::unsignedRemTotal(op); + return BitVector::unsignedRemTotal(op); } template wrappedBitVector wrappedBitVector::operator-(void) const { - return this->BitVector::operator-(); + return BitVector::operator-(); } template wrappedBitVector wrappedBitVector::operator~(void) const { - return this->BitVector::operator~(); + return BitVector::operator~(); } template wrappedBitVector wrappedBitVector::increment() const { - return *this + wrappedBitVector::one(this->getWidth()); + return *this + wrappedBitVector::one(getWidth()); } template wrappedBitVector wrappedBitVector::decrement() const { - return *this - wrappedBitVector::one(this->getWidth()); + return *this - wrappedBitVector::one(getWidth()); } template wrappedBitVector wrappedBitVector::signExtendRightShift( const wrappedBitVector& op) const { - return this->BitVector::arithRightShift(BitVector(this->getWidth(), op)); + return BitVector::arithRightShift(BitVector(getWidth(), op)); } /*** Modular opertaions ***/ @@ -226,13 +226,13 @@ wrappedBitVector wrappedBitVector::modularRightShift( template wrappedBitVector wrappedBitVector::modularIncrement() const { - return this->increment(); + return increment(); } template wrappedBitVector wrappedBitVector::modularDecrement() const { - return this->decrement(); + return decrement(); } template @@ -254,63 +254,63 @@ template CVC4Prop wrappedBitVector::operator==( const wrappedBitVector& op) const { - return this->BitVector::operator==(op); + return BitVector::operator==(op); } template <> CVC4Prop wrappedBitVector::operator<=( const wrappedBitVector& op) const { - return this->signedLessThanEq(op); + return signedLessThanEq(op); } template <> CVC4Prop wrappedBitVector::operator>=( const wrappedBitVector& op) const { - return !(this->signedLessThan(op)); + return !(signedLessThan(op)); } template <> CVC4Prop wrappedBitVector::operator<( const wrappedBitVector& op) const { - return this->signedLessThan(op); + return signedLessThan(op); } template <> CVC4Prop wrappedBitVector::operator>( const wrappedBitVector& op) const { - return !(this->signedLessThanEq(op)); + return !(signedLessThanEq(op)); } template <> CVC4Prop wrappedBitVector::operator<=( const wrappedBitVector& op) const { - return this->unsignedLessThanEq(op); + return unsignedLessThanEq(op); } template <> CVC4Prop wrappedBitVector::operator>=( const wrappedBitVector& op) const { - return !(this->unsignedLessThan(op)); + return !(unsignedLessThan(op)); } template <> CVC4Prop wrappedBitVector::operator<( const wrappedBitVector& op) const { - return this->unsignedLessThan(op); + return unsignedLessThan(op); } template <> CVC4Prop wrappedBitVector::operator>( const wrappedBitVector& op) const { - return !(this->unsignedLessThanEq(op)); + return !(unsignedLessThanEq(op)); } /*** Type conversion ***/ @@ -335,11 +335,11 @@ wrappedBitVector wrappedBitVector::extend( { if (isSigned) { - return this->BitVector::signExtend(extension); + return BitVector::signExtend(extension); } else { - return this->BitVector::zeroExtend(extension); + return BitVector::zeroExtend(extension); } } @@ -347,24 +347,24 @@ template wrappedBitVector wrappedBitVector::contract( CVC4BitWidth reduction) const { - Assert(this->getWidth() > reduction); + Assert(getWidth() > reduction); - return this->extract((this->getWidth() - 1) - reduction, 0); + return extract((getWidth() - 1) - reduction, 0); } template wrappedBitVector wrappedBitVector::resize( CVC4BitWidth newSize) const { - CVC4BitWidth width = this->getWidth(); + CVC4BitWidth width = getWidth(); if (newSize > width) { - return this->extend(newSize - width); + return extend(newSize - width); } else if (newSize < width) { - return this->contract(width - newSize); + return contract(width - newSize); } else { @@ -376,15 +376,15 @@ template wrappedBitVector wrappedBitVector::matchWidth( const wrappedBitVector& op) const { - Assert(this->getWidth() <= op.getWidth()); - return this->extend(op.getWidth() - this->getWidth()); + Assert(getWidth() <= op.getWidth()); + return extend(op.getWidth() - getWidth()); } template wrappedBitVector wrappedBitVector::append( const wrappedBitVector& op) const { - return this->BitVector::concat(op); + return BitVector::concat(op); } // Inclusive of end points, thus if the same, extracts just one bit @@ -393,7 +393,7 @@ wrappedBitVector wrappedBitVector::extract( CVC4BitWidth upper, CVC4BitWidth lower) const { Assert(upper >= lower); - return this->BitVector::extract(upper, lower); + return BitVector::extract(upper, lower); } // Explicit instantiation diff --git a/src/util/floatingpoint_literal_symfpu.h.in b/src/util/floatingpoint_literal_symfpu.h.in index 06a98b7ea..54156c7e7 100644 --- a/src/util/floatingpoint_literal_symfpu.h.in +++ b/src/util/floatingpoint_literal_symfpu.h.in @@ -236,25 +236,30 @@ class wrappedBitVector : public BitVector /** Bit-vector signed/unsigned (zero) extension. */ wrappedBitVector extend(CVC4BitWidth extension) const; + /** * Create a "contracted" bit-vector by cutting off the 'reduction' number of * most significant bits, i.e., by extracting the (bit-width - reduction) * least significant bits. */ wrappedBitVector contract(CVC4BitWidth reduction) const; + /** * Create a "resized" bit-vector of given size bei either extending (if new * size is larger) or contracting (if it is smaller) this wrapped bit-vector. */ wrappedBitVector resize(CVC4BitWidth newSize) const; + /** * Create an extension of this bit-vector that matches the bit-width of the * given bit-vector. + * * Note: The size of the given bit-vector may not be larger than the size of - * this bit-vector. + * this bit-vector. */ wrappedBitVector matchWidth( const wrappedBitVector& op) const; + /** Bit-vector concatenation. */ wrappedBitVector append(const wrappedBitVector& op) const; -- cgit v1.2.3