Lines Matching refs:BitWidth

76   unsigned BitWidth; ///< The number of bits in this APInt.
98 APInt(uint64_t *val, unsigned bits) : BitWidth(bits), pVal(val) {}
103 bool isSingleWord() const { return BitWidth <= APINT_BITS_PER_WORD; }
138 unsigned wordBits = BitWidth % APINT_BITS_PER_WORD;
237 : BitWidth(numBits), VAL(0) {
238 assert(BitWidth && "bitwidth too small");
279 APInt(const APInt &that) : BitWidth(that.BitWidth), VAL(0) {
280 assert(BitWidth && "bitwidth too small");
288 APInt(APInt &&that) : BitWidth(that.BitWidth), VAL(that.VAL) {
289 that.BitWidth = 0;
302 explicit APInt() : BitWidth(1) {}
320 bool isNegative() const { return (*this)[BitWidth - 1]; }
340 return VAL == ~integerPart(0) >> (APINT_BITS_PER_WORD - BitWidth);
341 return countPopulationSlowCase() == BitWidth;
355 return BitWidth == 1 ? VAL == 0
356 : !isNegative() && countPopulation() == BitWidth - 1;
370 return BitWidth == 1 ? VAL == 1 : isNegative() && isPowerOf2();
441 static APInt getSignBit(unsigned BitWidth) {
442 return getSignedMinValue(BitWidth);
459 /// Get an APInt with the same BitWidth as this APInt, just zero mask
467 /// Get an APInt with the same BitWidth as this APInt, just zero mask
622 APInt operator-() const { return APInt(BitWidth, 0) - (*this); }
650 BitWidth = RHS.BitWidth;
662 BitWidth = that.BitWidth;
665 that.BitWidth = 0;
759 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
774 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
796 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
798 return APInt(BitWidth, VAL ^ RHS.VAL);
821 APInt operator+(uint64_t RHS) const { return (*this) + APInt(BitWidth, RHS); }
827 APInt operator-(uint64_t RHS) const { return (*this) - APInt(BitWidth, RHS); }
853 assert(shiftAmt <= BitWidth && "Invalid shift amount");
855 if (shiftAmt >= BitWidth)
856 return APInt(BitWidth, 0); // avoid undefined shift results
857 return APInt(BitWidth, VAL << shiftAmt);
960 assert(BitWidth == RHS.BitWidth && "Comparison requires equal bit widths");
1248 unsigned getBitWidth() const { return BitWidth; }
1255 unsigned getNumWords() const { return getNumWords(BitWidth); }
1263 static unsigned getNumWords(unsigned BitWidth) {
1264 return ((uint64_t)BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
1272 unsigned getActiveBits() const { return BitWidth - countLeadingZeros(); }
1293 return BitWidth - countLeadingOnes() + 1;
1316 return int64_t(VAL << (APINT_BITS_PER_WORD - BitWidth)) >>
1317 (APINT_BITS_PER_WORD - BitWidth);
1334 /// \returns BitWidth if the value is zero, otherwise returns the number of
1338 unsigned unusedBits = APINT_BITS_PER_WORD - BitWidth;
1366 /// \returns BitWidth if the value is zero, otherwise returns the number of
1376 /// \returns BitWidth if the value is all ones, otherwise returns the number
1496 unsigned logBase2() const { return BitWidth - 1 - countLeadingZeros(); }
1500 return BitWidth - (*this - 1).countLeadingZeros();
1505 /// NOTE: When we have a BitWidth of 1, we define:
1516 if (BitWidth == 1)