Skip to content

vector.interleave

vector dialect

Interleave two same-typed vectors along the template axis. Result positions with even coordinates along that axis come from the first operand, odd coordinates come from the second operand, and the result extent on that axis is doubled.

Operation contract

Property Value
Semantic phase
Traits Pure

Signature

Kind Name Type Cardinality Description
Operand even vector required Vector providing result lanes at even positions along the interleaved axis.
Operand odd vector required Vector providing result lanes at odd positions along the interleaved axis.
Result result vector required
Attribute axis i64 required Axis whose extent is doubled in the result.

Verification constraints

  • SameType(even, odd)
  • SameElementType(even, result)
  • DimIndexInBounds(even, axis)

Examples

%r = vector.interleave<0> %lo, %hi : vector<16xi8>, vector<16xi8> -> vector<32xi8>
%r = vector.interleave<1> %a, %b : vector<4x8xi8>, vector<4x8xi8> -> vector<4x16xi8>