Home | History | Annotate | Download | only in Support

Lines Matching full: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");
462 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
464 return APInt(BitWidth, VAL * RHS.VAL);
471 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
473 return APInt(BitWidth, VAL + RHS.VAL);
474 APInt Result(BitWidth, 0);
480 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
482 return APInt(BitWidth, VAL - RHS.VAL);
483 APInt Result(BitWidth, 0);
517 assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
549 assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
551 int64_t lhsSext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth);
552 int64_t rhsSext = (int64_t(RHS.VAL) << (64-BitWidth)) >> (64-BitWidth);
606 assert(bitPosition < BitWidth && "Out of the bit-width range!");
673 return APIntOps::lshr(*this, BitWidth - numBits);
678 return APIntOps::lshr(APIntOps::shl(*this, BitWidth - numBits),
679 BitWidth - numBits);
685 unsigned BitsInMSW = BitWidth % APINT_BITS_PER_WORD;
712 return CountLeadingOnes_64(VAL << (APINT_BITS_PER_WORD - BitWidth));
714 unsigned highWordBits = BitWidth % APINT_BITS_PER_WORD;
739 return std::min(unsigned(llvm::countTrailingZeros(VAL)), BitWidth);
746 return std::min(Count, BitWidth);
756 return std::min(Count, BitWidth);
779 assert(BitWidth >= 16 && BitWidth % 16 == 0 && "Cannot byteswap!");
780 if (BitWidth == 16)
781 return APInt(BitWidth, ByteSwap_16(uint16_t(VAL)));
782 if (BitWidth == 32)
783 return APInt(BitWidth, ByteSwap_32(unsigned(VAL)));
784 if (BitWidth == 48) {
789 return APInt(BitWidth, (uint64_t(Tmp2) << 32) | Tmp1);
791 if (BitWidth == 64)
792 return APInt(BitWidth, ByteSwap_64(VAL));
797 if (Result.BitWidth != BitWidth) {
799 Result.BitWidth - BitWidth);
800 Result.BitWidth = BitWidth;
865 int64_t sext = (int64_t(getWord(0)) << (64-BitWidth)) >> (64-BitWidth);
872 bool isNeg = isSigned ? (*this)[BitWidth-1] : false;
921 assert(width < BitWidth && "Invalid APInt Truncate request");
944 assert(width > BitWidth && "Invalid APInt SignExtend request");
947 uint64_t val = VAL << (APINT_BITS_PER_WORD - BitWidth);
948 val = (int64_t)val >> (width - BitWidth);
957 for (i = 0; i != BitWidth / APINT_BITS_PER_WORD; i++) {
963 unsigned bits = (0 - BitWidth) % APINT_BITS_PER_WORD;
985 assert(width > BitWidth && "Invalid APInt ZeroExtend request");
1004 if (BitWidth < width)
1006 if (BitWidth > width)
1012 if (BitWidth < width)
1014 if (BitWidth > width)
1020 if (BitWidth < width)
1026 if (BitWidth < width)
1034 return ashr((unsigned)shiftAmt.getLimitedValue(BitWidth));
1040 assert(shiftAmt <= BitWidth && "Invalid shift amount");
1047 if (shiftAmt == BitWidth)
1048 return APInt(BitWidth, 0); // undefined
1050 unsigned SignBit = APINT_BITS_PER_WORD - BitWidth;
1051 return APInt(BitWidth,
1059 if (shiftAmt == BitWidth) {
1061 return APInt(BitWidth, -1ULL, true);
1063 return APInt(BitWidth, 0);
1073 unsigned bitsInWord = whichBit(BitWidth); // how many bits in last word?
1117 return APInt(val, BitWidth).clearUnusedBits();
1123 return lshr((unsigned)shiftAmt.getLimitedValue(BitWidth));
1130 if (shiftAmt >= BitWidth)
1131 return APInt(BitWidth, 0);
1133 return APInt(BitWidth, this->VAL >> shiftAmt);
1139 if (shiftAmt >= BitWidth)
1140 return APInt(BitWidth, 0);
1154 return APInt(val, BitWidth).clearUnusedBits();
1167 return APInt(val,BitWidth).clearUnusedBits();
1181 return APInt(val, BitWidth).clearUnusedBits();
1187 // It's undefined behavior in C to shift by BitWidth or greater.
1188 return shl((unsigned)shiftAmt.getLimitedValue(BitWidth));
1195 if (shiftAmt == BitWidth)
1196 return APInt(BitWidth, 0);
1214 return APInt(val, BitWidth).clearUnusedBits();
1227 return APInt(val,BitWidth).clearUnusedBits();
1238 return APInt(val, BitWidth).clearUnusedBits();
1242 return rotl((unsigned)rotateAmt.getLimitedValue(BitWidth));
1246 rotateAmt %= BitWidth;
1249 return shl(rotateAmt) | lshr(BitWidth - rotateAmt);
1253 return rotr((unsigned)rotateAmt.getLimitedValue(BitWidth));
1257 rotateAmt %= BitWidth;
1260 return lshr(rotateAmt) | shl(BitWidth - rotateAmt);
1287 return APInt(BitWidth, results[ (isSingleWord() ? VAL : pVal[0]) ]);
1296 return APInt(BitWidth,
1299 return APInt(BitWidth,
1309 unsigned nbits = BitWidth, i = 4;
1310 APInt testy(BitWidth, 16);
1311 APInt x_old(BitWidth, 1);
1312 APInt x_new(BitWidth, 0);
1313 APInt two(BitWidth, 2);
1359 // BitWidth bits suffice for all the computations in the algorithm implemented
1365 APInt t[2] = { APInt(BitWidth, 0), APInt(BitWidth, 1) };
1366 APInt q(BitWidth, 0);
1383 return APInt(BitWidth, 0);
1775 if (Quotient->BitWidth != LHS.BitWidth) {
1780 Quotient->BitWidth = LHS.BitWidth;
1806 if (Remainder->BitWidth != RHS.BitWidth) {
1811 Remainder->BitWidth = RHS.BitWidth;
1844 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
1849 return APInt(BitWidth, VAL / RHS.VAL);
1862 return APInt(BitWidth, 0);
1865 return APInt(BitWidth, 0);
1868 return APInt(BitWidth, 1);
1871 return APInt(BitWidth, this->pVal[0] / RHS.pVal[0]);
1892 assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
1895 return APInt(BitWidth, VAL % RHS.VAL);
1910 return APInt(BitWidth, 0);
1916 return APInt(BitWidth, 0);
1919 return APInt(BitWidth, pVal[0] % RHS.pVal[0]);
2258 dbgs() << "APInt(" << BitWidth << "b, "