Home
last modified time | relevance | path

Searched refs:APInt (Results 1 – 25 of 563) sorted by relevance

12345678910>>...23

/freebsd/contrib/llvm-project/llvm/include/llvm/ADT/
H A DAPInt.h39 class APInt; variable
41 inline APInt operator-(APInt);
78 class [[nodiscard]] APInt {
111 APInt(unsigned numBits, uint64_t val, bool isSigned = false)
128 APInt(unsigned numBits, ArrayRef<uint64_t> bigVal);
137 APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
150 APInt(unsigned numBits, StringRef str, uint8_t radix);
153 explicit APInt() { U.VAL = 0; } in APInt() function
156 APInt(const APInt &that) : BitWidth(that.BitWidth) { in APInt() function
164 APInt(APInt &&that) : BitWidth(that.BitWidth) { in APInt() function
[all …]
H A DAPSInt.h23 class [[nodiscard]] APSInt : public APInt {
32 : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {}
34 explicit APSInt(APInt I, bool isUnsigned = true)
35 : APInt(std::move(I)), IsUnsigned(isUnsigned) {} in APInt() function
49 bool isNegative() const { return isSigned() && APInt::isNegative(); } in isNegative()
64 APSInt &operator=(APInt RHS) {
66 APInt::operator=(std::move(RHS));
72 APInt::operator=(RHS);
84 APInt::toString(Str, Radix, isSigned());
86 using APInt::toString;
[all …]
H A DAPFloat.h144 typedef APInt::WordType integerPart;
145 static constexpr unsigned integerPartWidth = APInt::APINT_BITS_PER_WORD;
321 IEEEFloat(const fltSemantics &, const APInt &);
369 opStatus convertFromAPInt(const APInt &, bool, roundingMode);
375 APInt bitcastToAPInt() const;
549 const APInt *fill = nullptr);
635 template <const fltSemantics &S> APInt convertIEEEFloatToAPInt() const;
636 APInt convertHalfAPFloatToAPInt() const;
637 APInt convertBFloatAPFloatToAPInt() const;
638 APInt convertFloatAPFloatToAPInt() const;
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Support/
H A DAPInt.cpp76 void APInt::initSlowCase(uint64_t val, bool isSigned) { in initSlowCase()
85 void APInt::initSlowCase(const APInt& that) { in initSlowCase()
90 void APInt::initFromArray(ArrayRef<uint64_t> bigVal) { in initFromArray()
106 APInt::APInt(unsigned numBits, ArrayRef<uint64_t> bigVal) : BitWidth(numBits) { in APInt() function in APInt
110 APInt::APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]) in APInt() function in APInt
115 APInt::APInt(unsigned numbits, StringRef Str, uint8_t radix) in APInt() function in APInt
120 void APInt::reallocate(unsigned NewBitWidth) { in reallocate()
139 void APInt::assignSlowCase(const APInt &RHS) { in assignSlowCase()
155 void APInt::Profile(FoldingSetNodeID& ID) const { in Profile()
168 bool APInt::isAligned(Align A) const { in isAligned()
[all …]
H A DDivisionByConstantInfo.cpp21 SignedDivisionByConstantInfo SignedDivisionByConstantInfo::get(const APInt &D) { in get()
27 APInt Delta; in get()
28 APInt SignedMin = APInt::getSignedMinValue(D.getBitWidth()); in get()
31 APInt AD = D.abs(); in get()
32 APInt T = SignedMin + (D.lshr(D.getBitWidth() - 1)); in get()
33 APInt ANC = T - 1 - T.urem(AD); // absolute value of NC in get()
35 APInt Q1, R1, Q2, R2; in get()
37 APInt::udivrem(SignedMin, ANC, Q1, R1); in get()
39 APInt::udivrem(SignedMin, AD, Q2, R2); in get()
74 UnsignedDivisionByConstantInfo::get(const APInt &D, unsigned LeadingZeros, in get()
[all …]
H A DKnownBits.cpp24 APInt PossibleSumZero = LHS.getMaxValue() + RHS.getMaxValue() + !CarryZero; in computeForAddCarry()
25 APInt PossibleSumOne = LHS.getMinValue() + RHS.getMinValue() + CarryOne; in computeForAddCarry()
28 APInt CarryKnownZero = ~(PossibleSumZero ^ LHS.Zero ^ RHS.Zero); in computeForAddCarry()
29 APInt CarryKnownOne = PossibleSumOne ^ LHS.One ^ RHS.One; in computeForAddCarry()
32 APInt LHSKnownUnion = LHS.Zero | LHS.One; in computeForAddCarry()
33 APInt RHSKnownUnion = RHS.Zero | RHS.One; in computeForAddCarry()
34 APInt CarryKnownUnion = std::move(CarryKnownZero) | CarryKnownOne; in computeForAddCarry()
35 APInt Known = std::move(LHSKnownUnion) & RHSKnownUnion & CarryKnownUnion; in computeForAddCarry()
79 APInt MinVal = LHS.getMinValue().uadd_sat(RHS.getMinValue()); in computeForAddSub()
91 APInt MaxVal = LHS.getMaxValue().usub_sat(RHS.getMinValue()); in computeForAddSub()
[all …]
H A DAPFloat.cpp652 lsb = APInt::tcLSB(parts, partCount); in lostFractionThroughTruncation()
660 APInt::tcExtractBit(parts, bits - 1)) in lostFractionThroughTruncation()
674 APInt::tcShiftRight(dst, parts, bits); in shiftRight()
783 APInt::tcFullMultiply(pow5, pow5 - partsCount, pow5 - partsCount, in powerOf5()
793 APInt::tcFullMultiply(p2, p1, pow5, result, partsCount); in powerOf5()
809 APInt::tcAssign(dst, p1, result); in powerOf5()
904 APInt::tcAssign(significandParts(), rhs.significandParts(), in copySignificand()
911 void IEEEFloat::makeNaN(bool SNaN, bool Negative, const APInt *fill) { in makeNaN()
922 APInt fill_storage; in makeNaN()
929 fill_storage = APInt::getZero(semantics->precision - 1); in makeNaN()
[all …]
H A DSlowDynamicAPInt.cpp20 SlowDynamicAPInt::SlowDynamicAPInt(const APInt &Val) : Val(Val) {} in SlowDynamicAPInt()
117 static unsigned getMaxWidth(const APInt &A, const APInt &B) { in getMaxWidth()
159 APInt runOpWithExpandOnOverflow( in runOpWithExpandOnOverflow()
160 const APInt &A, const APInt &B, in runOpWithExpandOnOverflow() argument
161 function_ref<APInt(const APInt &, const APInt &, bool &Overflow)> Op) { in runOpWithExpandOnOverflow() argument
164 APInt Ret = Op(A.sext(Width), B.sext(Width), Overflow); in runOpWithExpandOnOverflow()
176 runOpWithExpandOnOverflow(Val, O.Val, std::mem_fn(&APInt::sadd_ov))); in operator +()
180 runOpWithExpandOnOverflow(Val, O.Val, std::mem_fn(&APInt::ssub_ov))); in operator -()
184 runOpWithExpandOnOverflow(Val, O.Val, std::mem_fn(&APInt::smul_ov))); in operator *()
188 runOpWithExpandOnOverflow(Val, O.Val, std::mem_fn(&APInt::sdiv_ov))); in operator /()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/IR/
H A DConstantRange.cpp45 : Lower(Full ? APInt::getMaxValue(BitWidth) : APInt::getMinValue(BitWidth)), in ConstantRange()
48 ConstantRange::ConstantRange(APInt V) in ConstantRange()
51 ConstantRange::ConstantRange(APInt L, APInt U) in ConstantRange()
73 APInt Lower = Known.getMinValue(), Upper = Known.getMaxValue(); in fromKnownBits()
86 APInt Min = getUnsignedMin(); in toKnownBits()
87 APInt Max = getUnsignedMax(); in toKnownBits()
113 APInt UMax(CR.getUnsignedMax()); in makeAllowedICmpRegion()
116 return ConstantRange(APInt::getMinValue(W), std::move(UMax)); in makeAllowedICmpRegion()
119 APInt SMax(CR.getSignedMax()); in makeAllowedICmpRegion()
122 return ConstantRange(APInt::getSignedMinValue(W), std::move(SMax)); in makeAllowedICmpRegion()
[all …]
H A DOperator.cpp112 const DataLayout &DL, APInt &Offset, in accumulateConstantOffset()
113 function_ref<bool(Value &, APInt &)> ExternalAnalysis) const { in accumulateConstantOffset()
124 APInt &Offset, function_ref<bool(Value &, APInt &)> ExternalAnalysis) { in accumulateConstantOffset()
135 auto AccumulateOffset = [&](APInt Index, uint64_t Size) -> bool { in accumulateConstantOffset()
137 APInt IndexedSize = APInt(Offset.getBitWidth(), Size); in accumulateConstantOffset()
145 APInt OffsetPlus = Index.smul_ov(IndexedSize, Overflow); in accumulateConstantOffset()
177 APInt(Offset.getBitWidth(), SL->getElementOffset(ElementIdx)), in accumulateConstantOffset()
192 APInt AnalysisIndex; in accumulateConstantOffset()
204 MapVector<Value *, APInt> &VariableOffsets, in collectOffset()
205 APInt &ConstantOffset) const { in collectOffset()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Analysis/
H A DDemandedBits.cpp56 const APInt &AOut, APInt &AB, KnownBits &Known, KnownBits &Known2, in determineLiveOperandBits()
105 AB = APInt::getHighBitsSet(BitWidth, in determineLiveOperandBits()
115 AB = APInt::getLowBitsSet(BitWidth, in determineLiveOperandBits()
121 const APInt *SA; in determineLiveOperandBits()
147 AB = APInt::getBitsSetFrom(BitWidth, AOut.countr_zero()); in determineLiveOperandBits()
172 AB = APInt::getLowBitsSet(BitWidth, AOut.getActiveBits()); in determineLiveOperandBits()
176 const APInt *ShiftAmtC; in determineLiveOperandBits()
185 AB |= APInt::getHighBitsSet(BitWidth, ShiftAmt+1); in determineLiveOperandBits()
187 AB |= APInt::getHighBitsSet(BitWidth, ShiftAmt); in determineLiveOperandBits()
193 const APInt *ShiftAmtC; in determineLiveOperandBits()
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/IR/
H A DConstantRange.h48 APInt Lower, Upper;
65 ConstantRange(APInt Value);
70 ConstantRange(APInt Lower, APInt Upper);
84 static ConstantRange getNonEmpty(APInt Lower, APInt Upper) { in getNonEmpty()
125 const APInt &Other);
176 const APInt &Other,
182 static ConstantRange makeMaskNotEqualRange(const APInt &Mask, const APInt &C);
195 bool getEquivalentICmp(CmpInst::Predicate &Pred, APInt &RHS) const;
200 getEquivalentICmp(CmpInst::Predicate &Pred, APInt &RHS, APInt &Offset) const;
203 const APInt &getLower() const { return Lower; } in getLower()
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/Analysis/
H A DDemandedBits.h54 APInt getDemandedBits(Instruction *I);
57 APInt getDemandedBits(Use *U);
69 static APInt determineLiveOperandBitsAdd(unsigned OperandNo,
70 const APInt &AOut,
76 static APInt determineLiveOperandBitsSub(unsigned OperandNo,
77 const APInt &AOut,
85 const APInt &AOut, APInt &AB,
96 DenseMap<Instruction *, APInt> AliveBits;
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DLowerSwitch.cpp54 APInt Low, High;
119 const APInt &NumMergedCases) { in FixPhis()
125 APInt LocalNumMergedCases = NumMergedCases; in FixPhis()
210 APInt Range = Leaf.High->getValue() - Leaf.Low->getValue(); in NewLeafBlock()
211 for (APInt j(Range.getBitWidth(), 0, false); j.ult(Range); ++j) { in NewLeafBlock()
242 APInt NumMergedCases = UpperBound->getValue() - LowerBound->getValue(); in SwitchConvert()
273 APInt GapLow = LHS.back().High->getValue() + 1; in SwitchConvert()
274 APInt GapHigh = NewLowerBound->getValue() - 1; in SwitchConvert()
327 const APInt &nextValue = J->Low->getValue(); in Clusterify()
328 const APInt &currentValue = I->High->getValue(); in Clusterify()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/
H A DInstCombineSimplifyDemanded.cpp37 const APInt &Demanded) { in ShrinkDemandedConstant()
43 const APInt *C; in ShrinkDemandedConstant()
70 APInt DemandedMask(APInt::getAllOnes(Known.getBitWidth())); in SimplifyDemandedInstructionBits()
90 const APInt &DemandedMask, in SimplifyDemandedBits()
158 const APInt &DemandedMask, in SimplifyDemandedUseBits()
189 auto simplifyOperandsBasedOnUnusedHighBits = [&](APInt &DemandedFromOps) { in SimplifyDemandedUseBits()
193 DemandedFromOps = APInt::getLowBitsSet(BitWidth, BitWidth - NLZ); in SimplifyDemandedUseBits()
334 const APInt *C; in SimplifyDemandedUseBits()
356 APInt NewMask = ~(LHSKnown.One & RHSKnown.One & DemandedMask); in SimplifyDemandedUseBits()
380 const APInt &DemandedMask) { in SimplifyDemandedUseBits()
[all …]
H A DInstCombineInternal.h49 class APInt; variable
550 Value *SimplifyDemandedUseBits(Instruction *I, const APInt &DemandedMask,
555 const APInt &DemandedMask, KnownBits &Known,
562 const APInt &DemandedMask,
569 Instruction *Shr, const APInt &ShrOp1, Instruction *Shl,
570 const APInt &ShlOp1, const APInt &DemandedMask, KnownBits &Known);
577 Value *SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
578 APInt &PoisonElts, unsigned Depth = 0,
656 Instruction *foldICmpAddOpConst(Value *X, const APInt &C,
668 const APInt &C);
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/
H A DGISelKnownBits.h39 const APInt &DemandedElts,
43 const APInt &DemandedElts, unsigned Depth = 0);
58 const APInt &DemandedElts,
61 unsigned computeNumSignBits(Register R, const APInt &DemandedElts,
67 KnownBits getKnownBits(Register R, const APInt &DemandedElts,
72 APInt getKnownZeroes(Register R);
73 APInt getKnownOnes(Register R);
78 bool maskedValueIsZero(Register Val, const APInt &Mask) { in maskedValueIsZero()
/freebsd/contrib/llvm-project/llvm/lib/Target/Hexagon/
H A DHexagonConstPropagation.cpp13 #include "llvm/ADT/APInt.h"
359 bool constToInt(const Constant *C, APInt &Val) const;
360 const ConstantInt *intToConst(const APInt &Val) const;
365 bool evaluateCMPri(uint32_t Cmp, const RegisterSubReg &R1, const APInt &A2,
369 bool evaluateCMPii(uint32_t Cmp, const APInt &A1, const APInt &A2,
371 bool evaluateCMPpi(uint32_t Cmp, uint32_t Props, const APInt &A2,
382 bool evaluateANDri(const RegisterSubReg &R1, const APInt &A2,
384 bool evaluateANDii(const APInt &A1, const APInt
[all...]
/freebsd/contrib/llvm-project/clang/lib/AST/Interp/
H A DIntegralAP.h29 using APInt = llvm::APInt; variable
36 APInt V;
39 static T truncateCast(const APInt &V) { in truncateCast()
42 APInt Extended; in truncateCast()
60 : V(APInt(BitWidth, static_cast<uint64_t>(Value), Signed)) {} in IntegralAP()
62 IntegralAP(APInt V) : V(V) {} in IntegralAP()
98 APInt Copy = APInt(NumBits, static_cast<uint64_t>(Value), Signed);
115 APInt Copy = APInt(BitWidth, static_cast<uint64_t>(I), InputSigned); in from()
121 APInt V = APInt(BitWidth, 0LL, Signed); in zero()
164 APInt Copy = V; in toUnsigned()
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/
H A DCheckedArithmetic.h30 llvm::APInt ALHS(sizeof(T) * 8, LHS, Signed);
31 llvm::APInt ARHS(sizeof(T) * 8, RHS, Signed);
33 llvm::APInt Out = (ALHS.*Op)(ARHS, Overflow);
48 return checkedOp(LHS, RHS, &llvm::APInt::sadd_ov); in checkedAdd()
57 return checkedOp(LHS, RHS, &llvm::APInt::ssub_ov); in checkedSub()
66 return checkedOp(LHS, RHS, &llvm::APInt::smul_ov); in checkedMul()
86 return checkedOp(LHS, RHS, &llvm::APInt::uadd_ov, /*Signed=*/false); in checkedAddUnsigned()
95 return checkedOp(LHS, RHS, &llvm::APInt::umul_ov, /*Signed=*/false); in checkedMulUnsigned()
H A DKnownBits.h24 APInt Zero;
25 APInt One;
29 KnownBits(APInt Zero, APInt One) in KnownBits()
56 const APInt &getConstant() const { in getConstant()
118 APInt getMinValue() const { in getMinValue()
124 APInt getSignedMinValue() const { in getSignedMinValue()
126 APInt Min = One; in getSignedMinValue()
134 APInt getMaxValue() const { in getMaxValue()
140 APInt getSignedMaxValue() const { in getSignedMaxValue()
142 APInt Max = ~Zero; in getSignedMaxValue()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/M68k/MCTargetDesc/
H A DM68kMCCodeEmitter.cpp44 APInt &Inst, APInt &Scratch,
48 unsigned InsertPos, APInt &Value,
54 APInt &Value, SmallVectorImpl<MCFixup> &Fixups,
59 APInt &Value, SmallVectorImpl<MCFixup> &Fixups,
63 APInt &Value, SmallVectorImpl<MCFixup> &Fixups, in M68kMCCodeEmitter()
118 unsigned InsertPos, APInt &Value, in encodeRelocImm()
145 unsigned InsertPos, APInt &Value, in encodePCRelImm()
180 unsigned InsertPos, APInt &Value, in getMachineOpValue()
200 unsigned InsertPos, APInt in getMachineOpValue()
[all...]
/freebsd/contrib/llvm-project/llvm/lib/Target/X86/
H A DX86ShuffleDecodeConstantPool.cpp27 APInt &UndefElts, in extractConstantMask()
55 UndefElts = APInt(NumMaskElts, 0); in extractConstantMask()
79 APInt UndefBits(CstSizeInBits, 0); in extractConstantMask()
80 APInt MaskBits(CstSizeInBits, 0); in extractConstantMask()
99 APInt EltUndef = UndefBits.extractBits(MaskEltSizeInBits, BitOffset); in extractConstantMask()
109 APInt EltBits = MaskBits.extractBits(MaskEltSizeInBits, BitOffset); in extractConstantMask()
123 APInt UndefElts; in DecodePSHUFBMask()
162 APInt UndefElts; in DecodeVPERMILPMask()
198 APInt UndefElts; in DecodeVPERMIL2PMask()
252 APInt UndefElts; in DecodeVPPERMMask()
/freebsd/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/
H A DRecordSerialization.cpp14 #include "llvm/ADT/APInt.h"
37 // Used to avoid overload ambiguity on APInt constructor. in consume()
44 Num = APSInt(APInt(/*numBits=*/16, Short, /*isSigned=*/false), in consume()
54 Num = APSInt(APInt(8, N, true), false); in consume()
61 Num = APSInt(APInt(16, N, true), false); in consume()
68 Num = APSInt(APInt(16, N, false), true); in consume()
75 Num = APSInt(APInt(32, N, true), false); in consume()
82 Num = APSInt(APInt(32, N, FalseVal), true); in consume()
89 Num = APSInt(APInt(64, N, true), false); in consume()
96 Num = APSInt(APInt(6 in consume()
[all...]
/freebsd/contrib/llvm-project/llvm/lib/Target/X86/MCTargetDesc/
H A DX86ShuffleDecode.h24 class APInt; variable
100 void DecodePSHUFBMask(ArrayRef<uint64_t> RawMask, const APInt &UndefElts,
124 void DecodeVPPERMMask(ArrayRef<uint64_t> RawMask, const APInt &UndefElts,
149 ArrayRef<uint64_t> RawMask, const APInt &UndefElts,
154 ArrayRef<uint64_t> RawMask, const APInt &UndefElts,
158 void DecodeVPERMVMask(ArrayRef<uint64_t> RawMask, const APInt &UndefElts,
162 void DecodeVPERMV3Mask(ArrayRef<uint64_t> RawMask, const APInt &UndefElts,

12345678910>>...23