Lines Matching refs:APInt
78 void APInt::initSlowCase(uint64_t val, bool isSigned) { in initSlowCase()
86 void APInt::initSlowCase(const APInt& that) { in initSlowCase()
91 void APInt::initFromArray(ArrayRef<uint64_t> bigVal) { in initFromArray()
108 APInt::APInt(unsigned numBits, ArrayRef<uint64_t> bigVal) in APInt() function in APInt
113 APInt::APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]) in APInt() function in APInt
118 APInt::APInt(unsigned numbits, StringRef Str, uint8_t radix) in APInt() function in APInt
124 APInt& APInt::AssignSlowCase(const APInt& RHS) { in AssignSlowCase()
156 APInt& APInt::operator=(uint64_t RHS) { in operator =()
167 void APInt::Profile(FoldingSetNodeID& ID) const { in Profile()
198 APInt& APInt::operator++() { in operator ++()
227 APInt& APInt::operator--() { in operator --()
253 APInt& APInt::operator+=(const APInt& RHS) { in operator +=()
280 APInt& APInt::operator-=(const APInt& RHS) { in operator -=()
357 APInt& APInt::operator*=(const APInt& RHS) { in operator *=()
399 APInt& APInt::operator&=(const APInt& RHS) { in operator &=()
411 APInt& APInt::operator|=(const APInt& RHS) { in operator |=()
423 APInt& APInt::operator^=(const APInt& RHS) { in operator ^=()
436 APInt APInt::AndSlowCase(const APInt& RHS) const { in AndSlowCase()
441 return APInt(val, getBitWidth()); in AndSlowCase()
444 APInt APInt::OrSlowCase(const APInt& RHS) const { in OrSlowCase()
449 return APInt(val, getBitWidth()); in OrSlowCase()
452 APInt APInt::XorSlowCase(const APInt& RHS) const { in XorSlowCase()
458 APInt Result(val, getBitWidth()); in XorSlowCase()
464 APInt APInt::operator*(const APInt& RHS) const { in operator *()
467 return APInt(BitWidth, VAL * RHS.VAL); in operator *()
468 APInt Result(*this); in operator *()
473 APInt APInt::operator+(const APInt& RHS) const { in operator +()
476 return APInt(BitWidth, VAL + RHS.VAL); in operator +()
477 APInt Result(BitWidth, 0); in operator +()
483 APInt APInt::operator+(uint64_t RHS) const { in operator +()
485 return APInt(BitWidth, VAL + RHS); in operator +()
486 APInt Result(*this); in operator +()
492 APInt APInt::operator-(const APInt& RHS) const { in operator -()
495 return APInt(BitWidth, VAL - RHS.VAL); in operator -()
496 APInt Result(BitWidth, 0); in operator -()
502 APInt APInt::operator-(uint64_t RHS) const { in operator -()
504 return APInt(BitWidth, VAL - RHS); in operator -()
505 APInt Result(*this); in operator -()
511 bool APInt::EqualSlowCase(const APInt& RHS) const { in EqualSlowCase()
515 bool APInt::EqualSlowCase(uint64_t Val) const { in EqualSlowCase()
523 bool APInt::ult(const APInt& RHS) const { in ult()
555 bool APInt::slt(const APInt& RHS) const { in slt()
575 void APInt::setBit(unsigned bitPosition) { in setBit()
584 void APInt::clearBit(unsigned bitPosition) { in clearBit()
596 void APInt::flipBit(unsigned bitPosition) { in flipBit()
602 unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) { in getBitsNeeded()
643 APInt tmp(sufficient, StringRef(p, slen), radix); in getBitsNeeded()
655 hash_code llvm::hash_value(const APInt &Arg) { in hash_value()
662 bool APInt::isSplat(unsigned SplatSizeInBits) const { in isSplat()
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()
698 unsigned APInt::countLeadingOnes() const { in countLeadingOnes()
725 unsigned APInt::countTrailingZeros() const { in countTrailingZeros()
737 unsigned APInt::countTrailingOnesSlowCase() const { in countTrailingOnesSlowCase()
747 unsigned APInt::countPopulationSlowCase() const { in countPopulationSlowCase()
766 APInt APInt::byteSwap() const { in byteSwap()
769 return APInt(BitWidth, ByteSwap_16(uint16_t(VAL))); in byteSwap()
771 return APInt(BitWidth, ByteSwap_32(unsigned(VAL))); in byteSwap()
777 return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1); in byteSwap()
780 return APInt(BitWidth, ByteSwap_64(VAL)); in byteSwap()
782 APInt Result(getNumWords() * APINT_BITS_PER_WORD, 0); in byteSwap()
793 APInt APInt::reverseBits() const { in reverseBits()
796 return APInt(BitWidth, llvm::reverseBits<uint64_t>(VAL)); in reverseBits()
798 return APInt(BitWidth, llvm::reverseBits<uint32_t>(VAL)); in reverseBits()
800 return APInt(BitWidth, llvm::reverseBits<uint16_t>(VAL)); in reverseBits()
802 return APInt(BitWidth, llvm::reverseBits<uint8_t>(VAL)); in reverseBits()
807 APInt Val(*this); in reverseBits()
808 APInt Reversed(*this); in reverseBits()
811 const APInt One(BitWidth, 1); in reverseBits()
823 APInt llvm::APIntOps::GreatestCommonDivisor(const APInt& API1, in GreatestCommonDivisor()
824 const APInt& API2) { in GreatestCommonDivisor()
825 APInt A = API1, B = API2; in GreatestCommonDivisor()
827 APInt T = B; in GreatestCommonDivisor()
834 APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, unsigned width) { in RoundDoubleToAPInt()
849 return APInt(width, 0u); in RoundDoubleToAPInt()
856 return isNeg ? -APInt(width, mantissa >> (52 - exp)) : in RoundDoubleToAPInt()
857 APInt(width, mantissa >> (52 - exp)); in RoundDoubleToAPInt()
862 return APInt(width, 0); in RoundDoubleToAPInt()
865 APInt Tmp(width, mantissa); in RoundDoubleToAPInt()
877 double APInt::roundToDouble(bool isSigned) const { in roundToDouble()
893 APInt Tmp(isNeg ? -(*this) : (*this)); in roundToDouble()
938 APInt APInt::trunc(unsigned width) const { in trunc()
943 return APInt(width, getRawData()[0]); in trunc()
945 APInt Result(getMemory(getNumWords(width)), width); in trunc()
961 APInt APInt::sext(unsigned width) const { in sext()
967 return APInt(width, val >> (APINT_BITS_PER_WORD - width)); in sext()
970 APInt Result(getMemory(getNumWords(width)), width); in sext()
1002 APInt APInt::zext(unsigned width) const { in zext()
1006 return APInt(width, VAL); in zext()
1008 APInt Result(getMemory(getNumWords(width)), width); in zext()
1021 APInt APInt::zextOrTrunc(unsigned width) const { in zextOrTrunc()
1029 APInt APInt::sextOrTrunc(unsigned width) const { in sextOrTrunc()
1037 APInt APInt::zextOrSelf(unsigned width) const { in zextOrSelf()
1043 APInt APInt::sextOrSelf(unsigned width) const { in sextOrSelf()
1051 APInt APInt::ashr(const APInt &shiftAmt) const { in ashr()
1057 APInt APInt::ashr(unsigned shiftAmt) const { in ashr()
1066 return APInt(BitWidth, 0); // undefined in ashr()
1069 return APInt(BitWidth, in ashr()
1079 return APInt(BitWidth, -1ULL, true); in ashr()
1081 return APInt(BitWidth, 0); in ashr()
1135 APInt Result(val, BitWidth); in ashr()
1142 APInt APInt::lshr(const APInt &shiftAmt) const { in lshr()
1148 APInt APInt::lshr(unsigned shiftAmt) const { in lshr()
1151 return APInt(BitWidth, 0); in lshr()
1153 return APInt(BitWidth, this->VAL >> shiftAmt); in lshr()
1160 return APInt(BitWidth, 0); in lshr()
1174 APInt Result(val, BitWidth); in lshr()
1189 APInt Result(val, BitWidth); in lshr()
1205 APInt Result(val, BitWidth); in lshr()
1212 APInt APInt::shl(const APInt &shiftAmt) const { in shl()
1217 APInt APInt::shlSlowCase(unsigned shiftAmt) const { in shlSlowCase()
1222 return APInt(BitWidth, 0); in shlSlowCase()
1240 APInt Result(val, BitWidth); in shlSlowCase()
1255 APInt Result(val, BitWidth); in shlSlowCase()
1268 APInt Result(val, BitWidth); in shlSlowCase()
1273 APInt APInt::rotl(const APInt &rotateAmt) const { in rotl()
1277 APInt APInt::rotl(unsigned rotateAmt) const { in rotl()
1284 APInt APInt::rotr(const APInt &rotateAmt) const { in rotr()
1288 APInt APInt::rotr(unsigned rotateAmt) const { in rotr()
1302 APInt APInt::sqrt() const { in sqrt()
1319 return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]); in sqrt()
1327 return APInt(BitWidth, in sqrt()
1337 APInt testy(BitWidth, 16); in sqrt()
1338 APInt x_old(BitWidth, 1); in sqrt()
1339 APInt x_new(BitWidth, 0); in sqrt()
1340 APInt two(BitWidth, 2); in sqrt()
1363 APInt square(x_old * x_old); in sqrt()
1364 APInt nextSquare((x_old + 1) * (x_old +1)); in sqrt()
1368 APInt midpoint((nextSquare - square).udiv(two)); in sqrt()
1369 APInt offset(*this - square); in sqrt()
1380 APInt APInt::multiplicativeInverse(const APInt& modulo) const { in multiplicativeInverse()
1391 APInt r[2] = { modulo, *this }; in multiplicativeInverse()
1392 APInt t[2] = { APInt(BitWidth, 0), APInt(BitWidth, 1) }; in multiplicativeInverse()
1393 APInt q(BitWidth, 0); in multiplicativeInverse()
1410 return APInt(BitWidth, 0); in multiplicativeInverse()
1423 APInt::ms APInt::magic() const { in magic()
1424 const APInt& d = *this; in magic()
1426 APInt ad, anc, delta, q1, r1, q2, r2, t; in magic()
1427 APInt signedMin = APInt::getSignedMinValue(d.getBitWidth()); in magic()
1467 APInt::mu APInt::magicu(unsigned LeadingZeros) const { in magicu()
1468 const APInt& d = *this; in magicu()
1470 APInt nc, delta, q1, r1, q2, r2; in magicu()
1473 APInt allOnes = APInt::getAllOnesValue(d.getBitWidth()).lshr(LeadingZeros); in magicu()
1474 APInt signedMin = APInt::getSignedMinValue(d.getBitWidth()); in magicu()
1475 APInt signedMax = APInt::getSignedMaxValue(d.getBitWidth()); in magicu()
1667 void APInt::divide(const APInt &LHS, unsigned lhsWords, const APInt &RHS, in divide()
1668 unsigned rhsWords, APInt *Quotient, APInt *Remainder) { in divide()
1843 APInt APInt::udiv(const APInt& RHS) const { in udiv()
1849 return APInt(BitWidth, VAL / RHS.VAL); in udiv()
1854 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in udiv()
1857 unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1); in udiv()
1862 return APInt(BitWidth, 0); in udiv()
1865 return APInt(BitWidth, 0); in udiv()
1868 return APInt(BitWidth, 1); in udiv()
1871 return APInt(BitWidth, this->pVal[0] / RHS.pVal[0]); in udiv()
1875 APInt Quotient(1,0); // to hold result. in udiv()
1880 APInt APInt::sdiv(const APInt &RHS) const { in sdiv()
1891 APInt APInt::urem(const APInt& RHS) const { in urem()
1895 return APInt(BitWidth, VAL % RHS.VAL); in urem()
1904 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in urem()
1910 return APInt(BitWidth, 0); in urem()
1916 return APInt(BitWidth, 0); in urem()
1919 return APInt(BitWidth, pVal[0] % RHS.pVal[0]); in urem()
1923 APInt Remainder(1,0); in urem()
1928 APInt APInt::srem(const APInt &RHS) const { in srem()
1939 void APInt::udivrem(const APInt &LHS, const APInt &RHS, in udivrem()
1940 APInt &Quotient, APInt &Remainder) { in udivrem()
1948 Quotient = APInt(LHS.BitWidth, QuotVal); in udivrem()
1949 Remainder = APInt(LHS.BitWidth, RemVal); in udivrem()
1955 unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1); in udivrem()
1957 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in udivrem()
1982 Quotient = APInt(LHS.getBitWidth(), lhsValue / rhsValue); in udivrem()
1983 Remainder = APInt(LHS.getBitWidth(), lhsValue % rhsValue); in udivrem()
1991 void APInt::sdivrem(const APInt &LHS, const APInt &RHS, in sdivrem()
1992 APInt &Quotient, APInt &Remainder) { in sdivrem()
1995 APInt::udivrem(-LHS, -RHS, Quotient, Remainder); in sdivrem()
1997 APInt::udivrem(-LHS, RHS, Quotient, Remainder); in sdivrem()
2002 APInt::udivrem(LHS, -RHS, Quotient, Remainder); in sdivrem()
2005 APInt::udivrem(LHS, RHS, Quotient, Remainder); in sdivrem()
2009 APInt APInt::sadd_ov(const APInt &RHS, bool &Overflow) const { in sadd_ov()
2010 APInt Res = *this+RHS; in sadd_ov()
2016 APInt APInt::uadd_ov(const APInt &RHS, bool &Overflow) const { in uadd_ov()
2017 APInt Res = *this+RHS; in uadd_ov()
2022 APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) const { in ssub_ov()
2023 APInt Res = *this - RHS; in ssub_ov()
2029 APInt APInt::usub_ov(const APInt &RHS, bool &Overflow) const { in usub_ov()
2030 APInt Res = *this-RHS; in usub_ov()
2035 APInt APInt::sdiv_ov(const APInt &RHS, bool &Overflow) const { in sdiv_ov()
2041 APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) const { in smul_ov()
2042 APInt Res = *this * RHS; in smul_ov()
2051 APInt APInt::umul_ov(const APInt &RHS, bool &Overflow) const { in umul_ov()
2052 APInt Res = *this * RHS; in umul_ov()
2061 APInt APInt::sshl_ov(const APInt &ShAmt, bool &Overflow) const { in sshl_ov()
2064 return APInt(BitWidth, 0); in sshl_ov()
2074 APInt APInt::ushl_ov(const APInt &ShAmt, bool &Overflow) const { in ushl_ov()
2077 return APInt(BitWidth, 0); in ushl_ov()
2087 void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) { in fromString()
2117 APInt apdigit(getBitWidth(), 0); in fromString()
2118 APInt apradix(getBitWidth(), radix); in fromString()
2147 void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix, in toString()
2216 APInt Tmp(*this); in toString()
2249 APInt divisor(Radix == 10? 4 : 8, Radix); in toString()
2251 APInt APdigit(1, 0); in toString()
2252 APInt tmp2(Tmp.getBitWidth(), 0); in toString()
2268 std::string APInt::toString(unsigned Radix = 10, bool Signed = true) const { in toString()
2275 LLVM_DUMP_METHOD void APInt::dump() const { in dump()
2283 void APInt::print(raw_ostream &OS, bool isSigned) const { in print()
2343 APInt::tcSet(integerPart *dst, integerPart part, unsigned int parts) in tcSet()
2356 APInt::tcAssign(integerPart *dst, const integerPart *src, unsigned int parts) in tcAssign()
2366 APInt::tcIsZero(const integerPart *src, unsigned int parts) in tcIsZero()
2379 APInt::tcExtractBit(const integerPart *parts, unsigned int bit) in tcExtractBit()
2387 APInt::tcSetBit(integerPart *parts, unsigned int bit) in tcSetBit()
2394 APInt::tcClearBit(integerPart *parts, unsigned int bit) in tcClearBit()
2403 APInt::tcLSB(const integerPart *parts, unsigned int n) in tcLSB()
2421 APInt::tcMSB(const integerPart *parts, unsigned int n) in tcMSB()
2443 APInt::tcExtract(integerPart *dst, unsigned int dstCount,const integerPart *src, in tcExtract()
2477 APInt::tcAdd(integerPart *dst, const integerPart *rhs, in tcAdd()
2502 APInt::tcSubtract(integerPart *dst, const integerPart *rhs, in tcSubtract()
2527 APInt::tcNegate(integerPart *dst, unsigned int parts) in tcNegate()
2545 APInt::tcMultiplyPart(integerPart *dst, const integerPart *src, in tcMultiplyPart()
2638 APInt::tcMultiply(integerPart *dst, const integerPart *lhs, in tcMultiply()
2661 APInt::tcFullMultiply(integerPart *dst, const integerPart *lhs, in tcFullMultiply()
2695 APInt::tcDivide(integerPart *lhs, const integerPart *rhs, in tcDivide()
2744 APInt::tcShiftLeft(integerPart *dst, unsigned int parts, unsigned int count) in tcShiftLeft()
2778 APInt::tcShiftRight(integerPart *dst, unsigned int parts, unsigned int count) in tcShiftRight()
2810 APInt::tcAnd(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcAnd()
2820 APInt::tcOr(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcOr()
2830 APInt::tcXor(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcXor()
2840 APInt::tcComplement(integerPart *dst, unsigned int parts) in tcComplement()
2850 APInt::tcCompare(const integerPart *lhs, const integerPart *rhs, in tcCompare()
2869 APInt::tcIncrement(integerPart *dst, unsigned int parts) in tcIncrement()
2882 APInt::tcDecrement(integerPart *dst, unsigned int parts) { in tcDecrement()
2897 APInt::tcSetLeastSignificantBits(integerPart *dst, unsigned int parts, in tcSetLeastSignificantBits()