Lines Matching defs:BitWidth

76   unsigned BitWidth;      ///< The number of bits in this APInt.
97 APInt(uint64_t* val, unsigned bits) : BitWidth(bits), pVal(val) { }
102 return BitWidth <= APINT_BITS_PER_WORD;
134 unsigned wordBits = BitWidth % APINT_BITS_PER_WORD;
230 : BitWidth(numBits), VAL(0) {
231 assert(BitWidth && "bitwidth too small");
269 : BitWidth(that.BitWidth), VAL(0) {
270 assert(BitWidth && "bitwidth too small");
279 APInt(APInt&& that) : BitWidth(that.BitWidth), VAL(that.VAL) {
280 that.BitWidth = 0;
292 explicit APInt() : BitWidth(1) {}
305 return (*this)[BitWidth - 1];
325 return countPopulation() == BitWidth;
332 return countPopulation() == BitWidth;
339 return BitWidth == 1 ? VAL == 0 :
340 !isNegative() && countPopulation() == BitWidth - 1;
354 return BitWidth == 1 ? VAL == 1 : isNegative() && isPowerOf2();
423 static APInt getSignBit(unsigned BitWidth) {
424 return getSignedMinValue(BitWidth);
439 /// Get an APInt with the same BitWidth as this APInt, just zero mask
444 /// Get an APInt with the same BitWidth as this APInt, just zero mask
572 return APInt(BitWidth, 0) - (*this);
597 BitWidth = RHS.BitWidth;
610 BitWidth = that.BitWidth;
613 that.BitWidth = 0;
689 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
702 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
715 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
717 return APInt(BitWidth, VAL ^ RHS.VAL);
732 return (*this) + APInt(BitWidth, RHS);
739 return (*this) - APInt(BitWidth, RHS);
761 assert(shiftAmt <= BitWidth && "Invalid shift amount");
763 if (shiftAmt == BitWidth)
764 return APInt(BitWidth, 0); // avoid undefined shift results
765 return APInt(BitWidth, VAL << shiftAmt);
888 assert(BitWidth == RHS.BitWidth && "Comparison requires equal bit widths");
1164 return BitWidth;
1171 return getNumWords(BitWidth);
1178 static unsigned getNumWords(unsigned BitWidth) {
1179 return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
1187 return BitWidth - countLeadingZeros();
1206 return BitWidth - countLeadingOnes() + 1;
1227 return int64_t(VAL << (APINT_BITS_PER_WORD - BitWidth)) >>
1228 (APINT_BITS_PER_WORD - BitWidth);
1241 /// @returns BitWidth if the value is zero, otherwise
1246 unsigned unusedBits = APINT_BITS_PER_WORD - BitWidth;
1269 /// @returns BitWidth if the value is zero, otherwise
1278 /// @returns BitWidth if the value is all ones, otherwise
1400 return BitWidth - 1 - countLeadingZeros();
1405 return BitWidth - (*this - 1).countLeadingZeros();