Home | History | Annotate | Download | only in ADT

Lines Matching refs: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
476 /// @param numBits the bitwidth of the result
492 /// @param numBits the bitwidth of the result
583 return APInt(BitWidth, 0) - (*this);
608 BitWidth = RHS.BitWidth;
621 BitWidth = that.BitWidth;
624 that.BitWidth = 0;
700 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
713 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
726 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
728 return APInt(BitWidth, VAL ^ RHS.VAL);
743 return (*this) + APInt(BitWidth, RHS);
750 return (*this) - APInt(BitWidth, RHS);
772 assert(shiftAmt <= BitWidth && "Invalid shift amount");
774 if (shiftAmt >= BitWidth)
775 return APInt(BitWidth, 0); // avoid undefined shift results
776 return APInt(BitWidth, VAL << shiftAmt);
866 assert(BitWidth == RHS.BitWidth && "Comparison requires equal bit widths");
1142 return BitWidth;
1145 /// Here one word's bitwidth equals to that of uint64_t.
1149 return getNumWords(BitWidth);
1152 /// Here one word's bitwidth equals to that of uint64_t.
1156 static unsigned getNumWords(unsigned BitWidth) {
1157 return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
1165 return BitWidth - countLeadingZeros();
1185 return BitWidth - countLeadingOnes() + 1;
1190 /// uint64_t. The bitwidth must be <= 64 or the value must fit within a
1206 return int64_t(VAL << (APINT_BITS_PER_WORD - BitWidth)) >>
1207 (APINT_BITS_PER_WORD - BitWidth);
1220 /// @returns BitWidth if the value is zero, otherwise
1225 unsigned unusedBits = APINT_BITS_PER_WORD - BitWidth;
1248 /// @returns BitWidth if the value is zero, otherwise
1257 /// @returns BitWidth if the value is all ones, otherwise
1379 return BitWidth - 1 - countLeadingZeros();
1384 return BitWidth - (*this - 1).countLeadingZeros();