Lines Matching refs:BitWidth

74   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) {
287 APInt(APInt &&that) : BitWidth(that.BitWidth), VAL(that.VAL) {
288 that.BitWidth = 0;
302 explicit APInt() : BitWidth(1), VAL(0) {}
320 bool isNegative() const { return (*this)[BitWidth - 1]; }
340 return VAL == ~integerPart(0) >> (APINT_BITS_PER_WORD - BitWidth);
341 return countPopulationSlowCase() == BitWidth;
355 return !isNegative() && countPopulation() == BitWidth - 1;
447 static APInt getSignBit(unsigned BitWidth) {
448 return getSignedMinValue(BitWidth);
465 /// Get an APInt with the same BitWidth as this APInt, just zero mask
473 /// Get an APInt with the same BitWidth as this APInt, just zero mask
628 APInt operator-() const { return APInt(BitWidth, 0) - (*this); }
656 BitWidth = RHS.BitWidth;
680 unsigned ThatBitWidth = that.BitWidth;
681 that.BitWidth = 0;
682 BitWidth = ThatBitWidth;
776 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
791 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
813 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
815 return APInt(BitWidth, VAL ^ RHS.VAL);
838 APInt operator+(uint64_t RHS) const { return (*this) + APInt(BitWidth, RHS); }
844 APInt operator-(uint64_t RHS) const { return (*this) - APInt(BitWidth, RHS); }
870 assert(shiftAmt <= BitWidth && "Invalid shift amount");
872 if (shiftAmt >= BitWidth)
873 return APInt(BitWidth, 0); // avoid undefined shift results
874 return APInt(BitWidth, VAL << shiftAmt);
978 assert(BitWidth == RHS.BitWidth && "Comparison requires equal bit widths");
1274 unsigned getBitWidth() const { return BitWidth; }
1281 unsigned getNumWords() const { return getNumWords(BitWidth); }
1289 static unsigned getNumWords(unsigned BitWidth) {
1290 return ((uint64_t)BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
1298 unsigned getActiveBits() const { return BitWidth - countLeadingZeros(); }
1319 return BitWidth - countLeadingOnes() + 1;
1342 return int64_t(VAL << (APINT_BITS_PER_WORD - BitWidth)) >>
1343 (APINT_BITS_PER_WORD - BitWidth);
1360 /// \returns BitWidth if the value is zero, otherwise returns the number of
1364 unsigned unusedBits = APINT_BITS_PER_WORD - BitWidth;
1392 /// \returns BitWidth if the value is zero, otherwise returns the number of
1402 /// \returns BitWidth if the value is all ones, otherwise returns the number
1522 unsigned logBase2() const { return BitWidth - 1 - countLeadingZeros(); }
1526 return BitWidth - (*this - 1).countLeadingZeros();
1531 /// NOTE: When we have a BitWidth of 1, we define:
1542 if (BitWidth == 1)