Lines Matching refs:numBits
168 void fromString(unsigned numBits, StringRef str, uint8_t radix);
180 void initSlowCase(unsigned numBits, uint64_t val, bool isSigned);
229 APInt(unsigned numBits, uint64_t val, bool isSigned = false)
230 : BitWidth(numBits), VAL(0) { in BitWidth() argument
235 initSlowCase(numBits, val, isSigned); in BitWidth()
244 APInt(unsigned numBits, ArrayRef<uint64_t> bigVal);
252 APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
264 APInt(unsigned numBits, StringRef str, uint8_t radix);
397 static APInt getMaxValue(unsigned numBits) { in getMaxValue() argument
398 return getAllOnesValue(numBits); in getMaxValue()
402 static APInt getSignedMaxValue(unsigned numBits) { in getSignedMaxValue() argument
403 APInt API = getAllOnesValue(numBits); in getSignedMaxValue()
404 API.clearBit(numBits - 1); in getSignedMaxValue()
409 static APInt getMinValue(unsigned numBits) { in getMinValue() argument
410 return APInt(numBits, 0); in getMinValue()
414 static APInt getSignedMinValue(unsigned numBits) { in getSignedMinValue() argument
415 APInt API(numBits, 0); in getSignedMinValue()
416 API.setBit(numBits - 1); in getSignedMinValue()
429 static APInt getAllOnesValue(unsigned numBits) { in getAllOnesValue() argument
430 return APInt(numBits, UINT64_MAX, true); in getAllOnesValue()
435 static APInt getNullValue(unsigned numBits) { in getNullValue() argument
436 return APInt(numBits, 0); in getNullValue()
442 APInt getHiBits(unsigned numBits) const;
447 APInt getLoBits(unsigned numBits) const;
450 static APInt getOneBitSet(unsigned numBits, unsigned BitNo) { in getOneBitSet() argument
451 APInt Res(numBits, 0); in getOneBitSet()
466 static APInt getBitsSet(unsigned numBits, unsigned loBit, unsigned hiBit) { in getBitsSet() argument
467 assert(hiBit <= numBits && "hiBit out of range"); in getBitsSet()
468 assert(loBit < numBits && "loBit out of range"); in getBitsSet()
470 return getLowBitsSet(numBits, hiBit) | in getBitsSet()
471 getHighBitsSet(numBits, numBits-loBit); in getBitsSet()
472 return getLowBitsSet(numBits, hiBit-loBit).shl(loBit); in getBitsSet()
479 static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet) { in getHighBitsSet() argument
480 assert(hiBitsSet <= numBits && "Too many bits to set!"); in getHighBitsSet()
483 return APInt(numBits, 0); in getHighBitsSet()
484 unsigned shiftAmt = numBits - hiBitsSet; in getHighBitsSet()
486 if (numBits <= APINT_BITS_PER_WORD) in getHighBitsSet()
487 return APInt(numBits, ~0ULL << shiftAmt); in getHighBitsSet()
488 return getAllOnesValue(numBits).shl(shiftAmt); in getHighBitsSet()
495 static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet) { in getLowBitsSet() argument
496 assert(loBitsSet <= numBits && "Too many bits to set!"); in getLowBitsSet()
499 return APInt(numBits, 0); in getLowBitsSet()
501 return APInt(numBits, UINT64_MAX); in getLowBitsSet()
504 return APInt(numBits, UINT64_MAX >> (APINT_BITS_PER_WORD - loBitsSet)); in getLowBitsSet()
505 return getAllOnesValue(numBits).lshr(numBits - loBitsSet); in getLowBitsSet()
1615 inline bool isMask(unsigned numBits, const APInt& APIVal) { in isMask() argument
1616 return numBits <= APIVal.getBitWidth() && in isMask()
1617 APIVal == APInt::getLowBitsSet(APIVal.getBitWidth(), numBits); in isMask()
1622 inline bool isShiftedMask(unsigned numBits, const APInt& APIVal) { in isShiftedMask() argument
1623 return isMask(numBits, (APIVal - APInt(numBits,1)) | APIVal); in isShiftedMask()