Skip to content

vector.dot4i

vector dialect

Group adjacent four-lane i8 products along the last axis and add each four-product sum into an i32 accumulator lane. The signedness template chooses how lhs and rhs i8 lanes are interpreted, matching dp4a/VNNI-style hardware operations.

Operation contract

Property Value
Semantic phase executable
Traits Pure

Signature

Kind Name Type Cardinality Description
Operand lhs vector required Integer source lanes grouped in fours along the last axis.
Operand rhs vector required Integer source lanes grouped in fours along the last axis.
Operand acc vector required Integer accumulator lanes updated by each four-lane dot product.
Result result vector required Updated i32 accumulator lanes.
Attribute kind enum IntegerDot4Kind required

Verification constraints

  • HasI8Element(lhs)
  • HasI8Element(rhs)
  • HasI32Element(acc)
  • SameShape(lhs, rhs)
  • SameType(acc, result)
  • LastAxisGroupedBy(lhs, result)

Examples

%r = vector.dot4i<s8s8> %lhs, %rhs, %acc : vector<16xi8>, vector<16xi8>, vector<4xi32>
%r = vector.dot4i<u8s8> %lhs, %rhs, %acc : vector<2x16xi8>, vector<2x16xi8>, vector<2x4xi32>