Skip to content

encoding.define

← encoding dialect

Create an encoding value from a static encoding specification.

Operation contract

Property Value
Semantic phase executable
Traits Pure

Signature

Kind Name Type Cardinality Description
Operand params any variadic —
Result result encoding required —
Attribute spec encoding required Static encoding specification.
Attribute param_names dict optional Sorted dynamic parameter names mapped to operand ordinals.

Verification constraints

  • OperandDictionary(params, param_names)

Examples

%enc = encoding.define #encoding.operand<element_format=i8, payload_elements=32, payload_packing=dense_lanes> : encoding<schema>
%storage = encoding.define #encoding.storage {layout = %layout : encoding<layout>, schema = %schema : encoding<schema>} : encoding<storage>