Lines Matching full:v
56 ReprT V;
63 template <typename T> explicit Integral(T V) : V(V) {}
69 Integral() : V(0) {}
73 explicit Integral(Integral<SrcBits, SrcSign> V) : V(V.V) {}
76 explicit Integral(const APSInt &V)
77 : V(V.isSigned() ? V.getSExtValue() : V.getZExtValue()) {}
79 bool operator<(Integral RHS) const { return V < RHS.V; }
80 bool operator>(Integral RHS) const { return V > RHS.V; }
81 bool operator<=(Integral RHS) const { return V <= RHS.V; }
82 bool operator>=(Integral RHS) const { return V >= RHS.V; }
83 bool operator==(Integral RHS) const { return V == RHS.V; }
84 bool operator!=(Integral RHS) const { return V != RHS.V; }
87 return V >= 0 && static_cast<unsigned>(V) > RHS;
90 Integral operator-() const { return Integral(-V); }
92 return Integral(V - Other.V);
94 Integral operator~() const { return Integral(~V); }
98 return Integral<DstBits, DstSign>(V);
103 return V;
107 return APSInt(APInt(Bits, static_cast<uint64_t>(V), Signed), !Signed);
123 bool isZero() const { return !V; }
127 bool isMinusOne() const { return Signed && V == ReprT(-1); }
131 bool isNegative() const { return V < ReprT(0); }
135 return Compare(V, RHS.V);
141 OS << V;
147 return llvm::countl_zero<ReprT>(V);
157 return Integral((V & BitMask) | (Signed && (V & SignBit) ? ExtMask : 0));
160 void print(llvm::raw_ostream &OS) const { OS << V; }
179 return Integral(Value.V);
201 return CheckAddUB(A.V, B.V, R->V);
205 return CheckSubUB(A.V, B.V, R->V);
209 return CheckMulUB(A.V, B.V, R->V);
213 *R = Integral(A.V % B.V);
218 *R = Integral(A.V / B.V);
223 *R = Integral(A.V & B.V);
228 *R = Integral(A.V | B.V);
233 *R = Integral(A.V ^ B.V);
246 *R = Integral(~A.V);
253 *R = Integral::from(A.V << B.V, OpBits);
259 *R = Integral::from(A.V >> B.V, OpBits);
289 template <typename T, T Min, T Max> static bool CheckRange(int64_t V) {
291 return Min <= V && V <= Max;
293 return V >= 0 && static_cast<uint64_t>(V) <= Max;