Lines Matching full:bitwidth
35 /// getBitWidth - Returns the bitwidth of the given scalar or pointer type (if
36 /// unknown returns 0). For vector types, returns the element type's bitwidth.
38 if (unsigned BitWidth = Ty->getScalarSizeInBits())
39 return BitWidth;
65 unsigned BitWidth = Mask.getBitWidth();
69 TD->getTypeSizeInBits(V->getType()->getScalarType()) == BitWidth) &&
71 V->getType()->getScalarSizeInBits() == BitWidth) &&
72 KnownZero.getBitWidth() == BitWidth &&
73 KnownOne.getBitWidth() == BitWidth &&
74 "V, Mask, KnownOne and KnownZero should have same BitWidth");
94 APInt KnownZero2(BitWidth, 0), KnownOne2(BitWidth, 0);
116 KnownZero = Mask & APInt::getLowBitsSet(BitWidth,
139 KnownZero = Mask & APInt::getLowBitsSet(BitWidth,
200 APInt Mask2 = APInt::getAllOnesValue(BitWidth);
216 BitWidth) - BitWidth;
218 TrailZ = std::min(TrailZ, BitWidth);
219 LeadZ = std::min(LeadZ, BitWidth);
220 KnownZero = APInt::getLowBitsSet(BitWidth, TrailZ) |
221 APInt::getHighBitsSet(BitWidth, LeadZ);
229 APInt AllOnes = APInt::getAllOnesValue(BitWidth);
239 if (RHSUnknownLeadingOnes != BitWidth)
240 LeadZ = std::min(BitWidth,
241 LeadZ + BitWidth - RHSUnknownLeadingOnes - 1);
243 KnownZero = APInt::getHighBitsSet(BitWidth, LeadZ) & Mask;
286 KnownZero = KnownZero.zextOrTrunc(BitWidth);
287 KnownOne = KnownOne.zextOrTrunc(BitWidth);
289 if (BitWidth > SrcBitWidth)
290 KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
315 KnownZero = KnownZero.zext(BitWidth);
316 KnownOne = KnownOne.zext(BitWidth);
321 KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
323 KnownOne |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
329 uint64_t ShiftAmt = SA->getLimitedValue(BitWidth);
336 KnownZero |= APInt::getLowBitsSet(BitWidth, ShiftAmt); // low bits known 0
344 uint64_t ShiftAmt = SA->getLimitedValue(BitWidth);
354 KnownZero |= APInt::getHighBitsSet(BitWidth, ShiftAmt);
362 uint64_t ShiftAmt = SA->getLimitedValue(BitWidth-1);
372 APInt HighBits(APInt::getHighBitsSet(BitWidth, ShiftAmt));
373 if (KnownZero[BitWidth-ShiftAmt-1]) // New bits are known zero.
375 else if (KnownOne[BitWidth-ShiftAmt-1]) // New bits are known one.
387 // NLZ can't be BitWidth with no sign bit
388 APInt MaskV = APInt::getHighBitsSet(BitWidth, NLZ+1);
398 KnownZero = APInt::getHighBitsSet(BitWidth, NLZ2) & Mask;
409 APInt LHSKnownZero(BitWidth, 0), LHSKnownOne(BitWidth, 0);
410 APInt Mask2 = APInt::getLowBitsSet(BitWidth,
411 BitWidth - Mask.countLeadingZeros());
427 APInt Mask = APInt::getLowBitsSet(BitWidth, LHSKnownZeroOut);
433 KnownZero |= APInt::getLowBitsSet(BitWidth,
438 APInt Mask = APInt::getLowBitsSet(BitWidth, RHSKnownZeroOut);
450 KnownZero |= APInt::getSignBit(BitWidth);
453 KnownOne |= APInt::getSignBit(BitWidth);
457 KnownZero |= APInt::getSignBit(BitWidth);
460 KnownOne |= APInt::getSignBit(BitWidth);
472 APInt Mask2 = LowBits | APInt::getSignBit(BitWidth);
482 if (KnownZero2[BitWidth-1] || ((KnownZero2 & LowBits) == LowBits))
487 if (KnownOne2[BitWidth-1] && ((KnownOne2 & LowBits) != 0))
500 APInt Mask2 = APInt::getSignBit(BitWidth);
501 APInt LHSKnownZero(BitWidth, 0), LHSKnownOne(BitWidth, 0);
526 APInt AllOnes = APInt::getAllOnesValue(BitWidth);
535 KnownZero = APInt::getHighBitsSet(BitWidth, Leaders) & Mask;
546 KnownZero = Mask & APInt::getLowBitsSet(BitWidth,
553 APInt LocalMask = APInt::getAllOnesValue(BitWidth);
554 APInt LocalKnownZero(BitWidth, 0), LocalKnownOne(BitWidth, 0);
586 KnownZero = APInt::getLowBitsSet(BitWidth, TrailZ) & Mask;
621 APInt Mask2 = APInt::getAllOnesValue(BitWidth);
623 Mask2 = APInt::getLowBitsSet(BitWidth,
631 APInt::getLowBitsSet(BitWidth,
650 KnownZero = APInt::getAllOnesValue(BitWidth);
651 KnownOne = APInt::getAllOnesValue(BitWidth);
656 KnownZero2 = APInt(BitWidth, 0);
657 KnownOne2 = APInt(BitWidth, 0);
679 unsigned LowBits = Log2_32(BitWidth)+1;
680 KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - LowBits);
697 unsigned BitWidth = getBitWidth(V->getType(), TD);
698 if (!BitWidth) {
703 APInt ZeroBits(BitWidth, 0);
704 APInt OneBits(BitWidth, 0);
705 ComputeMaskedBits(V, APInt::getSignBit(BitWidth), ZeroBits, OneBits, TD,
707 KnownOne = OneBits[BitWidth - 1];
708 KnownZero = ZeroBits[BitWidth - 1];
773 unsigned BitWidth = getBitWidth(V->getType(), TD);
786 if (BitWidth && match(V, m_Shl(m_Value(X), m_Value(Y)))) {
792 APInt KnownZero(BitWidth, 0);
793 APInt KnownOne(BitWidth, 0);
794 ComputeMaskedBits(X, APInt(BitWidth, 1), KnownZero, KnownOne, TD, Depth);
832 if (BitWidth && XKnownNegative && YKnownNegative) {
833 APInt KnownZero(BitWidth, 0);
834 APInt KnownOne(BitWidth, 0);
835 APInt Mask = APInt::getSignedMaxValue(BitWidth);
861 if (!BitWidth) return false;
862 APInt KnownZero(BitWidth, 0);
863 APInt KnownOne(BitWidth, 0);
864 ComputeMaskedBits(V, APInt::getAllOnesValue(BitWidth), KnownZero, KnownOne,