Lines Matching refs:U
77 U.pVal = getClearedMemory(getNumWords()); in initSlowCase()
78 U.pVal[0] = val; in initSlowCase()
81 U.pVal[i] = WORDTYPE_MAX; in initSlowCase()
86 U.pVal = getMemory(getNumWords()); in initSlowCase()
87 memcpy(U.pVal, that.U.pVal, getNumWords() * APINT_WORD_SIZE); in initSlowCase()
93 U.VAL = bigVal[0]; in initFromArray()
96 U.pVal = getClearedMemory(getNumWords()); in initFromArray()
100 memcpy(U.pVal, bigVal.data(), words * APINT_WORD_SIZE); in initFromArray()
129 delete [] U.pVal; in reallocate()
136 U.pVal = getMemory(getNumWords()); in reallocate()
149 U.VAL = RHS.U.VAL; in assignSlowCase()
151 memcpy(U.pVal, RHS.U.pVal, getNumWords() * APINT_WORD_SIZE); in assignSlowCase()
159 ID.AddInteger(U.VAL); in Profile()
165 ID.AddInteger(U.pVal[i]); in Profile()
179 ++U.VAL; in operator ++()
181 tcIncrement(U.pVal, getNumWords()); in operator ++()
188 --U.VAL; in operator --()
190 tcDecrement(U.pVal, getNumWords()); in operator --()
200 U.VAL += RHS.U.VAL; in operator +=()
202 tcAdd(U.pVal, RHS.U.pVal, 0, getNumWords()); in operator +=()
208 U.VAL += RHS; in operator +=()
210 tcAddPart(U.pVal, RHS, getNumWords()); in operator +=()
220 U.VAL -= RHS.U.VAL; in operator -=()
222 tcSubtract(U.pVal, RHS.U.pVal, 0, getNumWords()); in operator -=()
228 U.VAL -= RHS; in operator -=()
230 tcSubtractPart(U.pVal, RHS, getNumWords()); in operator -=()
237 return APInt(BitWidth, U.VAL * RHS.U.VAL); in operator *()
240 tcMultiply(Result.U.pVal, U.pVal, RHS.U.pVal, getNumWords()); in operator *()
246 WordType *dst = U.pVal, *rhs = RHS.U.pVal; in andAssignSlowCase()
252 WordType *dst = U.pVal, *rhs = RHS.U.pVal; in orAssignSlowCase()
258 WordType *dst = U.pVal, *rhs = RHS.U.pVal; in xorAssignSlowCase()
270 U.VAL *= RHS; in operator *=()
273 tcMultiplyPart(U.pVal, U.pVal, RHS, 0, NumWords, NumWords, false); in operator *=()
279 return std::equal(U.pVal, U.pVal + getNumWords(), RHS.U.pVal); in equalSlowCase()
285 return U.VAL < RHS.U.VAL ? -1 : U.VAL > RHS.U.VAL; in compare()
287 return tcCompare(U.pVal, RHS.U.pVal, getNumWords()); in compare()
293 int64_t lhsSext = SignExtend64(U.VAL, BitWidth); in compareSigned()
294 int64_t rhsSext = SignExtend64(RHS.U.VAL, BitWidth); in compareSigned()
307 return tcCompare(U.pVal, RHS.U.pVal, getNumWords()); in compareSigned()
327 U.pVal[hiWord] |= hiMask; in setBitsSlowCase()
330 U.pVal[loWord] |= loMask; in setBitsSlowCase()
334 U.pVal[word] = WORDTYPE_MAX; in setBitsSlowCase()
345 tcComplement(U.pVal, getNumWords()); in flipAllBitsSlowCase()
385 U.VAL &= ~(mask << bitPosition); in insertBits()
386 U.VAL |= (subBits.U.VAL << bitPosition); in insertBits()
397 U.pVal[loWord] &= ~(mask << loBit); in insertBits()
398 U.pVal[loWord] |= (subBits.U.VAL << loBit); in insertBits()
406 memcpy(U.pVal + loWord, subBits.getRawData(), in insertBits()
413 U.pVal[hi1Word] &= ~mask; in insertBits()
414 U.pVal[hi1Word] |= subBits.getWord(subBitWidth - 1); in insertBits()
430 U.VAL &= ~(maskBits << bitPosition); in insertBits()
431 U.VAL |= subBits << bitPosition; in insertBits()
439 U.pVal[loWord] &= ~(maskBits << loBit); in insertBits()
440 U.pVal[loWord] |= subBits << loBit; in insertBits()
446 U.pVal[loWord] &= ~(maskBits << loBit); in insertBits()
447 U.pVal[loWord] |= subBits << loBit; in insertBits()
449 U.pVal[hiWord] &= ~(maskBits >> (wordBits - loBit)); in insertBits()
450 U.pVal[hiWord] |= subBits >> (wordBits - loBit); in insertBits()
458 return APInt(numBits, U.VAL >> bitPosition); in extractBits()
466 return APInt(numBits, U.pVal[loWord] >> loBit); in extractBits()
471 return APInt(numBits, ArrayRef(U.pVal + loWord, 1 + hiWord - loWord)); in extractBits()
478 uint64_t *DestPtr = Result.isSingleWord() ? &Result.U.VAL : Result.U.pVal; in extractBits()
480 uint64_t w0 = U.pVal[loWord + word]; in extractBits()
482 (loWord + word + 1) < NumSrcWords ? U.pVal[loWord + word + 1] : 0; in extractBits()
497 return (U.VAL >> bitPosition) & maskBits; in extractBitsAsZExtValue()
503 return (U.pVal[loWord] >> loBit) & maskBits; in extractBitsAsZExtValue()
507 uint64_t retBits = U.pVal[loWord] >> loBit; in extractBitsAsZExtValue()
508 retBits |= U.pVal[hiWord] << (wordBits - loBit); in extractBitsAsZExtValue()
588 return hash_combine(Arg.BitWidth, Arg.U.VAL); in hash_value()
592 hash_combine_range(Arg.U.pVal, Arg.U.pVal + Arg.getNumWords())); in hash_value()
633 uint64_t V = U.pVal[i]; in countLeadingZerosSlowCase()
657 unsigned Count = llvm::countl_one(U.pVal[i] << shift); in countLeadingOnesSlowCase()
660 if (U.pVal[i] == WORDTYPE_MAX) in countLeadingOnesSlowCase()
663 Count += llvm::countl_one(U.pVal[i]); in countLeadingOnesSlowCase()
674 for (; i < getNumWords() && U.pVal[i] == 0; ++i) in countTrailingZerosSlowCase()
677 Count += llvm::countr_zero(U.pVal[i]); in countTrailingZerosSlowCase()
684 for (; i < getNumWords() && U.pVal[i] == WORDTYPE_MAX; ++i) in countTrailingOnesSlowCase()
687 Count += llvm::countr_one(U.pVal[i]); in countTrailingOnesSlowCase()
695 Count += llvm::popcount(U.pVal[i]); in countPopulationSlowCase()
701 if ((U.pVal[i] & RHS.U.pVal[i]) != 0) in intersectsSlowCase()
709 if ((U.pVal[i] & ~RHS.U.pVal[i]) != 0) in isSubsetOfSlowCase()
718 return APInt(BitWidth, llvm::byteswap<uint16_t>(U.VAL)); in byteSwap()
720 return APInt(BitWidth, llvm::byteswap<uint32_t>(U.VAL)); in byteSwap()
722 uint64_t Tmp1 = llvm::byteswap<uint64_t>(U.VAL); in byteSwap()
729 Result.U.pVal[I] = llvm::byteswap<uint64_t>(U.pVal[N - I - 1]); in byteSwap()
740 return APInt(BitWidth, llvm::reverseBits<uint64_t>(U.VAL)); in reverseBits()
742 return APInt(BitWidth, llvm::reverseBits<uint32_t>(U.VAL)); in reverseBits()
744 return APInt(BitWidth, llvm::reverseBits<uint16_t>(U.VAL)); in reverseBits()
746 return APInt(BitWidth, llvm::reverseBits<uint8_t>(U.VAL)); in reverseBits()
889 mantissa = Tmp.U.pVal[0]; in roundToDouble()
894 uint64_t hibits = Tmp.U.pVal[hiWord] << (52 - n % APINT_BITS_PER_WORD); in roundToDouble()
895 uint64_t lobits = Tmp.U.pVal[hiWord-1] >> (11 + n % APINT_BITS_PER_WORD); in roundToDouble()
920 Result.U.pVal[i] = U.pVal[i]; in trunc()
925 Result.U.pVal[i] = U.pVal[i] << bits >> bits; in trunc()
958 return APInt(Width, SignExtend64(U.VAL, BitWidth)); in sext()
966 std::memcpy(Result.U.pVal, getRawData(), getNumWords() * APINT_WORD_SIZE); in sext()
969 Result.U.pVal[getNumWords() - 1] = in sext()
970 SignExtend64(Result.U.pVal[getNumWords() - 1], in sext()
974 std::memset(Result.U.pVal + getNumWords(), isNegative() ? -1 : 0, in sext()
985 return APInt(width, U.VAL); in zext()
993 std::memcpy(Result.U.pVal, getRawData(), getNumWords() * APINT_WORD_SIZE); in zext()
996 std::memset(Result.U.pVal + getNumWords(), 0, in zext()
1041 U.pVal[getNumWords() - 1] = SignExtend64( in ashrSlowCase()
1042 U.pVal[getNumWords() - 1], ((BitWidth - 1) % APINT_BITS_PER_WORD) + 1); in ashrSlowCase()
1046 std::memmove(U.pVal, U.pVal + WordShift, WordsToMove * APINT_WORD_SIZE); in ashrSlowCase()
1050 U.pVal[i] = (U.pVal[i + WordShift] >> BitShift) | in ashrSlowCase()
1051 (U.pVal[i + WordShift + 1] << (APINT_BITS_PER_WORD - BitShift)); in ashrSlowCase()
1054 U.pVal[WordsToMove - 1] = U.pVal[WordShift + WordsToMove - 1] >> BitShift; in ashrSlowCase()
1056 U.pVal[WordsToMove - 1] = in ashrSlowCase()
1057 SignExtend64(U.pVal[WordsToMove - 1], APINT_BITS_PER_WORD - BitShift); in ashrSlowCase()
1062 std::memset(U.pVal + WordsToMove, Negative ? -1 : 0, in ashrSlowCase()
1076 tcShiftRight(U.pVal, getNumWords(), ShiftAmt); in lshrSlowCase()
1088 tcShiftLeft(U.pVal, getNumWords(), ShiftAmt); in shlSlowCase()
1147 return U.VAL - 1; in nearestLogBase2()
1186 return APInt(BitWidth, results[ (isSingleWord() ? U.VAL : U.pVal[0]) ]); in sqrt()
1195 uint64_t(::round(::sqrt(double(isSingleWord() ? U.VAL in sqrt()
1196 : U.pVal[0]))))); in sqrt()
1437 uint32_t *U = nullptr; in divide() local
1442 U = &SPACE[0]; in divide()
1448 U = new uint32_t[m + n + 1]; in divide()
1456 memset(U, 0, (m+n+1)*sizeof(uint32_t)); in divide()
1459 U[i * 2] = Lo_32(tmp); in divide()
1460 U[i * 2 + 1] = Hi_32(tmp); in divide()
1462 U[m+n] = 0; // this extra word is for "spill" in the Knuth algorithm. in divide()
1485 for (unsigned i = m+n; i > 0 && U[i-1] == 0; i--) in divide()
1499 uint64_t partial_dividend = Make_64(remainder, U[i]); in divide()
1519 KnuthDiv(U, V, Q, R, m, n); in divide()
1535 if (U != &SPACE[0]) { in divide()
1536 delete [] U; in divide()
1548 assert(RHS.U.VAL != 0 && "Divide by zero?"); in udiv()
1549 return APInt(BitWidth, U.VAL / RHS.U.VAL); in udiv()
1573 return APInt(BitWidth, this->U.pVal[0] / RHS.U.pVal[0]); in udiv()
1577 divide(U.pVal, lhsWords, RHS.U.pVal, rhsWords, Quotient.U.pVal, nullptr); in udiv()
1586 return APInt(BitWidth, U.VAL / RHS); in udiv()
1606 return APInt(BitWidth, this->U.pVal[0] / RHS); in udiv()
1610 divide(U.pVal, lhsWords, &RHS, 1, Quotient.U.pVal, nullptr); in udiv()
1639 assert(RHS.U.VAL != 0 && "Remainder by zero?"); in urem()
1640 return APInt(BitWidth, U.VAL % RHS.U.VAL); in urem()
1666 return APInt(BitWidth, U.pVal[0] % RHS.U.pVal[0]); in urem()
1670 divide(U.pVal, lhsWords, RHS.U.pVal, rhsWords, nullptr, Remainder.U.pVal); in urem()
1678 return U.VAL % RHS; in urem()
1698 return U.pVal[0] % RHS; in urem()
1702 divide(U.pVal, lhsWords, &RHS, 1, nullptr, &Remainder); in urem()
1735 assert(RHS.U.VAL != 0 && "Divide by zero?"); in udivrem()
1736 uint64_t QuotVal = LHS.U.VAL / RHS.U.VAL; in udivrem()
1737 uint64_t RemVal = LHS.U.VAL % RHS.U.VAL; in udivrem()
1782 uint64_t lhsValue = LHS.U.pVal[0]; in udivrem()
1783 uint64_t rhsValue = RHS.U.pVal[0]; in udivrem()
1790 divide(LHS.U.pVal, lhsWords, RHS.U.pVal, rhsWords, Quotient.U.pVal, in udivrem()
1791 Remainder.U.pVal); in udivrem()
1793 std::memset(Quotient.U.pVal + lhsWords, 0, in udivrem()
1795 std::memset(Remainder.U.pVal + rhsWords, 0, in udivrem()
1806 uint64_t QuotVal = LHS.U.VAL / RHS; in udivrem()
1807 Remainder = LHS.U.VAL % RHS; in udivrem()
1847 uint64_t lhsValue = LHS.U.pVal[0]; in udivrem()
1854 divide(LHS.U.pVal, lhsWords, &RHS, 1, Quotient.U.pVal, &Remainder); in udivrem()
1856 std::memset(Quotient.U.pVal + lhsWords, 0, in udivrem()
2106 U.VAL = 0; in fromString()
2108 U.pVal = getClearedMemory(getNumWords()); in fromString()
2269 SmallString<40> S, U; in dump() local
2270 this->toStringUnsigned(U); in dump()
2273 << U << "u " << S << "s)\n"; in dump()