Skip to content

vector.table.lookup

vector dialect

Select values from a rank-1 register table using integer index lanes. Each result lane reads table[indices lane]; the result shape matches the index vector shape and the result element type matches the table element type.

Operation contract

Property Value
Semantic phase
Traits Pure
Target contracts vector.table_lookup

Signature

Kind Name Type Cardinality Description
Operand table vector required Rank-1 register table containing selectable lane values.
Operand indices vector required Index vector selecting one table lane for each result lane.
Result result vector required

Verification constraints

  • HasRankOneVector(table)
  • HasIndexOrNonI1IntegerElement(indices)
  • SameElementType(table, result)
  • SameShape(indices, result)

Examples

%values = vector.table.lookup %grid[%codes] : vector<16xf16>, vector<32xi8> -> vector<32xf16>
%values = vector.table.lookup %grid[%codes] : vector<16xf32>, vector<4x8xi8> -> vector<4x8xf32>