Lines Matching refs:BitWidth
90 assert(BitWidth && "Bitwidth too small"); in initFromArray()
107 : BitWidth(numBits), VAL(0) { in APInt()
112 : BitWidth(numBits), VAL(0) { in APInt()
117 : BitWidth(numbits), VAL(0) { in APInt()
118 assert(BitWidth && "Bitwidth too small"); in APInt()
127 if (BitWidth == RHS.getBitWidth()) { in AssignSlowCase()
150 BitWidth = RHS.BitWidth; in AssignSlowCase()
166 ID.AddInteger(BitWidth); in Profile()
252 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator +=()
279 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator -=()
356 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator *=()
398 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator &=()
410 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator |=()
422 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator ^=()
461 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator *()
463 return APInt(BitWidth, VAL * RHS.VAL); in operator *()
470 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator +()
472 return APInt(BitWidth, VAL + RHS.VAL); in operator +()
473 APInt Result(BitWidth, 0); in operator +()
479 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in operator -()
481 return APInt(BitWidth, VAL - RHS.VAL); in operator -()
482 APInt Result(BitWidth, 0); in operator -()
516 assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"); in ult()
548 assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"); in slt()
550 int64_t lhsSext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth); in slt()
551 int64_t rhsSext = (int64_t(RHS.VAL) << (64-BitWidth)) >> (64-BitWidth); in slt()
605 assert(bitPosition < BitWidth && "Out of the bit-width range!"); in flipBit()
672 return APIntOps::lshr(*this, BitWidth - numBits); in getHiBits()
677 return APIntOps::lshr(APIntOps::shl(*this, BitWidth - numBits), in getLoBits()
678 BitWidth - numBits); in getLoBits()
684 unsigned BitsInMSW = BitWidth % APINT_BITS_PER_WORD; in countLeadingZerosSlowCase()
711 return CountLeadingOnes_64(VAL << (APINT_BITS_PER_WORD - BitWidth)); in countLeadingOnes()
713 unsigned highWordBits = BitWidth % APINT_BITS_PER_WORD; in countLeadingOnes()
738 return std::min(unsigned(CountTrailingZeros_64(VAL)), BitWidth); in countTrailingZeros()
745 return std::min(Count, BitWidth); in countTrailingZeros()
755 return std::min(Count, BitWidth); in countTrailingOnesSlowCase()
778 assert(BitWidth >= 16 && BitWidth % 16 == 0 && "Cannot byteswap!"); in byteSwap()
779 if (BitWidth == 16) in byteSwap()
780 return APInt(BitWidth, ByteSwap_16(uint16_t(VAL))); in byteSwap()
781 if (BitWidth == 32) in byteSwap()
782 return APInt(BitWidth, ByteSwap_32(unsigned(VAL))); in byteSwap()
783 if (BitWidth == 48) { in byteSwap()
788 return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1); in byteSwap()
790 if (BitWidth == 64) in byteSwap()
791 return APInt(BitWidth, ByteSwap_64(VAL)); in byteSwap()
796 if (Result.BitWidth != BitWidth) { in byteSwap()
798 Result.BitWidth - BitWidth); in byteSwap()
799 Result.BitWidth = BitWidth; in byteSwap()
864 int64_t sext = (int64_t(getWord(0)) << (64-BitWidth)) >> (64-BitWidth); in roundToDouble()
871 bool isNeg = isSigned ? (*this)[BitWidth-1] : false; in roundToDouble()
920 assert(width < BitWidth && "Invalid APInt Truncate request"); in trunc()
943 assert(width > BitWidth && "Invalid APInt SignExtend request"); in sext()
946 uint64_t val = VAL << (APINT_BITS_PER_WORD - BitWidth); in sext()
947 val = (int64_t)val >> (width - BitWidth); in sext()
956 for (i = 0; i != BitWidth / APINT_BITS_PER_WORD; i++) { in sext()
962 unsigned bits = (0 - BitWidth) % APINT_BITS_PER_WORD; in sext()
984 assert(width > BitWidth && "Invalid APInt ZeroExtend request"); in zext()
1003 if (BitWidth < width) in zextOrTrunc()
1005 if (BitWidth > width) in zextOrTrunc()
1011 if (BitWidth < width) in sextOrTrunc()
1013 if (BitWidth > width) in sextOrTrunc()
1019 if (BitWidth < width) in zextOrSelf()
1025 if (BitWidth < width) in sextOrSelf()
1033 return ashr((unsigned)shiftAmt.getLimitedValue(BitWidth)); in ashr()
1039 assert(shiftAmt <= BitWidth && "Invalid shift amount"); in ashr()
1046 if (shiftAmt == BitWidth) in ashr()
1047 return APInt(BitWidth, 0); // undefined in ashr()
1049 unsigned SignBit = APINT_BITS_PER_WORD - BitWidth; in ashr()
1050 return APInt(BitWidth, in ashr()
1058 if (shiftAmt == BitWidth) { in ashr()
1060 return APInt(BitWidth, -1ULL, true); in ashr()
1062 return APInt(BitWidth, 0); in ashr()
1072 unsigned bitsInWord = whichBit(BitWidth); // how many bits in last word? in ashr()
1116 return APInt(val, BitWidth).clearUnusedBits(); in ashr()
1122 return lshr((unsigned)shiftAmt.getLimitedValue(BitWidth)); in lshr()
1129 if (shiftAmt >= BitWidth) in lshr()
1130 return APInt(BitWidth, 0); in lshr()
1132 return APInt(BitWidth, this->VAL >> shiftAmt); in lshr()
1138 if (shiftAmt >= BitWidth) 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()
1187 return shl((unsigned)shiftAmt.getLimitedValue(BitWidth)); in shl()
1194 if (shiftAmt == BitWidth) 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()
1241 return rotl((unsigned)rotateAmt.getLimitedValue(BitWidth)); in rotl()
1245 rotateAmt %= BitWidth; in rotl()
1248 return shl(rotateAmt) | lshr(BitWidth - rotateAmt); in rotl()
1252 return rotr((unsigned)rotateAmt.getLimitedValue(BitWidth)); in rotr()
1256 rotateAmt %= BitWidth; in rotr()
1259 return lshr(rotateAmt) | shl(BitWidth - rotateAmt); in rotr()
1286 return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]); in sqrt()
1295 return APInt(BitWidth, in sqrt()
1298 return APInt(BitWidth, in sqrt()
1308 unsigned nbits = BitWidth, i = 4; 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()
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()
1774 if (Quotient->BitWidth != LHS.BitWidth) { in divide()
1779 Quotient->BitWidth = LHS.BitWidth; in divide()
1805 if (Remainder->BitWidth != RHS.BitWidth) { in divide()
1810 Remainder->BitWidth = RHS.BitWidth; in divide()
1843 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in udiv()
1848 return APInt(BitWidth, VAL / RHS.VAL); 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()
1880 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same"); in urem()
1883 return APInt(BitWidth, VAL % RHS.VAL); 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()
2217 dbgs() << "APInt(" << BitWidth << "b, " in dump()