Lines Matching refs:BitWidth

109       : BitWidth(numBits) {  in BitWidth()  function
150 explicit APInt() : BitWidth(1) { U.VAL = 0; } in APInt()
153 APInt(const APInt &that) : BitWidth(that.BitWidth) { in APInt()
161 APInt(APInt &&that) : BitWidth(that.BitWidth) { in APInt()
163 that.BitWidth = 0; in APInt()
209 static APInt getSignMask(unsigned BitWidth) { in getSignMask() argument
210 return getSignedMinValue(BitWidth); in getSignMask()
305 bool isSingleWord() const { return BitWidth <= APINT_BITS_PER_WORD; } in isSingleWord()
312 bool isNegative() const { return (*this)[BitWidth - 1]; } in isNegative()
324 bool isSignBitSet() const { return (*this)[BitWidth - 1]; } in isSignBitSet()
348 if (BitWidth == 0) in isAllOnes()
351 return U.VAL == WORDTYPE_MAX >> (APINT_BITS_PER_WORD - BitWidth); in isAllOnes()
352 return countTrailingOnesSlowCase() == BitWidth; in isAllOnes()
362 return countLeadingZerosSlowCase() == BitWidth; in isZero()
374 return countLeadingZerosSlowCase() == BitWidth - 1; in isOne()
392 assert(BitWidth && "zero width values not allowed"); in isMaxSignedValue()
393 return U.VAL == ((WordType(1) << (BitWidth - 1)) - 1); in isMaxSignedValue()
395 return !isNegative() && countTrailingOnesSlowCase() == BitWidth - 1; in isMaxSignedValue()
410 assert(BitWidth && "zero width values not allowed"); in isMinSignedValue()
411 return U.VAL == (WordType(1) << (BitWidth - 1)); in isMinSignedValue()
413 return isNegative() && countTrailingZerosSlowCase() == BitWidth - 1; in isMinSignedValue()
427 assert(BitWidth && "zero width values not allowed"); in isPowerOf2()
460 assert(numBits <= BitWidth && "numBits out of range"); in isMask()
465 ((Ones + countLeadingZerosSlowCase()) == BitWidth); in isMask()
475 return (Ones > 0) && ((Ones + countLeadingZerosSlowCase()) == BitWidth); in isMask()
485 return (Ones + LeadZ + countTrailingZeros()) == BitWidth; in isShiftedMask()
576 BitWidth = RHS.BitWidth;
599 BitWidth = that.BitWidth;
600 that.BitWidth = 0;
628 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
658 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
687 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
739 assert(ShiftAmt <= BitWidth && "Invalid shift amount");
741 if (ShiftAmt == BitWidth)
788 assert(ShiftAmt <= BitWidth && "Invalid shift amount"); in ashrInPlace()
790 int64_t SExtVAL = SignExtend64(U.VAL, BitWidth); in ashrInPlace()
791 if (ShiftAmt == BitWidth) in ashrInPlace()
812 assert(ShiftAmt <= BitWidth && "Invalid shift amount"); in lshrInPlace()
814 if (ShiftAmt == BitWidth) in lshrInPlace()
979 assert(BitWidth == RHS.BitWidth && "Comparison requires equal bit widths");
1170 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in intersects()
1178 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in isSubsetOf()
1269 assert(BitPosition < BitWidth && "BitPosition out of range"); in setBit()
1278 void setSignBit() { setBit(BitWidth - 1); } in setSignBit()
1293 assert(hiBit <= BitWidth && "hiBit out of range"); in setBitsWithWrap()
1294 assert(loBit <= BitWidth && "loBit out of range"); in setBitsWithWrap()
1300 setHighBits(BitWidth - loBit); in setBitsWithWrap()
1306 assert(hiBit <= BitWidth && "hiBit out of range"); in setBits()
1307 assert(loBit <= BitWidth && "loBit out of range"); in setBits()
1324 void setBitsFrom(unsigned loBit) { return setBits(loBit, BitWidth); } in setBitsFrom()
1331 return setBits(BitWidth - hiBits, BitWidth); in setHighBits()
1346 assert(BitPosition < BitWidth && "BitPosition out of range"); in clearBit()
1356 assert(loBits <= BitWidth && "More bits than bitwidth"); in clearLowBits()
1357 APInt Keep = getHighBitsSet(BitWidth, BitWidth - loBits); in clearLowBits()
1362 void clearSignBit() { clearBit(BitWidth - 1); } in clearSignBit()
1399 unsigned getBitWidth() const { return BitWidth; } in getBitWidth()
1406 unsigned getNumWords() const { return getNumWords(BitWidth); } in getNumWords()
1414 static unsigned getNumWords(unsigned BitWidth) { in getNumWords() argument
1415 return ((uint64_t)BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD; in getNumWords()
1423 unsigned getActiveBits() const { return BitWidth - countLeadingZeros(); } in getActiveBits()
1442 unsigned getMinSignedBits() const { return BitWidth - getNumSignBits() + 1; } in getMinSignedBits()
1451 assert(BitWidth && "zero width values not allowed"); in getZExtValue()
1465 return SignExtend64(U.VAL, BitWidth); in getSExtValue()
1486 unsigned unusedBits = APINT_BITS_PER_WORD - BitWidth; in countLeadingZeros()
1502 if (LLVM_UNLIKELY(BitWidth == 0)) in countLeadingOnes()
1504 return llvm::countLeadingOnes(U.VAL << (APINT_BITS_PER_WORD - BitWidth)); in countLeadingOnes()
1526 return (TrailingZeros > BitWidth ? BitWidth : TrailingZeros); in countTrailingZeros()
1807 unsigned BitWidth; ///< The number of bits in this APInt. variable
1815 APInt(uint64_t *val, unsigned bits) : BitWidth(bits) { U.pVal = val; }
1847 unsigned WordBits = ((BitWidth - 1) % APINT_BITS_PER_WORD) + 1;
1851 if (LLVM_UNLIKELY(BitWidth == 0))