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()
457 APInt Result(val, getBitWidth()); in XorSlowCase()
463 APInt APInt::operator*(const APInt& RHS) const { in operator *()
466 return APInt(BitWidth, VAL * RHS.VAL); in operator *()
467 APInt Result(*this); in operator *()
472 APInt APInt::operator+(const APInt& RHS) const { in operator +()
475 return APInt(BitWidth, VAL + RHS.VAL); in operator +()
476 APInt Result(BitWidth, 0); in operator +()
482 APInt APInt::operator-(const APInt& RHS) const { in operator -()
485 return APInt(BitWidth, VAL - RHS.VAL); in operator -()
486 APInt Result(BitWidth, 0); in operator -()
492 bool APInt::EqualSlowCase(const APInt& RHS) const { in EqualSlowCase()
512 bool APInt::EqualSlowCase(uint64_t Val) const { in EqualSlowCase()
520 bool APInt::ult(const APInt& RHS) const { in ult()
552 bool APInt::slt(const APInt& RHS) const { in slt()
560 APInt lhs(*this); in slt()
561 APInt rhs(RHS); in slt()
588 void APInt::setBit(unsigned bitPosition) { in setBit()
597 void APInt::clearBit(unsigned bitPosition) { in clearBit()
609 void APInt::flipBit(unsigned bitPosition) { in flipBit()
615 unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) { in getBitsNeeded()
656 APInt tmp(sufficient, StringRef(p, slen), radix); in getBitsNeeded()
668 hash_code llvm::hash_value(const APInt &Arg) { in hash_value()
675 bool APInt::isSplat(unsigned SplatSizeInBits) const { in isSplat()
684 APInt APInt::getHiBits(unsigned numBits) const { in getHiBits()
689 APInt APInt::getLoBits(unsigned numBits) const { in getLoBits()
694 unsigned APInt::countLeadingZerosSlowCase() const { in countLeadingZerosSlowCase()
722 unsigned APInt::countLeadingOnes() const { in countLeadingOnes()
749 unsigned APInt::countTrailingZeros() const { in countTrailingZeros()
761 unsigned APInt::countTrailingOnesSlowCase() const { in countTrailingOnesSlowCase()
771 unsigned APInt::countPopulationSlowCase() const { in countPopulationSlowCase()
790 APInt APInt::byteSwap() const { in byteSwap()
793 return APInt(BitWidth, ByteSwap_16(uint16_t(VAL))); in byteSwap()
795 return APInt(BitWidth, ByteSwap_32(unsigned(VAL))); in byteSwap()
801 return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1); in byteSwap()
804 return APInt(BitWidth, ByteSwap_64(VAL)); in byteSwap()
806 APInt Result(getNumWords() * APINT_BITS_PER_WORD, 0); in byteSwap()
817 APInt llvm::APIntOps::GreatestCommonDivisor(const APInt& API1, in GreatestCommonDivisor()
818 const APInt& API2) { in GreatestCommonDivisor()
819 APInt A = API1, B = API2; in GreatestCommonDivisor()
821 APInt T = B; in GreatestCommonDivisor()
828 APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, unsigned width) { in RoundDoubleToAPInt()
843 return APInt(width, 0u); in RoundDoubleToAPInt()
850 return isNeg ? -APInt(width, mantissa >> (52 - exp)) : in RoundDoubleToAPInt()
851 APInt(width, mantissa >> (52 - exp)); in RoundDoubleToAPInt()
856 return APInt(width, 0); in RoundDoubleToAPInt()
859 APInt Tmp(width, mantissa); in RoundDoubleToAPInt()
871 double APInt::roundToDouble(bool isSigned) const { in roundToDouble()
887 APInt Tmp(isNeg ? -(*this) : (*this)); in roundToDouble()
932 APInt APInt::trunc(unsigned width) const { in trunc()
937 return APInt(width, getRawData()[0]); in trunc()
939 APInt Result(getMemory(getNumWords(width)), width); in trunc()
955 APInt APInt::sext(unsigned width) const { in sext()
961 return APInt(width, val >> (APINT_BITS_PER_WORD - width)); in sext()
964 APInt Result(getMemory(getNumWords(width)), width); in sext()
996 APInt APInt::zext(unsigned width) const { in zext()
1000 return APInt(width, VAL); in zext()
1002 APInt Result(getMemory(getNumWords(width)), width); in zext()
1015 APInt APInt::zextOrTrunc(unsigned width) const { in zextOrTrunc()
1023 APInt APInt::sextOrTrunc(unsigned width) const { in sextOrTrunc()
1031 APInt APInt::zextOrSelf(unsigned width) const { in zextOrSelf()
1037 APInt APInt::sextOrSelf(unsigned width) const { in sextOrSelf()
1045 APInt APInt::ashr(const APInt &shiftAmt) const { in ashr()
1051 APInt APInt::ashr(unsigned shiftAmt) const { in ashr()
1060 return APInt(BitWidth, 0); // undefined in ashr()
1063 return APInt(BitWidth, in ashr()
1073 return APInt(BitWidth, -1ULL, true); in ashr()
1075 return APInt(BitWidth, 0); in ashr()
1129 APInt Result(val, BitWidth); in ashr()
1136 APInt APInt::lshr(const APInt &shiftAmt) const { in lshr()
1142 APInt APInt::lshr(unsigned shiftAmt) const { in lshr()
1145 return APInt(BitWidth, 0); in lshr()
1147 return APInt(BitWidth, this->VAL >> shiftAmt); in lshr()
1154 return APInt(BitWidth, 0); in lshr()
1168 APInt Result(val, BitWidth); in lshr()
1183 APInt Result(val, BitWidth); in lshr()
1199 APInt Result(val, BitWidth); in lshr()
1206 APInt APInt::shl(const APInt &shiftAmt) const { in shl()
1211 APInt APInt::shlSlowCase(unsigned shiftAmt) const { in shlSlowCase()
1216 return APInt(BitWidth, 0); in shlSlowCase()
1234 APInt Result(val, BitWidth); in shlSlowCase()
1249 APInt Result(val, BitWidth); in shlSlowCase()
1262 APInt Result(val, BitWidth); in shlSlowCase()
1267 APInt APInt::rotl(const APInt &rotateAmt) const { in rotl()
1271 APInt APInt::rotl(unsigned rotateAmt) const { in rotl()
1278 APInt APInt::rotr(const APInt &rotateAmt) const { in rotr()
1282 APInt APInt::rotr(unsigned rotateAmt) const { in rotr()
1296 APInt APInt::sqrt() const { in sqrt()
1313 return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]); in sqrt()
1321 return APInt(BitWidth, in sqrt()
1331 APInt testy(BitWidth, 16); in sqrt()
1332 APInt x_old(BitWidth, 1); in sqrt()
1333 APInt x_new(BitWidth, 0); in sqrt()
1334 APInt two(BitWidth, 2); in sqrt()
1357 APInt square(x_old * x_old); in sqrt()
1358 APInt nextSquare((x_old + 1) * (x_old +1)); in sqrt()
1362 APInt midpoint((nextSquare - square).udiv(two)); in sqrt()
1363 APInt offset(*this - square); in sqrt()
1374 APInt APInt::multiplicativeInverse(const APInt& modulo) const { in multiplicativeInverse()
1385 APInt r[2] = { modulo, *this }; in multiplicativeInverse()
1386 APInt t[2] = { APInt(BitWidth, 0), APInt(BitWidth, 1) }; in multiplicativeInverse()
1387 APInt q(BitWidth, 0); in multiplicativeInverse()
1404 return APInt(BitWidth, 0); in multiplicativeInverse()
1417 APInt::ms APInt::magic() const { in magic()
1418 const APInt& d = *this; in magic()
1420 APInt ad, anc, delta, q1, r1, q2, r2, t; in magic()
1421 APInt signedMin = APInt::getSignedMinValue(d.getBitWidth()); in magic()
1461 APInt::mu APInt::magicu(unsigned LeadingZeros) const { in magicu()
1462 const APInt& d = *this; in magicu()
1464 APInt nc, delta, q1, r1, q2, r2; in magicu()
1467 APInt allOnes = APInt::getAllOnesValue(d.getBitWidth()).lshr(LeadingZeros); in magicu()
1468 APInt signedMin = APInt::getSignedMinValue(d.getBitWidth()); in magicu()
1469 APInt signedMax = APInt::getSignedMaxValue(d.getBitWidth()); in magicu()
1671 void APInt::divide(const APInt LHS, unsigned lhsWords, in divide()
1672 const APInt &RHS, unsigned rhsWords, in divide()
1673 APInt *Quotient, APInt *Remainder) in divide()
1849 APInt APInt::udiv(const APInt& RHS) const { in udiv()
1855 return APInt(BitWidth, VAL / RHS.VAL); in udiv()
1860 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in udiv()
1863 unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1); in udiv()
1868 return APInt(BitWidth, 0); in udiv()
1871 return APInt(BitWidth, 0); in udiv()
1874 return APInt(BitWidth, 1); in udiv()
1877 return APInt(BitWidth, this->pVal[0] / RHS.pVal[0]); in udiv()
1881 APInt Quotient(1,0); // to hold result. in udiv()
1886 APInt APInt::sdiv(const APInt &RHS) const { in sdiv()
1897 APInt APInt::urem(const APInt& RHS) const { in urem()
1901 return APInt(BitWidth, VAL % RHS.VAL); in urem()
1910 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in urem()
1916 return APInt(BitWidth, 0); in urem()
1922 return APInt(BitWidth, 0); in urem()
1925 return APInt(BitWidth, pVal[0] % RHS.pVal[0]); in urem()
1929 APInt Remainder(1,0); in urem()
1934 APInt APInt::srem(const APInt &RHS) const { in srem()
1945 void APInt::udivrem(const APInt &LHS, const APInt &RHS, in udivrem()
1946 APInt &Quotient, APInt &Remainder) { in udivrem()
1954 Quotient = APInt(LHS.BitWidth, QuotVal); in udivrem()
1955 Remainder = APInt(LHS.BitWidth, RemVal); in udivrem()
1961 unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1); in udivrem()
1963 unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1); in udivrem()
1988 Quotient = APInt(LHS.getBitWidth(), lhsValue / rhsValue); in udivrem()
1989 Remainder = APInt(LHS.getBitWidth(), lhsValue % rhsValue); in udivrem()
1997 void APInt::sdivrem(const APInt &LHS, const APInt &RHS, in sdivrem()
1998 APInt &Quotient, APInt &Remainder) { in sdivrem()
2001 APInt::udivrem(-LHS, -RHS, Quotient, Remainder); in sdivrem()
2003 APInt::udivrem(-LHS, RHS, Quotient, Remainder); in sdivrem()
2008 APInt::udivrem(LHS, -RHS, Quotient, Remainder); in sdivrem()
2011 APInt::udivrem(LHS, RHS, Quotient, Remainder); in sdivrem()
2015 APInt APInt::sadd_ov(const APInt &RHS, bool &Overflow) const { in sadd_ov()
2016 APInt Res = *this+RHS; in sadd_ov()
2022 APInt APInt::uadd_ov(const APInt &RHS, bool &Overflow) const { in uadd_ov()
2023 APInt Res = *this+RHS; in uadd_ov()
2028 APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) const { in ssub_ov()
2029 APInt Res = *this - RHS; in ssub_ov()
2035 APInt APInt::usub_ov(const APInt &RHS, bool &Overflow) const { in usub_ov()
2036 APInt Res = *this-RHS; in usub_ov()
2041 APInt APInt::sdiv_ov(const APInt &RHS, bool &Overflow) const { in sdiv_ov()
2047 APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) const { in smul_ov()
2048 APInt Res = *this * RHS; in smul_ov()
2057 APInt APInt::umul_ov(const APInt &RHS, bool &Overflow) const { in umul_ov()
2058 APInt Res = *this * RHS; in umul_ov()
2067 APInt APInt::sshl_ov(const APInt &ShAmt, bool &Overflow) const { in sshl_ov()
2070 return APInt(BitWidth, 0); in sshl_ov()
2080 APInt APInt::ushl_ov(const APInt &ShAmt, bool &Overflow) const { in ushl_ov()
2083 return APInt(BitWidth, 0); in ushl_ov()
2093 void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) { in fromString()
2123 APInt apdigit(getBitWidth(), 0); in fromString()
2124 APInt apradix(getBitWidth(), radix); in fromString()
2153 void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix, in toString()
2222 APInt Tmp(*this); in toString()
2255 APInt divisor(Radix == 10? 4 : 8, Radix); in toString()
2257 APInt APdigit(1, 0); in toString()
2258 APInt tmp2(Tmp.getBitWidth(), 0); in toString()
2274 std::string APInt::toString(unsigned Radix = 10, bool Signed = true) const { in toString()
2281 void APInt::dump() const { in dump()
2289 void APInt::print(raw_ostream &OS, bool isSigned) const { in print()
2349 APInt::tcSet(integerPart *dst, integerPart part, unsigned int parts) in tcSet()
2362 APInt::tcAssign(integerPart *dst, const integerPart *src, unsigned int parts) in tcAssign()
2372 APInt::tcIsZero(const integerPart *src, unsigned int parts) in tcIsZero()
2385 APInt::tcExtractBit(const integerPart *parts, unsigned int bit) in tcExtractBit()
2393 APInt::tcSetBit(integerPart *parts, unsigned int bit) in tcSetBit()
2400 APInt::tcClearBit(integerPart *parts, unsigned int bit) in tcClearBit()
2409 APInt::tcLSB(const integerPart *parts, unsigned int n) in tcLSB()
2427 APInt::tcMSB(const integerPart *parts, unsigned int n) in tcMSB()
2449 APInt::tcExtract(integerPart *dst, unsigned int dstCount,const integerPart *src, in tcExtract()
2483 APInt::tcAdd(integerPart *dst, const integerPart *rhs, in tcAdd()
2508 APInt::tcSubtract(integerPart *dst, const integerPart *rhs, in tcSubtract()
2533 APInt::tcNegate(integerPart *dst, unsigned int parts) in tcNegate()
2551 APInt::tcMultiplyPart(integerPart *dst, const integerPart *src, in tcMultiplyPart()
2644 APInt::tcMultiply(integerPart *dst, const integerPart *lhs, in tcMultiply()
2667 APInt::tcFullMultiply(integerPart *dst, const integerPart *lhs, in tcFullMultiply()
2701 APInt::tcDivide(integerPart *lhs, const integerPart *rhs, in tcDivide()
2748 APInt::tcShiftLeft(integerPart *dst, unsigned int parts, unsigned int count) in tcShiftLeft()
2782 APInt::tcShiftRight(integerPart *dst, unsigned int parts, unsigned int count) in tcShiftRight()
2814 APInt::tcAnd(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcAnd()
2824 APInt::tcOr(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcOr()
2834 APInt::tcXor(integerPart *dst, const integerPart *rhs, unsigned int parts) in tcXor()
2844 APInt::tcComplement(integerPart *dst, unsigned int parts) in tcComplement()
2854 APInt::tcCompare(const integerPart *lhs, const integerPart *rhs, in tcCompare()
2873 APInt::tcIncrement(integerPart *dst, unsigned int parts) in tcIncrement()
2886 APInt::tcDecrement(integerPart *dst, unsigned int parts) { in tcDecrement()
2901 APInt::tcSetLeastSignificantBits(integerPart *dst, unsigned int parts, in tcSetLeastSignificantBits()