vector.mask.range
← vector dialect
Construct an i1 tail mask from an explicit scalar coordinate range. For logical lane ordinal i, the lane is true when lower_bound + i * step is strictly less than upper_bound using the coordinate domain's signed ordering. The bracketed syntax mirrors scf.for ranges because the same inclusive-lower, exclusive-upper semantics are being tested; the result vector type supplies the number and shape of lanes to test.
Operation contract
| Property |
Value |
| Semantic phase |
— |
| Traits |
Pure, RefinableResultTypeRefs |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
lower_bound |
scalar |
required |
First coordinate tested by lane 0. |
| Operand |
upper_bound |
scalar |
required |
Exclusive coordinate bound. |
| Operand |
step |
scalar |
required |
Coordinate delta between adjacent logical lanes. |
| Result |
result |
vector |
required |
— |
Verification constraints
HasI1Element(result)
HasIndexOrNonI1IntegerScalar(lower_bound)
SameType(lower_bound, upper_bound, step)
Examples
%mask = vector.mask.range [%iv to %n step %c1] : index -> vector<16xi1>
%mask = vector.mask.range [%base to %limit step %stride] : i32 -> vector<8xi1>