Lines Matching refs:V
36 APInt V; variable
39 static T truncateCast(const APInt &V) { in truncateCast() argument
41 if (BitSize >= V.getBitWidth()) { in truncateCast()
44 Extended = V.sext(BitSize); in truncateCast()
46 Extended = V.zext(BitSize); in truncateCast()
51 return std::is_signed_v<T> ? V.trunc(BitSize).getSExtValue() in truncateCast()
52 : V.trunc(BitSize).getZExtValue(); in truncateCast()
60 : V(APInt(BitWidth, static_cast<uint64_t>(Value), Signed)) {} in IntegralAP()
62 IntegralAP(APInt V) : V(V) {} in IntegralAP() argument
66 IntegralAP operator-() const { return IntegralAP(-V); }
68 return IntegralAP(V - Other.V);
72 return V.ugt(RHS.V);
73 return V.sgt(RHS.V);
77 return V.uge(RHS.V);
78 return V.sge(RHS.V);
82 return V.slt(RHS.V);
83 return V.slt(RHS.V);
87 return V.ult(RHS.V);
88 return V.ult(RHS.V);
93 return truncateCast<Ty, Signed>(V); in Ty()
104 static IntegralAP from(IntegralAP<InputSigned> V, unsigned NumBits = 0) {
106 NumBits = V.bitWidth();
109 return IntegralAP<Signed>(V.V.sextOrTrunc(NumBits));
110 return IntegralAP<Signed>(V.V.zextOrTrunc(NumBits));
121 APInt V = APInt(BitWidth, 0LL, Signed); in zero() local
122 return IntegralAP(V); in zero()
125 constexpr unsigned bitWidth() const { return V.getBitWidth(); } in bitWidth()
132 return APSInt(V.sext(Bits), !Signed);
134 return APSInt(V.zext(Bits), !Signed);
138 bool isZero() const { return V.isZero(); } in isZero()
139 bool isPositive() const { return V.isNonNegative(); } in isPositive()
140 bool isNegative() const { return !V.isNonNegative(); } in isNegative()
141 bool isMin() const { return V.isMinValue(); } in isMin()
142 bool isMax() const { return V.isMaxValue(); } in isMax()
144 bool isMinusOne() const { return Signed && V == -1; } in isMinusOne()
146 unsigned countLeadingZeros() const { return V.countl_zero(); } in countLeadingZeros()
148 void print(llvm::raw_ostream &OS) const { OS << V; } in print()
158 return IntegralAP(V.trunc(BitWidth).sextOrTrunc(this->bitWidth())); in truncate()
160 return IntegralAP(V.trunc(BitWidth).zextOrTrunc(this->bitWidth())); in truncate()
164 APInt Copy = V; in toUnsigned()
172 if (V.slt(RHS.V)) in compare()
174 if (V.sgt(RHS.V)) in compare()
180 if (V.ult(RHS.V)) in compare()
182 if (V.ugt(RHS.V)) in compare()
211 *R = IntegralAP(A.V.srem(B.V)); in rem()
213 *R = IntegralAP(A.V.urem(B.V)); in rem()
219 *R = IntegralAP(A.V.sdiv(B.V)); in div()
221 *R = IntegralAP(A.V.udiv(B.V)); in div()
227 *R = IntegralAP(A.V & B.V); in bitAnd()
233 *R = IntegralAP(A.V | B.V); in bitOr()
239 *R = IntegralAP(A.V ^ B.V); in bitXor()
244 APInt AI = A.V; in neg()
251 *R = IntegralAP(~A.V); in comp()
257 *R = IntegralAP(A.V.shl(B.V.getZExtValue())); in shiftLeft()
262 unsigned ShiftAmount = B.V.getZExtValue(); in shiftRight()
264 *R = IntegralAP(A.V.ashr(ShiftAmount)); in shiftRight()
266 *R = IntegralAP(A.V.lshr(ShiftAmount)); in shiftRight()
272 return sizeof(uint32_t) + (V.getBitWidth() / CHAR_BIT); in bytesToSerialize()
276 assert(V.getBitWidth() < std::numeric_limits<uint8_t>::max()); in serialize()
277 uint32_t BitWidth = V.getBitWidth(); in serialize()
280 llvm::StoreIntToMemory(V, (uint8_t *)(Buff + sizeof(uint32_t)), in serialize()
289 llvm::LoadIntFromMemory(Val.V, (const uint8_t *)Buff + sizeof(uint32_t), in deserialize()
299 R->V = Op<APInt>{}(A.V, B.V); in CheckAddSubMulUB()
307 R->V = Result; in CheckAddSubMulUB()