Skip to content

vector.fptrunc

vector dialect

Lanewise floating-point precision truncation using round-to-nearest, ties-to-even. Source and result shapes match exactly; only the floating-point element type narrows. Special values follow the destination format: f8E4M3 saturates finite overflow and infinities to its signed maximum finite value while preserving NaNs; IEEE formats preserve infinities and NaNs.

Operation contract

Property Value
Semantic phase executable
Traits Pure, Elementwise

Signature

Kind Name Type Cardinality Description
Operand input vector required
Result result vector required

Verification constraints

  • HasFloatElement(input)
  • HasFloatElement(result)
  • SameKind(input, result)
  • SameShape(input, result)
  • ElementWidthLessThan(result, input)

Examples

Note

A canonical source example has not been added for this operation yet.