• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/llvmCore-3425.0.34/include/llvm/ADT/

Lines Matching defs:numBits

168   void fromString(unsigned numBits, StringRef str, uint8_t radix);
180 void initSlowCase(unsigned numBits, uint64_t val, bool isSigned);
225 /// @param numBits the bit width of the constructed APInt
228 /// @brief Create a new APInt of numBits width, initialized as val.
229 APInt(unsigned numBits, uint64_t val, bool isSigned = false)
230 : BitWidth(numBits), VAL(0) {
235 initSlowCase(numBits, val, isSigned);
241 /// @param numBits the bit width of the constructed APInt
243 /// @brief Construct an APInt of numBits width, initialized as bigVal[].
244 APInt(unsigned numBits, ArrayRef<uint64_t> bigVal);
245 /// Equivalent to APInt(numBits, ArrayRef<uint64_t>(bigVal, numWords)), but
252 APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
258 /// string to require more bits than numBits.
260 /// @param numBits the bit width of the constructed APInt
264 APInt(unsigned numBits, StringRef str, uint8_t radix);
397 static APInt getMaxValue(unsigned numBits) {
398 return getAllOnesValue(numBits);
402 static APInt getSignedMaxValue(unsigned numBits) {
403 APInt API = getAllOnesValue(numBits);
404 API.clearBit(numBits - 1);
409 static APInt getMinValue(unsigned numBits) {
410 return APInt(numBits, 0);
414 static APInt getSignedMinValue(unsigned numBits) {
415 APInt API(numBits, 0);
416 API.setBit(numBits - 1);
429 static APInt getAllOnesValue(unsigned numBits) {
430 return APInt(numBits, -1ULL, true);
435 static APInt getNullValue(unsigned numBits) {
436 return APInt(numBits, 0);
441 /// @returns the high "numBits" bits of this APInt.
442 APInt getHiBits(unsigned numBits) const;
446 /// @returns the low "numBits" bits of this APInt.
447 APInt getLoBits(unsigned numBits) const;
450 static APInt getOneBitSet(unsigned numBits, unsigned BitNo) {
451 APInt Res(numBits, 0);
461 /// @param numBits the intended bit width of the result
466 static APInt getBitsSet(unsigned numBits, unsigned loBit, unsigned hiBit) {
467 assert(hiBit <= numBits && "hiBit out of range");
468 assert(loBit < numBits && "loBit out of range");
470 return getLowBitsSet(numBits, hiBit) |
471 getHighBitsSet(numBits, numBits-loBit);
472 return getLowBitsSet(numBits, hiBit-loBit).shl(loBit);
476 /// @param numBits the bitwidth of the result
479 static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet) {
480 assert(hiBitsSet <= numBits && "Too many bits to set!");
483 return APInt(numBits, 0);
484 unsigned shiftAmt = numBits - hiBitsSet;
486 if (numBits <= APINT_BITS_PER_WORD)
487 return APInt(numBits, ~0ULL << shiftAmt);
488 return getAllOnesValue(numBits).shl(shiftAmt);
492 /// @param numBits the bitwidth of the result
495 static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet) {
496 assert(loBitsSet <= numBits && "Too many bits to set!");
499 return APInt(numBits, 0);
501 return APInt(numBits, -1ULL);
504 return APInt(numBits, -1ULL >> (APINT_BITS_PER_WORD - loBitsSet));
505 return getAllOnesValue(numBits).lshr(numBits - loBitsSet);
1636 inline bool isMask(unsigned numBits, const APInt& APIVal) {
1637 return numBits <= APIVal.getBitWidth() &&
1638 APIVal == APInt::getLowBitsSet(APIVal.getBitWidth(), numBits);
1643 inline bool isShiftedMask(unsigned numBits, const APInt& APIVal) {
1644 return isMask(numBits, (APIVal - APInt(numBits,1)) | APIVal);