Lines Matching refs:BitWidth

90   assert(BitWidth && "Bitwidth too small");
107 : BitWidth(numBits), VAL(0) {
112 : BitWidth(numBits), VAL(0) {
117 : BitWidth(numbits), VAL(0) {
118 assert(BitWidth && "Bitwidth too small");
127 if (BitWidth == RHS.getBitWidth()) {
150 BitWidth = RHS.BitWidth;
166 ID.AddInteger(BitWidth);
252 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
279 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
356 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
398 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
410 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
422 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
461 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
463 return APInt(BitWidth, VAL * RHS.VAL);
470 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
472 return APInt(BitWidth, VAL + RHS.VAL);
473 APInt Result(BitWidth, 0);
479 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
481 return APInt(BitWidth, VAL - RHS.VAL);
482 APInt Result(BitWidth, 0);
516 assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
548 assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
550 int64_t lhsSext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth);
551 int64_t rhsSext = (int64_t(RHS.VAL) << (64-BitWidth)) >> (64-BitWidth);
605 assert(bitPosition < BitWidth && "Out of the bit-width range!");
672 return APIntOps::lshr(*this, BitWidth - numBits);
677 return APIntOps::lshr(APIntOps::shl(*this, BitWidth - numBits),
678 BitWidth - numBits);
684 unsigned BitsInMSW = BitWidth % APINT_BITS_PER_WORD;
711 return CountLeadingOnes_64(VAL << (APINT_BITS_PER_WORD - BitWidth));
713 unsigned highWordBits = BitWidth % APINT_BITS_PER_WORD;
738 return std::min(unsigned(CountTrailingZeros_64(VAL)), BitWidth);
745 return std::min(Count, BitWidth);
755 return std::min(Count, BitWidth);
778 assert(BitWidth >= 16 && BitWidth % 16 == 0 && "Cannot byteswap!");
779 if (BitWidth == 16)
780 return APInt(BitWidth, ByteSwap_16(uint16_t(VAL)));
781 if (BitWidth == 32)
782 return APInt(BitWidth, ByteSwap_32(unsigned(VAL)));
783 if (BitWidth == 48) {
788 return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1);
790 if (BitWidth == 64)
791 return APInt(BitWidth, ByteSwap_64(VAL));
796 if (Result.BitWidth != BitWidth) {
798 Result.BitWidth - BitWidth);
799 Result.BitWidth = BitWidth;
864 int64_t sext = (int64_t(getWord(0)) << (64-BitWidth)) >> (64-BitWidth);
871 bool isNeg = isSigned ? (*this)[BitWidth-1] : false;
920 assert(width < BitWidth && "Invalid APInt Truncate request");
943 assert(width > BitWidth && "Invalid APInt SignExtend request");
946 uint64_t val = VAL << (APINT_BITS_PER_WORD - BitWidth);
947 val = (int64_t)val >> (width - BitWidth);
956 for (i = 0; i != BitWidth / APINT_BITS_PER_WORD; i++) {
962 unsigned bits = (0 - BitWidth) % APINT_BITS_PER_WORD;
984 assert(width > BitWidth && "Invalid APInt ZeroExtend request");
1003 if (BitWidth < width)
1005 if (BitWidth > width)
1011 if (BitWidth < width)
1013 if (BitWidth > width)
1019 if (BitWidth < width)
1025 if (BitWidth < width)
1033 return ashr((unsigned)shiftAmt.getLimitedValue(BitWidth));
1039 assert(shiftAmt <= BitWidth && "Invalid shift amount");
1046 if (shiftAmt == BitWidth)
1047 return APInt(BitWidth, 0); // undefined
1049 unsigned SignBit = APINT_BITS_PER_WORD - BitWidth;
1050 return APInt(BitWidth,
1058 if (shiftAmt == BitWidth) {
1060 return APInt(BitWidth, -1ULL, true);
1062 return APInt(BitWidth, 0);
1072 unsigned bitsInWord = whichBit(BitWidth); // how many bits in last word?
1116 return APInt(val, BitWidth).clearUnusedBits();
1122 return lshr((unsigned)shiftAmt.getLimitedValue(BitWidth));
1129 if (shiftAmt >= BitWidth)
1130 return APInt(BitWidth, 0);
1132 return APInt(BitWidth, this->VAL >> shiftAmt);
1138 if (shiftAmt >= BitWidth)
1139 return APInt(BitWidth, 0);
1153 return APInt(val, BitWidth).clearUnusedBits();
1166 return APInt(val,BitWidth).clearUnusedBits();
1180 return APInt(val, BitWidth).clearUnusedBits();
1186 // It's undefined behavior in C to shift by BitWidth or greater.
1187 return shl((unsigned)shiftAmt.getLimitedValue(BitWidth));
1194 if (shiftAmt == BitWidth)
1195 return APInt(BitWidth, 0);
1213 return APInt(val, BitWidth).clearUnusedBits();
1226 return APInt(val,BitWidth).clearUnusedBits();
1237 return APInt(val, BitWidth).clearUnusedBits();
1241 return rotl((unsigned)rotateAmt.getLimitedValue(BitWidth));
1245 rotateAmt %= BitWidth;
1248 return shl(rotateAmt) | lshr(BitWidth - rotateAmt);
1252 return rotr((unsigned)rotateAmt.getLimitedValue(BitWidth));
1256 rotateAmt %= BitWidth;
1259 return lshr(rotateAmt) | shl(BitWidth - rotateAmt);
1286 return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]);
1295 return APInt(BitWidth,
1298 return APInt(BitWidth,
1308 unsigned nbits = BitWidth, i = 4;
1309 APInt testy(BitWidth, 16);
1310 APInt x_old(BitWidth, 1);
1311 APInt x_new(BitWidth, 0);
1312 APInt two(BitWidth, 2);
1358 // BitWidth bits suffice for all the computations in the algorithm implemented
1364 APInt t[2] = { APInt(BitWidth, 0), APInt(BitWidth, 1) };
1365 APInt q(BitWidth, 0);
1382 return APInt(BitWidth, 0);
1774 if (Quotient->BitWidth != LHS.BitWidth) {
1779 Quotient->BitWidth = LHS.BitWidth;
1805 if (Remainder->BitWidth != RHS.BitWidth) {
1810 Remainder->BitWidth = RHS.BitWidth;
1843 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
1848 return APInt(BitWidth, VAL / RHS.VAL);
1861 return APInt(BitWidth, 0);
1864 return APInt(BitWidth, 0);
1867 return APInt(BitWidth, 1);
1870 return APInt(BitWidth, this->pVal[0] / RHS.pVal[0]);
1880 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
1883 return APInt(BitWidth, VAL % RHS.VAL);
1898 return APInt(BitWidth, 0);
1904 return APInt(BitWidth, 0);
1907 return APInt(BitWidth, pVal[0] % RHS.pVal[0]);
2217 dbgs() << "APInt(" << BitWidth << "b, "