Lines Matching refs:APInt
77 void APInt::initSlowCase(unsigned numBits, uint64_t val, bool isSigned) { in initSlowCase()
85 void APInt::initSlowCase(const APInt& that) { in initSlowCase()
90 void APInt::initFromArray(ArrayRef<uint64_t> bigVal) { in initFromArray()
107 APInt::APInt(unsigned numBits, ArrayRef<uint64_t> bigVal) in APInt() function in APInt
112 APInt::APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]) in APInt() function in APInt
117 APInt::APInt(unsigned numbits, StringRef Str, uint8_t radix) in APInt() function in APInt
123 APInt& APInt::AssignSlowCase(const APInt& RHS) { in AssignSlowCase()
155 APInt& APInt::operator=(uint64_t RHS) { in operator =()
166 void APInt::Profile(FoldingSetNodeID& ID) const { in Profile()
197 APInt& APInt::operator++() { in operator ++()
226 APInt& APInt::operator--() { in operator --()
252 APInt& APInt::operator+=(const APInt& RHS) { in operator +=()
279 APInt& APInt::operator-=(const APInt& RHS) { in operator -=()
356 APInt& APInt::operator*=(const APInt& RHS) { in operator *=()
398 APInt& APInt::operator&=(const APInt& RHS) { in operator &=()
410 APInt& APInt::operator|=(const APInt& RHS) { in operator |=()
422 APInt& APInt::operator^=(const APInt& RHS) { in operator ^=()
435 APInt APInt::AndSlowCase(const APInt& RHS) const { in AndSlowCase()
440 return APInt(val, getBitWidth()); in AndSlowCase()
443 APInt APInt::OrSlowCase(const APInt& RHS) const { in OrSlowCase()
448 return APInt(val, getBitWidth()); in OrSlowCase()
451 APInt APInt::XorSlowCase(const APInt& RHS) const { in XorSlowCase()
458 return APInt(val, getBitWidth()).clearUnusedBits(); in XorSlowCase()
461 APInt APInt::operator*(const APInt& RHS) const { in operator *()
464 return APInt(BitWidth, VAL * RHS.VAL); in operator *()
465 APInt Result(*this); in operator *()
470 APInt APInt::operator+(const APInt& RHS) const { in operator +()
473 return APInt(BitWidth, VAL + RHS.VAL); in operator +()
474 APInt Result(BitWidth, 0); in operator +()
479 APInt APInt::operator-(const APInt& RHS) const { in operator -()
482 return APInt(BitWidth, VAL - RHS.VAL); in operator -()
483 APInt Result(BitWidth, 0); in operator -()
488 bool APInt::EqualSlowCase(const APInt& RHS) const { in EqualSlowCase()
508 bool APInt::EqualSlowCase(uint64_t Val) const { in EqualSlowCase()
516 bool APInt::ult(const APInt& RHS) const { in ult()
548 bool APInt::slt(const APInt& RHS) const { in slt()
556 APInt lhs(*this); in slt()
557 APInt rhs(RHS); in slt()
584 void APInt::setBit(unsigned bitPosition) { in setBit()
593 void APInt::clearBit(unsigned bitPosition) { in clearBit()
605 void APInt::flipBit(unsigned bitPosition) { in flipBit()
611 unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) { in getBitsNeeded()
652 APInt tmp(sufficient, StringRef(p, slen), radix); in getBitsNeeded()
664 hash_code llvm::hash_value(const APInt &Arg) { in hash_value()
672 APInt APInt::getHiBits(unsigned numBits) const { in getHiBits()
677 APInt APInt::getLoBits(unsigned numBits) const { in getLoBits()
682 unsigned APInt::countLeadingZerosSlowCase() const { in countLeadingZerosSlowCase()
710 unsigned APInt::countLeadingOnes() const { in countLeadingOnes()
737 unsigned APInt::countTrailingZeros() const { in countTrailingZeros()
749 unsigned APInt::countTrailingOnesSlowCase() const { in countTrailingOnesSlowCase()
759 unsigned APInt::countPopulationSlowCase() const { in countPopulationSlowCase()
778 APInt APInt::byteSwap() const { in byteSwap()
781 return APInt(BitWidth, ByteSwap_16(uint16_t(VAL))); in byteSwap()
783 return APInt(BitWidth, ByteSwap_32(unsigned(VAL))); in byteSwap()
789 return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1); in byteSwap()
792 return APInt(BitWidth, ByteSwap_64(VAL)); in byteSwap()
794 APInt Result(getNumWords() * APINT_BITS_PER_WORD, 0); in byteSwap()
805 APInt llvm::APIntOps::GreatestCommonDivisor(const APInt& API1, in GreatestCommonDivisor()
806 const APInt& API2) { in GreatestCommonDivisor()
807 APInt A = API1, B = API2; in GreatestCommonDivisor()
809 APInt T = B; in GreatestCommonDivisor()
816 APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, unsigned width) { in RoundDoubleToAPInt()
831 return APInt(width, 0u); in RoundDoubleToAPInt()
838 return isNeg ? -APInt(width, mantissa >> (52 - exp)) : in RoundDoubleToAPInt()
839 APInt(width, mantissa >> (52 - exp)); in RoundDoubleToAPInt()
844 return APInt(width, 0); in RoundDoubleToAPInt()
847 APInt Tmp(width, mantissa); in RoundDoubleToAPInt()
859 double APInt::roundToDouble(bool isSigned) const { in roundToDouble()
875 APInt Tmp(isNeg ? -(*this) : (*this)); in roundToDouble()
920 APInt APInt::trunc(unsigned width) const { in trunc()
925 return APInt(width, getRawData()[0]); in trunc()
927 APInt Result(getMemory(getNumWords(width)), width); in trunc()
943 APInt APInt::sext(unsigned width) const { in sext()
949 return APInt(width, val >> (APINT_BITS_PER_WORD - width)); in sext()
952 APInt Result(getMemory(getNumWords(width)), width); in sext()
984 APInt APInt::zext(unsigned width) const { in zext()
988 return APInt(width, VAL); in zext()
990 APInt Result(getMemory(getNumWords(width)), width); in zext()
1003 APInt APInt::zextOrTrunc(unsigned width) const { in zextOrTrunc()
1011 APInt APInt::sextOrTrunc(unsigned width) const { in sextOrTrunc()
1019 APInt APInt::zextOrSelf(unsigned width) const { in zextOrSelf()
1025 APInt APInt::sextOrSelf(unsigned width) const { in sextOrSelf()
1033 APInt APInt::ashr(const APInt &shiftAmt) const { in ashr()
1039 APInt APInt::ashr(unsigned shiftAmt) const { in ashr()
1048 return APInt(BitWidth, 0); // undefined in ashr()
1051 return APInt(BitWidth, in ashr()
1061 return APInt(BitWidth, -1ULL, true); in ashr()
1063 return APInt(BitWidth, 0); in ashr()
1117 return APInt(val, BitWidth).clearUnusedBits(); in ashr()
1122 APInt APInt::lshr(const APInt &shiftAmt) const { in lshr()
1128 APInt APInt::lshr(unsigned shiftAmt) const { in lshr()
1131 return APInt(BitWidth, 0); in lshr()
1133 return APInt(BitWidth, this->VAL >> shiftAmt); in lshr()
1140 return APInt(BitWidth, 0); in lshr()
1154 return APInt(val, BitWidth).clearUnusedBits(); in lshr()
1167 return APInt(val,BitWidth).clearUnusedBits(); in lshr()
1181 return APInt(val, BitWidth).clearUnusedBits(); in lshr()
1186 APInt APInt::shl(const APInt &shiftAmt) const { in shl()
1191 APInt APInt::shlSlowCase(unsigned shiftAmt) const { in shlSlowCase()
1196 return APInt(BitWidth, 0); in shlSlowCase()
1214 return APInt(val, BitWidth).clearUnusedBits(); in shlSlowCase()
1227 return APInt(val,BitWidth).clearUnusedBits(); in shlSlowCase()
1238 return APInt(val, BitWidth).clearUnusedBits(); in shlSlowCase()
1241 APInt APInt::rotl(const APInt &rotateAmt) const { in rotl()
1245 APInt APInt::rotl(unsigned rotateAmt) const { in rotl()
1252 APInt APInt::rotr(const APInt &rotateAmt) const { in rotr()
1256 APInt APInt::rotr(unsigned rotateAmt) const { in rotr()
1270 APInt APInt::sqrt() const { in sqrt()
1287 return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]); in sqrt()
1296 return APInt(BitWidth, in sqrt()
1299 return APInt(BitWidth, in sqrt()
1310 APInt testy(BitWidth, 16); in sqrt()
1311 APInt x_old(BitWidth, 1); in sqrt()
1312 APInt x_new(BitWidth, 0); in sqrt()
1313 APInt two(BitWidth, 2); in sqrt()
1336 APInt square(x_old * x_old); in sqrt()
1337 APInt nextSquare((x_old + 1) * (x_old +1)); in sqrt()
1341 APInt midpoint((nextSquare - square).udiv(two)); in sqrt()
1342 APInt offset(*this - square); in sqrt()
1353 APInt APInt::multiplicativeInverse(const APInt& modulo) const { in multiplicativeInverse()
1364 APInt r[2] = { modulo, *this }; in multiplicativeInverse()
1365 APInt t[2] = { APInt(BitWidth, 0), APInt(BitWidth, 1) }; in multiplicativeInverse()
1366 APInt q(BitWidth, 0); in multiplicativeInverse()
1383 return APInt(BitWidth, 0); in multiplicativeInverse()
1396 APInt::ms APInt::magic() const { in magic()
1397 const APInt& d = *this; in magic()
1399 APInt ad, anc, delta, q1, r1, q2, r2, t; in magic()
1400 APInt signedMin = APInt::getSignedMinValue(d.getBitWidth()); in magic()
1440 APInt::mu APInt::magicu(unsigned LeadingZeros) const { in magicu()
1441 const APInt& d = *this; in magicu()
1443 APInt nc, delta, q1, r1, q2, r2; in magicu()
1446 APInt allOnes = APInt::getAllOnesValue(d.getBitWidth()).lshr(LeadingZeros); in magicu()
1447 APInt signedMin = APInt::getSignedMinValue(d.getBitWidth()); in magicu()
1448 APInt signedMax = APInt::getSignedMaxValue(d.getBitWidth()); in magicu()
1667 void APInt::divide(const APInt LHS, unsigned lhsWords, in divide()
1668 const APInt &RHS, unsigned rhsWords, in divide()
1669 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()
1943 unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1); in udivrem()
1945 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in udivrem()
1970 Quotient = APInt(LHS.getBitWidth(), lhsValue / rhsValue); in udivrem()
1971 Remainder = APInt(LHS.getBitWidth(), lhsValue % rhsValue); in udivrem()
1979 void APInt::sdivrem(const APInt &LHS, const APInt &RHS, in sdivrem()
1980 APInt &Quotient, APInt &Remainder) { in sdivrem()
1983 APInt::udivrem(-LHS, -RHS, Quotient, Remainder); in sdivrem()
1985 APInt::udivrem(-LHS, RHS, Quotient, Remainder); in sdivrem()
1990 APInt::udivrem(LHS, -RHS, Quotient, Remainder); in sdivrem()
1993 APInt::udivrem(LHS, RHS, Quotient, Remainder); in sdivrem()
1997 APInt APInt::sadd_ov(const APInt &RHS, bool &Overflow) const { in sadd_ov()
1998 APInt Res = *this+RHS; in sadd_ov()
2004 APInt APInt::uadd_ov(const APInt &RHS, bool &Overflow) const { in uadd_ov()
2005 APInt Res = *this+RHS; in uadd_ov()
2010 APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) const { in ssub_ov()
2011 APInt Res = *this - RHS; in ssub_ov()
2017 APInt APInt::usub_ov(const APInt &RHS, bool &Overflow) const { in usub_ov()
2018 APInt Res = *this-RHS; in usub_ov()
2023 APInt APInt::sdiv_ov(const APInt &RHS, bool &Overflow) const { in sdiv_ov()
2029 APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) const { in smul_ov()
2030 APInt Res = *this * RHS; in smul_ov()
2039 APInt APInt::umul_ov(const APInt &RHS, bool &Overflow) const { in umul_ov()
2040 APInt Res = *this * RHS; in umul_ov()
2049 APInt APInt::sshl_ov(unsigned ShAmt, bool &Overflow) const { in sshl_ov()
2065 void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) { in fromString()
2095 APInt apdigit(getBitWidth(), 0); in fromString()
2096 APInt apradix(getBitWidth(), radix); in fromString()
2125 void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix, in toString()
2194 APInt Tmp(*this); in toString()
2227 APInt divisor(Radix == 10? 4 : 8, Radix); in toString()
2229 APInt APdigit(1, 0); in toString()
2230 APInt tmp2(Tmp.getBitWidth(), 0); in toString()
2247 std::string APInt::toString(unsigned Radix = 10, bool Signed = true) const { in toString()
2254 void APInt::dump() const { in dump()
2262 void APInt::print(raw_ostream &OS, bool isSigned) const { in print()
2323 APInt::tcSet(integerPart *dst, integerPart part, unsigned int parts) in tcSet()
2336 APInt::tcAssign(integerPart *dst, const integerPart *src, unsigned int parts) in tcAssign()
2346 APInt::tcIsZero(const integerPart *src, unsigned int parts) in tcIsZero()
2359 APInt::tcExtractBit(const integerPart *parts, unsigned int bit) in tcExtractBit()
2367 APInt::tcSetBit(integerPart *parts, unsigned int bit) in tcSetBit()
2374 APInt::tcClearBit(integerPart *parts, unsigned int bit) in tcClearBit()
2383 APInt::tcLSB(const integerPart *parts, unsigned int n) in tcLSB()
2401 APInt::tcMSB(const integerPart *parts, unsigned int n) in tcMSB()
2423 APInt::tcExtract(integerPart *dst, unsigned int dstCount,const integerPart *src, in tcExtract()
2457 APInt::tcAdd(integerPart *dst, const integerPart *rhs, in tcAdd()
2482 APInt::tcSubtract(integerPart *dst, const integerPart *rhs, in tcSubtract()
2507 APInt::tcNegate(integerPart *dst, unsigned int parts) in tcNegate()
2525 APInt::tcMultiplyPart(integerPart *dst, const integerPart *src, in tcMultiplyPart()
2618 APInt::tcMultiply(integerPart *dst, const integerPart *lhs, in tcMultiply()
2641 APInt::tcFullMultiply(integerPart *dst, const integerPart *lhs, in tcFullMultiply()
2675 APInt::tcDivide(integerPart *lhs, const integerPart *rhs, in tcDivide()
2722 APInt::tcShiftLeft(integerPart *dst, unsigned int parts, unsigned int count) in tcShiftLeft()
2756 APInt::tcShiftRight(integerPart *dst, unsigned int parts, unsigned int count) in tcShiftRight()
2788 APInt::tcAnd(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcAnd()
2798 APInt::tcOr(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcOr()
2808 APInt::tcXor(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcXor()
2818 APInt::tcComplement(integerPart *dst, unsigned int parts) in tcComplement()
2828 APInt::tcCompare(const integerPart *lhs, const integerPart *rhs, in tcCompare()
2847 APInt::tcIncrement(integerPart *dst, unsigned int parts) in tcIncrement()
2860 APInt::tcDecrement(integerPart *dst, unsigned int parts) { in tcDecrement()
2875 APInt::tcSetLeastSignificantBits(integerPart *dst, unsigned int parts, in tcSetLeastSignificantBits()