Lines Matching full:v

36   APInt V;
39 static T truncateCast(const APInt &V) {
41 if (BitSize >= V.getBitWidth()) {
44 Extended = V.sext(BitSize);
46 Extended = V.zext(BitSize);
51 return std::is_signed_v<T> ? V.trunc(BitSize).getSExtValue()
52 : V.trunc(BitSize).getZExtValue();
60 : V(APInt(BitWidth, static_cast<uint64_t>(Value), Signed)) {}
62 IntegralAP(APInt V) : V(V) {}
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);
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);
122 return IntegralAP(V);
125 constexpr unsigned bitWidth() const { return V.getBitWidth(); }
132 return APSInt(V.sext(Bits), !Signed);
134 return APSInt(V.zext(Bits), !Signed);
138 bool isZero() const { return V.isZero(); }
139 bool isPositive() const { return V.isNonNegative(); }
140 bool isNegative() const { return !V.isNonNegative(); }
141 bool isMin() const { return V.isMinValue(); }
142 bool isMax() const { return V.isMaxValue(); }
144 bool isMinusOne() const { return Signed && V == -1; }
146 unsigned countLeadingZeros() const { return V.countl_zero(); }
148 void print(llvm::raw_ostream &OS) const { OS << V; }
158 return IntegralAP(V.trunc(BitWidth).sextOrTrunc(this->bitWidth()));
160 return IntegralAP(V.trunc(BitWidth).zextOrTrunc(this->bitWidth()));
164 APInt Copy = V;
172 if (V.slt(RHS.V))
174 if (V.sgt(RHS.V))
180 if (V.ult(RHS.V))
182 if (V.ugt(RHS.V))
211 *R = IntegralAP(A.V.srem(B.V));
213 *R = IntegralAP(A.V.urem(B.V));
219 *R = IntegralAP(A.V.sdiv(B.V));
221 *R = IntegralAP(A.V.udiv(B.V));
227 *R = IntegralAP(A.V & B.V);
233 *R = IntegralAP(A.V | B.V);
239 *R = IntegralAP(A.V ^ B.V);
244 APInt AI = A.V;
251 *R = IntegralAP(~A.V);
257 *R = IntegralAP(A.V.shl(B.V.getZExtValue()));
262 unsigned ShiftAmount = B.V.getZExtValue();
264 *R = IntegralAP(A.V.ashr(ShiftAmount));
266 *R = IntegralAP(A.V.lshr(ShiftAmount));
272 return sizeof(uint32_t) + (V.getBitWidth() / CHAR_BIT);
276 assert(V.getBitWidth() < std::numeric_limits<uint8_t>::max());
277 uint32_t BitWidth = V.getBitWidth();
280 llvm::StoreIntToMemory(V, (uint8_t *)(Buff + sizeof(uint32_t)),
289 llvm::LoadIntFromMemory(Val.V, (const uint8_t *)Buff + sizeof(uint32_t),
299 R->V = Op<APInt>{}(A.V, B.V);
307 R->V = Result;