@@ -152,6 +152,34 @@ class CheckImmOperand_s<int Index, string Value> : CheckOperandBase<Index> {
152152 string ImmVal = Value;
153153}
154154
155+ // Check that the operand at position `Index` is less than `Imm`.
156+ // If field `FunctionMapper` is a non-empty string, then function
157+ // `FunctionMapper` is applied to the operand value, and the return value is then
158+ // compared against `Imm`.
159+ class CheckImmOperandLT<int Index, int Imm> : CheckOperandBase<Index> {
160+ int ImmVal = Imm;
161+ }
162+
163+ // Check that the operand at position `Index` is greater than `Imm`.
164+ // If field `FunctionMapper` is a non-empty string, then function
165+ // `FunctionMapper` is applied to the operand value, and the return value is then
166+ // compared against `Imm`.
167+ class CheckImmOperandGT<int Index, int Imm> : CheckOperandBase<Index> {
168+ int ImmVal = Imm;
169+ }
170+
171+ // Check that the operand at position `Index` is less than or equal to `Imm`.
172+ // If field `FunctionMapper` is a non-empty string, then function
173+ // `FunctionMapper` is applied to the operand value, and the return value is then
174+ // compared against `Imm`.
175+ class CheckImmOperandLE<int Index, int Imm> : CheckNot<CheckImmOperandGT<Index, Imm>>;
176+
177+ // Check that the operand at position `Index` is greater than or equal to `Imm`.
178+ // If field `FunctionMapper` is a non-empty string, then function
179+ // `FunctionMapper` is applied to the operand value, and the return value is then
180+ // compared against `Imm`.
181+ class CheckImmOperandGE<int Index, int Imm> : CheckNot<CheckImmOperandLT<Index, Imm>>;
182+
155183// Expands to a call to `FunctionMapper` if field `FunctionMapper` is set.
156184// Otherwise, it expands to a CheckNot<CheckInvalidRegOperand<Index>>.
157185class CheckRegOperandSimple<int Index> : CheckOperandBase<Index>;
@@ -203,6 +231,12 @@ class CheckAll<list<MCInstPredicate> Sequence>
203231class CheckAny<list<MCInstPredicate> Sequence>
204232 : CheckPredicateSequence<Sequence>;
205233
234+ // Check that the operand at position `Index` is in range [Start, End].
235+ // If field `FunctionMapper` is a non-empty string, then function
236+ // `FunctionMapper` is applied to the operand value, and the return value is then
237+ // compared against range [Start, End].
238+ class CheckImmOperandRange<int Index, int Start, int End>
239+ : CheckAll<[CheckImmOperandGE<Index, Start>, CheckImmOperandLE<Index, End>]>;
206240
207241// Used to expand the body of a function predicate. See the definition of
208242// TIIPredicate below.
0 commit comments