Lines Matching refs:BitWidth

91   assert(BitWidth && "Bitwidth too small");
108 : BitWidth(numBits), VAL(0) {
113 : BitWidth(numBits), VAL(0) {
118 : BitWidth(numbits), VAL(0) {
119 assert(BitWidth && "Bitwidth too small");
128 if (BitWidth == RHS.getBitWidth()) {
151 BitWidth = RHS.BitWidth;
167 ID.AddInteger(BitWidth);
253 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
280 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
357 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
399 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
411 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
423 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
464 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
466 return APInt(BitWidth, VAL * RHS.VAL);
473 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
475 return APInt(BitWidth, VAL + RHS.VAL);
476 APInt Result(BitWidth, 0);
483 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
485 return APInt(BitWidth, VAL - RHS.VAL);
486 APInt Result(BitWidth, 0);
521 assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
553 assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
555 int64_t lhsSext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth);
556 int64_t rhsSext = (int64_t(RHS.VAL) << (64-BitWidth)) >> (64-BitWidth);
610 assert(bitPosition < BitWidth && "Out of the bit-width range!");
685 return APIntOps::lshr(*this, BitWidth - numBits);
690 return APIntOps::lshr(APIntOps::shl(*this, BitWidth - numBits),
691 BitWidth - numBits);
697 unsigned BitsInMSW = BitWidth % APINT_BITS_PER_WORD;
724 return llvm::countLeadingOnes(VAL << (APINT_BITS_PER_WORD - BitWidth));
726 unsigned highWordBits = BitWidth % APINT_BITS_PER_WORD;
751 return std::min(unsigned(llvm::countTrailingZeros(VAL)), BitWidth);
758 return std::min(Count, BitWidth);
768 return std::min(Count, BitWidth);
791 assert(BitWidth >= 16 && BitWidth % 16 == 0 && "Cannot byteswap!");
792 if (BitWidth == 16)
793 return APInt(BitWidth, ByteSwap_16(uint16_t(VAL)));
794 if (BitWidth == 32)
795 return APInt(BitWidth, ByteSwap_32(unsigned(VAL)));
796 if (BitWidth == 48) {
801 return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1);
803 if (BitWidth == 64)
804 return APInt(BitWidth, ByteSwap_64(VAL));
809 if (Result.BitWidth != BitWidth) {
811 Result.BitWidth - BitWidth);
812 Result.BitWidth = BitWidth;
877 int64_t sext = (int64_t(getWord(0)) << (64-BitWidth)) >> (64-BitWidth);
884 bool isNeg = isSigned ? (*this)[BitWidth-1] : false;
933 assert(width < BitWidth && "Invalid APInt Truncate request");
956 assert(width > BitWidth && "Invalid APInt SignExtend request");
959 uint64_t val = VAL << (APINT_BITS_PER_WORD - BitWidth);
960 val = (int64_t)val >> (width - BitWidth);
969 for (i = 0; i != BitWidth / APINT_BITS_PER_WORD; i++) {
975 unsigned bits = (0 - BitWidth) % APINT_BITS_PER_WORD;
997 assert(width > BitWidth && "Invalid APInt ZeroExtend request");
1016 if (BitWidth < width)
1018 if (BitWidth > width)
1024 if (BitWidth < width)
1026 if (BitWidth > width)
1032 if (BitWidth < width)
1038 if (BitWidth < width)
1046 return ashr((unsigned)shiftAmt.getLimitedValue(BitWidth));
1052 assert(shiftAmt <= BitWidth && "Invalid shift amount");
1059 if (shiftAmt == BitWidth)
1060 return APInt(BitWidth, 0); // undefined
1062 unsigned SignBit = APINT_BITS_PER_WORD - BitWidth;
1063 return APInt(BitWidth,
1071 if (shiftAmt == BitWidth) {
1073 return APInt(BitWidth, -1ULL, true);
1075 return APInt(BitWidth, 0);
1085 unsigned bitsInWord = whichBit(BitWidth); // how many bits in last word?
1129 APInt Result(val, BitWidth);
1137 return lshr((unsigned)shiftAmt.getLimitedValue(BitWidth));
1144 if (shiftAmt >= BitWidth)
1145 return APInt(BitWidth, 0);
1147 return APInt(BitWidth, this->VAL >> shiftAmt);
1153 if (shiftAmt >= BitWidth)
1154 return APInt(BitWidth, 0);
1168 APInt Result(val, BitWidth);
1183 APInt Result(val, BitWidth);
1199 APInt Result(val, BitWidth);
1207 // It's undefined behavior in C to shift by BitWidth or greater.
1208 return shl((unsigned)shiftAmt.getLimitedValue(BitWidth));
1215 if (shiftAmt == BitWidth)
1216 return APInt(BitWidth, 0);
1234 APInt Result(val, BitWidth);
1249 APInt Result(val, BitWidth);
1262 APInt Result(val, BitWidth);
1268 return rotl((unsigned)rotateAmt.getLimitedValue(BitWidth));
1272 rotateAmt %= BitWidth;
1275 return shl(rotateAmt) | lshr(BitWidth - rotateAmt);
1279 return rotr((unsigned)rotateAmt.getLimitedValue(BitWidth));
1283 rotateAmt %= BitWidth;
1286 return lshr(rotateAmt) | shl(BitWidth - rotateAmt);
1313 return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]);
1321 return APInt(BitWidth,
1330 unsigned nbits = BitWidth, i = 4;
1331 APInt testy(BitWidth, 16);
1332 APInt x_old(BitWidth, 1);
1333 APInt x_new(BitWidth, 0);
1334 APInt two(BitWidth, 2);
1380 // BitWidth bits suffice for all the computations in the algorithm implemented
1386 APInt t[2] = { APInt(BitWidth, 0), APInt(BitWidth, 1) };
1387 APInt q(BitWidth, 0);
1404 return APInt(BitWidth, 0);
1779 if (Quotient->BitWidth != LHS.BitWidth) {
1784 Quotient->BitWidth = LHS.BitWidth;
1812 if (Remainder->BitWidth != RHS.BitWidth) {
1817 Remainder->BitWidth = RHS.BitWidth;
1850 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
1855 return APInt(BitWidth, VAL / RHS.VAL);
1868 return APInt(BitWidth, 0);
1871 return APInt(BitWidth, 0);
1874 return APInt(BitWidth, 1);
1877 return APInt(BitWidth, this->pVal[0] / RHS.pVal[0]);
1898 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
1901 return APInt(BitWidth, VAL % RHS.VAL);
1916 return APInt(BitWidth, 0);
1922 return APInt(BitWidth, 0);
1925 return APInt(BitWidth, pVal[0] % RHS.pVal[0]);
1947 assert(LHS.BitWidth == RHS.BitWidth && "Bit widths must be the same");
1954 Quotient = APInt(LHS.BitWidth, QuotVal);
1955 Remainder = APInt(LHS.BitWidth, RemVal);
2070 return APInt(BitWidth, 0);
2083 return APInt(BitWidth, 0);
2285 dbgs() << "APInt(" << BitWidth << "b, "