• Home
  • Raw
  • Download

Lines Matching refs:APInt

76 void APInt::initSlowCase(unsigned numBits, uint64_t val, bool isSigned) {  in initSlowCase()
84 void APInt::initSlowCase(const APInt& that) { in initSlowCase()
89 void APInt::initFromArray(ArrayRef<uint64_t> bigVal) { in initFromArray()
106 APInt::APInt(unsigned numBits, ArrayRef<uint64_t> bigVal) in APInt() function in APInt
111 APInt::APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]) in APInt() function in APInt
116 APInt::APInt(unsigned numbits, StringRef Str, uint8_t radix) in APInt() function in APInt
122 APInt& APInt::AssignSlowCase(const APInt& RHS) { in AssignSlowCase()
154 APInt& APInt::operator=(uint64_t RHS) { in operator =()
165 void APInt::Profile(FoldingSetNodeID& ID) const { in Profile()
196 APInt& APInt::operator++() { in operator ++()
225 APInt& APInt::operator--() { in operator --()
251 APInt& APInt::operator+=(const APInt& RHS) { in operator +=()
278 APInt& APInt::operator-=(const APInt& RHS) { in operator -=()
355 APInt& APInt::operator*=(const APInt& RHS) { in operator *=()
397 APInt& APInt::operator&=(const APInt& RHS) { in operator &=()
409 APInt& APInt::operator|=(const APInt& RHS) { in operator |=()
421 APInt& APInt::operator^=(const APInt& RHS) { in operator ^=()
434 APInt APInt::AndSlowCase(const APInt& RHS) const { in AndSlowCase()
439 return APInt(val, getBitWidth()); in AndSlowCase()
442 APInt APInt::OrSlowCase(const APInt& RHS) const { in OrSlowCase()
447 return APInt(val, getBitWidth()); in OrSlowCase()
450 APInt APInt::XorSlowCase(const APInt& RHS) const { in XorSlowCase()
457 return APInt(val, getBitWidth()).clearUnusedBits(); in XorSlowCase()
460 APInt APInt::operator*(const APInt& RHS) const { in operator *()
463 return APInt(BitWidth, VAL * RHS.VAL); in operator *()
464 APInt Result(*this); in operator *()
469 APInt APInt::operator+(const APInt& RHS) const { in operator +()
472 return APInt(BitWidth, VAL + RHS.VAL); in operator +()
473 APInt Result(BitWidth, 0); in operator +()
478 APInt APInt::operator-(const APInt& RHS) const { in operator -()
481 return APInt(BitWidth, VAL - RHS.VAL); in operator -()
482 APInt Result(BitWidth, 0); in operator -()
487 bool APInt::EqualSlowCase(const APInt& RHS) const { in EqualSlowCase()
507 bool APInt::EqualSlowCase(uint64_t Val) const { in EqualSlowCase()
515 bool APInt::ult(const APInt& RHS) const { in ult()
547 bool APInt::slt(const APInt& RHS) const { in slt()
555 APInt lhs(*this); in slt()
556 APInt rhs(RHS); in slt()
583 void APInt::setBit(unsigned bitPosition) { in setBit()
592 void APInt::clearBit(unsigned bitPosition) { in clearBit()
604 void APInt::flipBit(unsigned bitPosition) { in flipBit()
610 unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) { in getBitsNeeded()
651 APInt tmp(sufficient, StringRef(p, slen), radix); in getBitsNeeded()
663 hash_code llvm::hash_value(const APInt &Arg) { in hash_value()
671 APInt APInt::getHiBits(unsigned numBits) const { in getHiBits()
676 APInt APInt::getLoBits(unsigned numBits) const { in getLoBits()
681 unsigned APInt::countLeadingZerosSlowCase() const { in countLeadingZerosSlowCase()
709 unsigned APInt::countLeadingOnes() const { in countLeadingOnes()
736 unsigned APInt::countTrailingZeros() const { in countTrailingZeros()
748 unsigned APInt::countTrailingOnesSlowCase() const { in countTrailingOnesSlowCase()
758 unsigned APInt::countPopulationSlowCase() const { in countPopulationSlowCase()
777 APInt APInt::byteSwap() const { in byteSwap()
780 return APInt(BitWidth, ByteSwap_16(uint16_t(VAL))); in byteSwap()
782 return APInt(BitWidth, ByteSwap_32(unsigned(VAL))); in byteSwap()
788 return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1); in byteSwap()
791 return APInt(BitWidth, ByteSwap_64(VAL)); in byteSwap()
793 APInt Result(getNumWords() * APINT_BITS_PER_WORD, 0); in byteSwap()
804 APInt llvm::APIntOps::GreatestCommonDivisor(const APInt& API1, in GreatestCommonDivisor()
805 const APInt& API2) { in GreatestCommonDivisor()
806 APInt A = API1, B = API2; in GreatestCommonDivisor()
808 APInt T = B; in GreatestCommonDivisor()
815 APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, unsigned width) { in RoundDoubleToAPInt()
830 return APInt(width, 0u); in RoundDoubleToAPInt()
837 return isNeg ? -APInt(width, mantissa >> (52 - exp)) : in RoundDoubleToAPInt()
838 APInt(width, mantissa >> (52 - exp)); in RoundDoubleToAPInt()
843 return APInt(width, 0); in RoundDoubleToAPInt()
846 APInt Tmp(width, mantissa); in RoundDoubleToAPInt()
858 double APInt::roundToDouble(bool isSigned) const { in roundToDouble()
874 APInt Tmp(isNeg ? -(*this) : (*this)); in roundToDouble()
919 APInt APInt::trunc(unsigned width) const { in trunc()
924 return APInt(width, getRawData()[0]); in trunc()
926 APInt Result(getMemory(getNumWords(width)), width); in trunc()
942 APInt APInt::sext(unsigned width) const { in sext()
948 return APInt(width, val >> (APINT_BITS_PER_WORD - width)); in sext()
951 APInt Result(getMemory(getNumWords(width)), width); in sext()
983 APInt APInt::zext(unsigned width) const { in zext()
987 return APInt(width, VAL); in zext()
989 APInt Result(getMemory(getNumWords(width)), width); in zext()
1002 APInt APInt::zextOrTrunc(unsigned width) const { in zextOrTrunc()
1010 APInt APInt::sextOrTrunc(unsigned width) const { in sextOrTrunc()
1018 APInt APInt::zextOrSelf(unsigned width) const { in zextOrSelf()
1024 APInt APInt::sextOrSelf(unsigned width) const { in sextOrSelf()
1032 APInt APInt::ashr(const APInt &shiftAmt) const { in ashr()
1038 APInt APInt::ashr(unsigned shiftAmt) const { in ashr()
1047 return APInt(BitWidth, 0); // undefined in ashr()
1050 return APInt(BitWidth, in ashr()
1060 return APInt(BitWidth, -1ULL, true); in ashr()
1062 return APInt(BitWidth, 0); in ashr()
1116 return APInt(val, BitWidth).clearUnusedBits(); in ashr()
1121 APInt APInt::lshr(const APInt &shiftAmt) const { in lshr()
1127 APInt APInt::lshr(unsigned shiftAmt) const { in lshr()
1130 return APInt(BitWidth, 0); in lshr()
1132 return APInt(BitWidth, this->VAL >> shiftAmt); in lshr()
1139 return APInt(BitWidth, 0); in lshr()
1153 return APInt(val, BitWidth).clearUnusedBits(); in lshr()
1166 return APInt(val,BitWidth).clearUnusedBits(); in lshr()
1180 return APInt(val, BitWidth).clearUnusedBits(); in lshr()
1185 APInt APInt::shl(const APInt &shiftAmt) const { in shl()
1190 APInt APInt::shlSlowCase(unsigned shiftAmt) const { in shlSlowCase()
1195 return APInt(BitWidth, 0); in shlSlowCase()
1213 return APInt(val, BitWidth).clearUnusedBits(); in shlSlowCase()
1226 return APInt(val,BitWidth).clearUnusedBits(); in shlSlowCase()
1237 return APInt(val, BitWidth).clearUnusedBits(); in shlSlowCase()
1240 APInt APInt::rotl(const APInt &rotateAmt) const { in rotl()
1244 APInt APInt::rotl(unsigned rotateAmt) const { in rotl()
1251 APInt APInt::rotr(const APInt &rotateAmt) const { in rotr()
1255 APInt APInt::rotr(unsigned rotateAmt) const { in rotr()
1269 APInt APInt::sqrt() const { in sqrt()
1286 return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]); in sqrt()
1295 return APInt(BitWidth, in sqrt()
1298 return APInt(BitWidth, in sqrt()
1309 APInt testy(BitWidth, 16); in sqrt()
1310 APInt x_old(BitWidth, 1); in sqrt()
1311 APInt x_new(BitWidth, 0); in sqrt()
1312 APInt two(BitWidth, 2); in sqrt()
1335 APInt square(x_old * x_old); in sqrt()
1336 APInt nextSquare((x_old + 1) * (x_old +1)); in sqrt()
1340 APInt midpoint((nextSquare - square).udiv(two)); in sqrt()
1341 APInt offset(*this - square); in sqrt()
1352 APInt APInt::multiplicativeInverse(const APInt& modulo) const { in multiplicativeInverse()
1363 APInt r[2] = { modulo, *this }; in multiplicativeInverse()
1364 APInt t[2] = { APInt(BitWidth, 0), APInt(BitWidth, 1) }; in multiplicativeInverse()
1365 APInt q(BitWidth, 0); in multiplicativeInverse()
1382 return APInt(BitWidth, 0); in multiplicativeInverse()
1395 APInt::ms APInt::magic() const { in magic()
1396 const APInt& d = *this; in magic()
1398 APInt ad, anc, delta, q1, r1, q2, r2, t; in magic()
1399 APInt signedMin = APInt::getSignedMinValue(d.getBitWidth()); in magic()
1439 APInt::mu APInt::magicu(unsigned LeadingZeros) const { in magicu()
1440 const APInt& d = *this; in magicu()
1442 APInt nc, delta, q1, r1, q2, r2; in magicu()
1445 APInt allOnes = APInt::getAllOnesValue(d.getBitWidth()).lshr(LeadingZeros); in magicu()
1446 APInt signedMin = APInt::getSignedMinValue(d.getBitWidth()); in magicu()
1447 APInt signedMax = APInt::getSignedMaxValue(d.getBitWidth()); in magicu()
1666 void APInt::divide(const APInt LHS, unsigned lhsWords, in divide()
1667 const APInt &RHS, unsigned rhsWords, in divide()
1668 APInt *Quotient, APInt *Remainder) in divide()
1842 APInt APInt::udiv(const APInt& RHS) const { in udiv()
1848 return APInt(BitWidth, VAL / RHS.VAL); in udiv()
1853 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in udiv()
1856 unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1); in udiv()
1861 return APInt(BitWidth, 0); in udiv()
1864 return APInt(BitWidth, 0); in udiv()
1867 return APInt(BitWidth, 1); in udiv()
1870 return APInt(BitWidth, this->pVal[0] / RHS.pVal[0]); in udiv()
1874 APInt Quotient(1,0); // to hold result. in udiv()
1879 APInt APInt::urem(const APInt& RHS) const { in urem()
1883 return APInt(BitWidth, VAL % RHS.VAL); in urem()
1892 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in urem()
1898 return APInt(BitWidth, 0); in urem()
1904 return APInt(BitWidth, 0); in urem()
1907 return APInt(BitWidth, pVal[0] % RHS.pVal[0]); in urem()
1911 APInt Remainder(1,0); in urem()
1916 void APInt::udivrem(const APInt &LHS, const APInt &RHS, in udivrem()
1917 APInt &Quotient, APInt &Remainder) { in udivrem()
1920 unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1); in udivrem()
1922 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in udivrem()
1947 Quotient = APInt(LHS.getBitWidth(), lhsValue / rhsValue); in udivrem()
1948 Remainder = APInt(LHS.getBitWidth(), lhsValue % rhsValue); in udivrem()
1956 APInt APInt::sadd_ov(const APInt &RHS, bool &Overflow) const { in sadd_ov()
1957 APInt Res = *this+RHS; in sadd_ov()
1963 APInt APInt::uadd_ov(const APInt &RHS, bool &Overflow) const { in uadd_ov()
1964 APInt Res = *this+RHS; in uadd_ov()
1969 APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) const { in ssub_ov()
1970 APInt Res = *this - RHS; in ssub_ov()
1976 APInt APInt::usub_ov(const APInt &RHS, bool &Overflow) const { in usub_ov()
1977 APInt Res = *this-RHS; in usub_ov()
1982 APInt APInt::sdiv_ov(const APInt &RHS, bool &Overflow) const { in sdiv_ov()
1988 APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) const { in smul_ov()
1989 APInt Res = *this * RHS; in smul_ov()
1998 APInt APInt::umul_ov(const APInt &RHS, bool &Overflow) const { in umul_ov()
1999 APInt Res = *this * RHS; in umul_ov()
2008 APInt APInt::sshl_ov(unsigned ShAmt, bool &Overflow) const { in sshl_ov()
2024 void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) { in fromString()
2054 APInt apdigit(getBitWidth(), 0); in fromString()
2055 APInt apradix(getBitWidth(), radix); in fromString()
2084 void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix, in toString()
2153 APInt Tmp(*this); in toString()
2186 APInt divisor(Radix == 10? 4 : 8, Radix); in toString()
2188 APInt APdigit(1, 0); in toString()
2189 APInt tmp2(Tmp.getBitWidth(), 0); in toString()
2206 std::string APInt::toString(unsigned Radix = 10, bool Signed = true) const { in toString()
2213 void APInt::dump() const { in dump()
2221 void APInt::print(raw_ostream &OS, bool isSigned) const { in print()
2316 APInt::tcSet(integerPart *dst, integerPart part, unsigned int parts) in tcSet()
2329 APInt::tcAssign(integerPart *dst, const integerPart *src, unsigned int parts) in tcAssign()
2339 APInt::tcIsZero(const integerPart *src, unsigned int parts) in tcIsZero()
2352 APInt::tcExtractBit(const integerPart *parts, unsigned int bit) in tcExtractBit()
2360 APInt::tcSetBit(integerPart *parts, unsigned int bit) in tcSetBit()
2367 APInt::tcClearBit(integerPart *parts, unsigned int bit) in tcClearBit()
2376 APInt::tcLSB(const integerPart *parts, unsigned int n) in tcLSB()
2394 APInt::tcMSB(const integerPart *parts, unsigned int n) in tcMSB()
2416 APInt::tcExtract(integerPart *dst, unsigned int dstCount,const integerPart *src, in tcExtract()
2450 APInt::tcAdd(integerPart *dst, const integerPart *rhs, in tcAdd()
2475 APInt::tcSubtract(integerPart *dst, const integerPart *rhs, in tcSubtract()
2500 APInt::tcNegate(integerPart *dst, unsigned int parts) in tcNegate()
2518 APInt::tcMultiplyPart(integerPart *dst, const integerPart *src, in tcMultiplyPart()
2611 APInt::tcMultiply(integerPart *dst, const integerPart *lhs, in tcMultiply()
2634 APInt::tcFullMultiply(integerPart *dst, const integerPart *lhs, in tcFullMultiply()
2668 APInt::tcDivide(integerPart *lhs, const integerPart *rhs, in tcDivide()
2715 APInt::tcShiftLeft(integerPart *dst, unsigned int parts, unsigned int count) in tcShiftLeft()
2749 APInt::tcShiftRight(integerPart *dst, unsigned int parts, unsigned int count) in tcShiftRight()
2781 APInt::tcAnd(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcAnd()
2791 APInt::tcOr(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcOr()
2801 APInt::tcXor(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcXor()
2811 APInt::tcComplement(integerPart *dst, unsigned int parts) in tcComplement()
2821 APInt::tcCompare(const integerPart *lhs, const integerPart *rhs, in tcCompare()
2840 APInt::tcIncrement(integerPart *dst, unsigned int parts) in tcIncrement()
2854 APInt::tcSetLeastSignificantBits(integerPart *dst, unsigned int parts, in tcSetLeastSignificantBits()