reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

include/llvm/ADT/APInt.h
  108     U.pVal = val;
  154       U.VAL &= mask;
  156       U.pVal[getNumWords() - 1] &= mask;
  163     return isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)];
  163     return isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)];
  281       U.VAL = val;
  323       U.VAL = that.U.VAL;
  323       U.VAL = that.U.VAL;
  330     memcpy(&U, &that.U, sizeof(U));
  330     memcpy(&U, &that.U, sizeof(U));
  330     memcpy(&U, &that.U, sizeof(U));
  337       delete[] U.pVal;
  345   explicit APInt() : BitWidth(1) { U.VAL = 0; }
  397       return U.VAL == WORDTYPE_MAX >> (APINT_BITS_PER_WORD - BitWidth);
  412       return U.VAL == 1;
  428       return U.VAL == ((WordType(1) << (BitWidth - 1)) - 1);
  444       return U.VAL == (WordType(1) << (BitWidth - 1));
  465       return isPowerOf2_64(U.VAL);
  498       return U.VAL == (WORDTYPE_MAX >> (APINT_BITS_PER_WORD - numBits));
  509       return isMask_64(U.VAL);
  518       return isShiftedMask_64(U.VAL);
  676       return &U.VAL;
  677     return &U.pVal[0];
  723       return U.VAL == 0;
  737       U.VAL = RHS.U.VAL;
  737       U.VAL = RHS.U.VAL;
  755       delete[] U.pVal;
  759     memcpy(&U, &that.U, sizeof(U));
  759     memcpy(&U, &that.U, sizeof(U));
  759     memcpy(&U, &that.U, sizeof(U));
  776       U.VAL = RHS;
  779       U.pVal[0] = RHS;
  780       memset(U.pVal+1, 0, (getNumWords() - 1) * APINT_WORD_SIZE);
  794       U.VAL &= RHS.U.VAL;
  794       U.VAL &= RHS.U.VAL;
  807       U.VAL &= RHS;
  810     U.pVal[0] &= RHS;
  811     memset(U.pVal+1, 0, (getNumWords() - 1) * APINT_WORD_SIZE);
  824       U.VAL |= RHS.U.VAL;
  824       U.VAL |= RHS.U.VAL;
  837       U.VAL |= RHS;
  840       U.pVal[0] |= RHS;
  854       U.VAL ^= RHS.U.VAL;
  854       U.VAL ^= RHS.U.VAL;
  867       U.VAL ^= RHS;
  870       U.pVal[0] ^= RHS;
  908         U.VAL = 0;
  910         U.VAL <<= ShiftAmt;
  956       int64_t SExtVAL = SignExtend64(U.VAL, BitWidth);
  958         U.VAL = SExtVAL >> (APINT_BITS_PER_WORD - 1); // Fill with sign bit.
  960         U.VAL = SExtVAL >> ShiftAmt;
  981         U.VAL = 0;
  983         U.VAL >>= ShiftAmt;
 1136       return U.VAL == RHS.U.VAL;
 1136       return U.VAL == RHS.U.VAL;
 1327       return (U.VAL & RHS.U.VAL) != 0;
 1327       return (U.VAL & RHS.U.VAL) != 0;
 1335       return (U.VAL & ~RHS.U.VAL) == 0;
 1335       return (U.VAL & ~RHS.U.VAL) == 0;
 1395       U.VAL = WORDTYPE_MAX;
 1398       memset(U.pVal, -1, getNumWords() * APINT_WORD_SIZE);
 1410       U.VAL |= Mask;
 1412       U.pVal[whichWord(BitPosition)] |= Mask;
 1431         U.VAL |= mask;
 1433         U.pVal[0] |= mask;
 1457       U.VAL = 0;
 1459       memset(U.pVal, 0, getNumWords() * APINT_WORD_SIZE);
 1469       U.VAL &= Mask;
 1471       U.pVal[whichWord(BitPosition)] &= Mask;
 1489       U.VAL ^= WORDTYPE_MAX;
 1577       return U.VAL;
 1579     return U.pVal[0];
 1589       return SignExtend64(U.VAL, BitWidth);
 1591     return int64_t(U.pVal[0]);
 1611       return llvm::countLeadingZeros(U.VAL) - unusedBits;
 1626       return llvm::countLeadingOnes(U.VAL << (APINT_BITS_PER_WORD - BitWidth));
 1646       return std::min(unsigned(llvm::countTrailingZeros(U.VAL)), BitWidth);
 1660       return llvm::countTrailingOnes(U.VAL);
 1672       return llvm::countPopulation(U.VAL);
 1783       return U.VAL - 1;
