Skip to content

vector.bitfield.extractu

vector dialect

Extract one fixed bitfield from each integer source lane and zero-extend it into the corresponding result lane. The bitfield is identified by least-significant-bit offset and width.

Operation contract

Property Value
Semantic phase executable
Traits Pure, Elementwise

Signature

Kind Name Type Cardinality Description
Operand source vector required
Result result vector required
Attribute offset i64 required Least-significant bit position of the field within each source lane.
Attribute width i64 required Number of bits in the field extracted or inserted in each lane.

Verification constraints

  • HasIntegerElement(source)
  • HasIntegerElement(result)
  • SameKind(source, result)
  • SameShape(source, result)
  • BitRangeWithinElementWidth(source, offset, width)
  • ElementWidthAtLeastAttr(result, width)

Examples

%lo = vector.bitfield.extractu %bytes {offset = 0, width = 4} : vector<16xi8> -> vector<16xi32>