Lines Matching full:known

1 //===-- KnownBits.cpp - Stores known zeros/ones ---------------------------===//
9 // This file contains a class for representing known zeros and ones used by
27 // Compute known bits of the carry.
31 // Compute set of known bits (where all three relevant bits are known).
35 APInt Known = std::move(LHSKnownUnion) & RHSKnownUnion & CarryKnownUnion;
37 // Compute known bits of the result.
39 KnownOut.Zero = ~std::move(PossibleSumZero) & Known;
40 KnownOut.One = std::move(PossibleSumOne) & Known;
168 // known to be less than or equal to Val.
189 // the minimum possible value of RHS. Likewise for RHS. Any known bits that
190 // are common to these two values are also known in the result.
289 KnownBits Known;
291 Known.Zero = LHS.Zero.ushl_ov(ShiftAmt, ShiftedOutZero);
292 Known.Zero.setLowBits(ShiftAmt);
293 Known.One = LHS.One.ushl_ov(ShiftAmt, ShiftedOutOne);
302 Known.makeNonNegative();
304 Known.makeNegative();
306 return Known;
310 KnownBits Known(BitWidth);
315 Known.Zero.setLowBits(MinShiftAmount);
317 Known.makeNonNegative();
318 return Known;
336 Known.Zero.setLowBits(LHS.countMinTrailingZeros());
338 Known.One.setSignBit();
341 Known.makeNonNegative();
343 Known.makeNegative();
345 return Known;
351 Known.Zero.setAllBits();
352 Known.One.setAllBits();
359 Known = Known.intersectWith(ShiftByConst(LHS, ShiftAmt));
360 if (Known.isUnknown())
365 if (Known.hasConflict())
366 Known.setAllZero();
367 return Known;
374 KnownBits Known = LHS;
375 Known.Zero.lshrInPlace(ShiftAmt);
376 Known.One.lshrInPlace(ShiftAmt);
377 // High bits are known zero.
378 Known.Zero.setHighBits(ShiftAmt);
379 return Known;
383 KnownBits Known(BitWidth);
388 Known.Zero.setHighBits(MinShiftAmount);
389 return Known;
396 // If exact, bound MaxShiftAmount to first known 1 in LHS.
401 Known.setAllZero();
402 return Known;
409 Known.Zero.setAllBits();
410 Known.One.setAllBits();
417 Known = Known.intersectWith(ShiftByConst(LHS, ShiftAmt));
418 if (Known.isUnknown())
423 if (Known.hasConflict())
424 Known.setAllZero();
425 return Known;
432 KnownBits Known = LHS;
433 Known.Zero.ashrInPlace(ShiftAmt);
434 Known.One.ashrInPlace(ShiftAmt);
435 return Known;
439 KnownBits Known(BitWidth);
446 Known.setAllZero();
447 return Known;
449 return Known;
456 // If exact, bound MaxShiftAmount to first known 1 in LHS.
461 Known.setAllZero();
462 return Known;
469 Known.Zero.setAllBits();
470 Known.One.setAllBits();
477 Known = Known.intersectWith(ShiftByConst(LHS, ShiftAmt));
478 if (Known.isUnknown())
483 if (Known.hasConflict())
484 Known.setAllZero();
485 return Known;
577 // to the high bits. If we know a known INT_MIN input skip this. The result
695 // respectively, so we can preserve known ones/zeros.
742 // We need to clear all the known zeros as we can only use the leading ones.
746 // We need to clear all the known ones as we can only use the leading zero.
804 // Compute the high known-0 bits by multiplying the unsigned max of each side.
821 // We can infer at least the minimum number of known trailing bits
857 // Where C5, C6 describe the known bits of %a, %b
858 // C1, C2 describe the known bottom bits of %a, %b.
859 // C7 describes the mask of the known bits of the result.
871 // Figure out the fewest known-bits operand.
910 static KnownBits divComputeLowBit(KnownBits Known, const KnownBits &LHS,
914 return Known;
920 Known.One.setBit(0);
928 Known.Zero.setLowBits(MinTZ);
931 Known.One.setBit(MinTZ);
935 Known.setAllZero();
940 if (Known.hasConflict())
941 Known.setAllZero();
943 return Known;
953 KnownBits Known(BitWidth);
956 // Result is either known Zero or UB. Return Zero either way.
958 Known.setAllZero();
959 return Known;
991 Known.Zero.setHighBits(LeadZ);
994 Known.One.setHighBits(LeadO);
998 Known = divComputeLowBit(Known, LHS, RHS, Exact);
999 return Known;
1005 KnownBits Known(BitWidth);
1008 // Result is either known Zero or UB. Return Zero either way.
1010 Known.setAllZero();
1011 return Known;
1023 Known.Zero.setHighBits(LeadZ);
1024 Known = divComputeLowBit(Known, LHS, RHS, Exact);
1026 return Known;
1043 KnownBits Known = remGetLowBits(LHS, RHS);
1047 Known.Zero |= HighBits;
1048 return Known;
1055 Known.Zero.setHighBits(Leaders);
1056 return Known;
1060 KnownBits Known = remGetLowBits(LHS, RHS);
1067 Known.Zero |= ~LowBits;
1072 Known.One |= ~LowBits;
1073 return Known;
1080 Known.Zero.setHighBits(LHS.countMinLeadingZeros());
1081 return Known;
1111 KnownBits Known(Zero, APInt(BitWidth, 0));
1113 Known.Zero.setBitsFrom(std::min(Max + 1, BitWidth));
1116 Known.One.setBit(Max);
1117 return Known;
1122 KnownBits Known(BitWidth);
1124 Known.Zero.setBitsFrom(std::min(Max + 1, BitWidth));
1126 Known.One.setLowBits(std::min(Min + 1, BitWidth));
1127 return Known;