lib/IR/LLVMContextImpl.h
   65     V.U.VAL = 0;
   71     V.U.VAL = 1;
lib/Support/APInt.cpp
   78   U.pVal = getClearedMemory(getNumWords());
   79   U.pVal[0] = val;
   82       U.pVal[i] = WORDTYPE_MAX;
   87   U.pVal = getMemory(getNumWords());
   88   memcpy(U.pVal, that.U.pVal, getNumWords() * APINT_WORD_SIZE);
   88   memcpy(U.pVal, that.U.pVal, getNumWords() * APINT_WORD_SIZE);
   95     U.VAL = bigVal[0];
   98     U.pVal = getClearedMemory(getNumWords());
  102     memcpy(U.pVal, bigVal.data(), words * APINT_WORD_SIZE);
  133     delete [] U.pVal;
  140     U.pVal = getMemory(getNumWords());
  153     U.VAL = RHS.U.VAL;
  153     U.VAL = RHS.U.VAL;
  155     memcpy(U.pVal, RHS.U.pVal, getNumWords() * APINT_WORD_SIZE);
  155     memcpy(U.pVal, RHS.U.pVal, getNumWords() * APINT_WORD_SIZE);
  163     ID.AddInteger(U.VAL);
  169     ID.AddInteger(U.pVal[i]);
  175     ++U.VAL;
  177     tcIncrement(U.pVal, getNumWords());
  184     --U.VAL;
  186     tcDecrement(U.pVal, getNumWords());
  196     U.VAL += RHS.U.VAL;
  196     U.VAL += RHS.U.VAL;
  198     tcAdd(U.pVal, RHS.U.pVal, 0, getNumWords());
  198     tcAdd(U.pVal, RHS.U.pVal, 0, getNumWords());
  204     U.VAL += RHS;
  206     tcAddPart(U.pVal, RHS, getNumWords());
  216     U.VAL -= RHS.U.VAL;
  216     U.VAL -= RHS.U.VAL;
  218     tcSubtract(U.pVal, RHS.U.pVal, 0, getNumWords());
  218     tcSubtract(U.pVal, RHS.U.pVal, 0, getNumWords());
  224     U.VAL -= RHS;
  226     tcSubtractPart(U.pVal, RHS, getNumWords());
  233     return APInt(BitWidth, U.VAL * RHS.U.VAL);
  233     return APInt(BitWidth, U.VAL * RHS.U.VAL);
  237   tcMultiply(Result.U.pVal, U.pVal, RHS.U.pVal, getNumWords());
  237   tcMultiply(Result.U.pVal, U.pVal, RHS.U.pVal, getNumWords());
  237   tcMultiply(Result.U.pVal, U.pVal, RHS.U.pVal, getNumWords());
  244   tcAnd(U.pVal, RHS.U.pVal, getNumWords());
  244   tcAnd(U.pVal, RHS.U.pVal, getNumWords());
  248   tcOr(U.pVal, RHS.U.pVal, getNumWords());
  248   tcOr(U.pVal, RHS.U.pVal, getNumWords());
  252   tcXor(U.pVal, RHS.U.pVal, getNumWords());
  252   tcXor(U.pVal, RHS.U.pVal, getNumWords());
  263     U.VAL *= RHS;
  266     tcMultiplyPart(U.pVal, U.pVal, RHS, 0, NumWords, NumWords, false);
  266     tcMultiplyPart(U.pVal, U.pVal, RHS, 0, NumWords, NumWords, false);
  272   return std::equal(U.pVal, U.pVal + getNumWords(), RHS.U.pVal);
  272   return std::equal(U.pVal, U.pVal + getNumWords(), RHS.U.pVal);
  272   return std::equal(U.pVal, U.pVal + getNumWords(), RHS.U.pVal);
  278     return U.VAL < RHS.U.VAL ? -1 : U.VAL > RHS.U.VAL;
  278     return U.VAL < RHS.U.VAL ? -1 : U.VAL > RHS.U.VAL;
  278     return U.VAL < RHS.U.VAL ? -1 : U.VAL > RHS.U.VAL;
  278     return U.VAL < RHS.U.VAL ? -1 : U.VAL > RHS.U.VAL;
  280   return tcCompare(U.pVal, RHS.U.pVal, getNumWords());
  280   return tcCompare(U.pVal, RHS.U.pVal, getNumWords());
  286     int64_t lhsSext = SignExtend64(U.VAL, BitWidth);
  287     int64_t rhsSext = SignExtend64(RHS.U.VAL, BitWidth);
  300   return tcCompare(U.pVal, RHS.U.pVal, getNumWords());
  300   return tcCompare(U.pVal, RHS.U.pVal, getNumWords());
  320       U.pVal[hiWord] |= hiMask;
  323   U.pVal[loWord] |= loMask;
  327     U.pVal[word] = WORDTYPE_MAX;
  332   tcComplement(U.pVal, getNumWords());
  359     U.VAL &= ~(mask << bitPosition);
  360     U.VAL |= (subBits.U.VAL << bitPosition);
  360     U.VAL |= (subBits.U.VAL << bitPosition);
  371     U.pVal[loWord] &= ~(mask << loBit);
  372     U.pVal[loWord] |= (subBits.U.VAL << loBit);
  372     U.pVal[loWord] |= (subBits.U.VAL << loBit);
  380     memcpy(U.pVal + loWord, subBits.getRawData(),
  387       U.pVal[hi1Word] &= ~mask;
  388       U.pVal[hi1Word] |= subBits.getWord(subBitWidth - 1);
  408     U.VAL &= ~(maskBits << bitPosition);
  409     U.VAL |= subBits << bitPosition;
  417     U.pVal[loWord] &= ~(maskBits << loBit);
  418     U.pVal[loWord] |= subBits << loBit;
  424   U.pVal[loWord] &= ~(maskBits << loBit);
  425   U.pVal[loWord] |= subBits << loBit;
  427   U.pVal[hiWord] &= ~(maskBits >> (wordBits - loBit));
  428   U.pVal[hiWord] |= subBits >> (wordBits - loBit);
  437     return APInt(numBits, U.VAL >> bitPosition);
  445     return APInt(numBits, U.pVal[loWord] >> loBit);
  450     return APInt(numBits, makeArrayRef(U.pVal + loWord, 1 + hiWord - loWord));
  457   uint64_t *DestPtr = Result.isSingleWord() ? &Result.U.VAL : Result.U.pVal;
  457   uint64_t *DestPtr = Result.isSingleWord() ? &Result.U.VAL : Result.U.pVal;
  459     uint64_t w0 = U.pVal[loWord + word];
  461         (loWord + word + 1) < NumSrcWords ? U.pVal[loWord + word + 1] : 0;
  477     return (U.VAL >> bitPosition) & maskBits;
  483     return (U.pVal[loWord] >> loBit) & maskBits;
  487   uint64_t retBits = U.pVal[loWord] >> loBit;
  488   retBits |= U.pVal[hiWord] << (wordBits - loBit);
  551     return hash_combine(Arg.U.VAL);
  553   return hash_combine_range(Arg.U.pVal, Arg.U.pVal + Arg.getNumWords());
  553   return hash_combine_range(Arg.U.pVal, Arg.U.pVal + Arg.getNumWords());
  590     uint64_t V = U.pVal[i];
  614   unsigned Count = llvm::countLeadingOnes(U.pVal[i] << shift);
  617       if (U.pVal[i] == WORDTYPE_MAX)
  620         Count += llvm::countLeadingOnes(U.pVal[i]);
  631   for (; i < getNumWords() && U.pVal[i] == 0; ++i)
  634     Count += llvm::countTrailingZeros(U.pVal[i]);
  641   for (; i < getNumWords() && U.pVal[i] == WORDTYPE_MAX; ++i)
  644     Count += llvm::countTrailingOnes(U.pVal[i]);
  652     Count += llvm::countPopulation(U.pVal[i]);
  658     if ((U.pVal[i] & RHS.U.pVal[i]) != 0)
  658     if ((U.pVal[i] & RHS.U.pVal[i]) != 0)
  666     if ((U.pVal[i] & ~RHS.U.pVal[i]) != 0)
  666     if ((U.pVal[i] & ~RHS.U.pVal[i]) != 0)
  675     return APInt(BitWidth, ByteSwap_16(uint16_t(U.VAL)));
  677     return APInt(BitWidth, ByteSwap_32(unsigned(U.VAL)));
  679     unsigned Tmp1 = unsigned(U.VAL >> 16);
  681     uint16_t Tmp2 = uint16_t(U.VAL);
  686     return APInt(BitWidth, ByteSwap_64(U.VAL));
  690     Result.U.pVal[I] = ByteSwap_64(U.pVal[N - I - 1]);
  690     Result.U.pVal[I] = ByteSwap_64(U.pVal[N - I - 1]);
  701     return APInt(BitWidth, llvm::reverseBits<uint64_t>(U.VAL));
  703     return APInt(BitWidth, llvm::reverseBits<uint32_t>(U.VAL));
  705     return APInt(BitWidth, llvm::reverseBits<uint16_t>(U.VAL));
  707     return APInt(BitWidth, llvm::reverseBits<uint8_t>(U.VAL));
  848     mantissa = Tmp.U.pVal[0];
  853     uint64_t hibits = Tmp.U.pVal[hiWord] << (52 - n % APINT_BITS_PER_WORD);
  854     uint64_t lobits = Tmp.U.pVal[hiWord-1] >> (11 + n % APINT_BITS_PER_WORD);
  877     Result.U.pVal[i] = U.pVal[i];
  877     Result.U.pVal[i] = U.pVal[i];
  882     Result.U.pVal[i] = U.pVal[i] << bits >> bits;
  882     Result.U.pVal[i] = U.pVal[i] << bits >> bits;
  892     return APInt(Width, SignExtend64(U.VAL, BitWidth));
  897   std::memcpy(Result.U.pVal, getRawData(), getNumWords() * APINT_WORD_SIZE);
  900   Result.U.pVal[getNumWords() - 1] =
  901       SignExtend64(Result.U.pVal[getNumWords() - 1],
  905   std::memset(Result.U.pVal + getNumWords(), isNegative() ? -1 : 0,
  916     return APInt(width, U.VAL);
  921   std::memcpy(Result.U.pVal, getRawData(), getNumWords() * APINT_WORD_SIZE);
  924   std::memset(Result.U.pVal + getNumWords(), 0,
  981     U.pVal[getNumWords() - 1] = SignExtend64(
  982         U.pVal[getNumWords() - 1], ((BitWidth - 1) % APINT_BITS_PER_WORD) + 1);
  986       std::memmove(U.pVal, U.pVal + WordShift, WordsToMove * APINT_WORD_SIZE);
  986       std::memmove(U.pVal, U.pVal + WordShift, WordsToMove * APINT_WORD_SIZE);
  990         U.pVal[i] = (U.pVal[i + WordShift] >> BitShift) |
  990         U.pVal[i] = (U.pVal[i + WordShift] >> BitShift) |
  991                     (U.pVal[i + WordShift + 1] << (APINT_BITS_PER_WORD - BitShift));
  994       U.pVal[WordsToMove - 1] = U.pVal[WordShift + WordsToMove - 1] >> BitShift;
  994       U.pVal[WordsToMove - 1] = U.pVal[WordShift + WordsToMove - 1] >> BitShift;
  996       U.pVal[WordsToMove - 1] =
  997           SignExtend64(U.pVal[WordsToMove - 1], APINT_BITS_PER_WORD - BitShift);
 1002   std::memset(U.pVal + WordsToMove, Negative ? -1 : 0,
 1016   tcShiftRight(U.pVal, getNumWords(), ShiftAmt);
 1028   tcShiftLeft(U.pVal, getNumWords(), ShiftAmt);
 1091     return APInt(BitWidth, results[ (isSingleWord() ? U.VAL : U.pVal[0]) ]);
 1091     return APInt(BitWidth, results[ (isSingleWord() ? U.VAL : U.pVal[0]) ]);
 1100                  uint64_t(::round(::sqrt(double(isSingleWord() ? U.VAL
 1101                                                                : U.pVal[0])))));
 1581     assert(RHS.U.VAL != 0 && "Divide by zero?");
 1582     return APInt(BitWidth, U.VAL / RHS.U.VAL);
 1582     return APInt(BitWidth, U.VAL / RHS.U.VAL);
 1606     return APInt(BitWidth, this->U.pVal[0] / RHS.U.pVal[0]);
 1606     return APInt(BitWidth, this->U.pVal[0] / RHS.U.pVal[0]);
 1610   divide(U.pVal, lhsWords, RHS.U.pVal, rhsWords, Quotient.U.pVal, nullptr);
 1610   divide(U.pVal, lhsWords, RHS.U.pVal, rhsWords, Quotient.U.pVal, nullptr);
 1610   divide(U.pVal, lhsWords, RHS.U.pVal, rhsWords, Quotient.U.pVal, nullptr);
 1619     return APInt(BitWidth, U.VAL / RHS);
 1639     return APInt(BitWidth, this->U.pVal[0] / RHS);
 1643   divide(U.pVal, lhsWords, &RHS, 1, Quotient.U.pVal, nullptr);
 1643   divide(U.pVal, lhsWords, &RHS, 1, Quotient.U.pVal, nullptr);
 1672     assert(RHS.U.VAL != 0 && "Remainder by zero?");
 1673     return APInt(BitWidth, U.VAL % RHS.U.VAL);
 1673     return APInt(BitWidth, U.VAL % RHS.U.VAL);
 1699     return APInt(BitWidth, U.pVal[0] % RHS.U.pVal[0]);
 1699     return APInt(BitWidth, U.pVal[0] % RHS.U.pVal[0]);
 1703   divide(U.pVal, lhsWords, RHS.U.pVal, rhsWords, nullptr, Remainder.U.pVal);
 1703   divide(U.pVal, lhsWords, RHS.U.pVal, rhsWords, nullptr, Remainder.U.pVal);
 1703   divide(U.pVal, lhsWords, RHS.U.pVal, rhsWords, nullptr, Remainder.U.pVal);
 1711     return U.VAL % RHS;
 1731     return U.pVal[0] % RHS;
 1735   divide(U.pVal, lhsWords, &RHS, 1, nullptr, &Remainder);
 1768     assert(RHS.U.VAL != 0 && "Divide by zero?");
 1769     uint64_t QuotVal = LHS.U.VAL / RHS.U.VAL;
 1769     uint64_t QuotVal = LHS.U.VAL / RHS.U.VAL;
 1770     uint64_t RemVal = LHS.U.VAL % RHS.U.VAL;
 1770     uint64_t RemVal = LHS.U.VAL % RHS.U.VAL;
 1815     uint64_t lhsValue = LHS.U.pVal[0];
 1816     uint64_t rhsValue = RHS.U.pVal[0];
 1823   divide(LHS.U.pVal, lhsWords, RHS.U.pVal, rhsWords, Quotient.U.pVal,
 1823   divide(LHS.U.pVal, lhsWords, RHS.U.pVal, rhsWords, Quotient.U.pVal,
 1823   divide(LHS.U.pVal, lhsWords, RHS.U.pVal, rhsWords, Quotient.U.pVal,
 1824          Remainder.U.pVal);
 1826   std::memset(Quotient.U.pVal + lhsWords, 0,
 1828   std::memset(Remainder.U.pVal + rhsWords, 0,
 1839     uint64_t QuotVal = LHS.U.VAL / RHS;
 1840     Remainder = LHS.U.VAL % RHS;
 1880     uint64_t lhsValue = LHS.U.pVal[0];
 1887   divide(LHS.U.pVal, lhsWords, &RHS, 1, Quotient.U.pVal, &Remainder);
 1887   divide(LHS.U.pVal, lhsWords, &RHS, 1, Quotient.U.pVal, &Remainder);
 1889   std::memset(Quotient.U.pVal + lhsWords, 0,
 2115     U.VAL = 0;
 2117     U.pVal = getClearedMemory(getNumWords());