vector.clampf
← vector dialect
Lanewise floating-point clamp with explicit NaN/comparison policy. The ordered mode preserves strict compare/select semantics, number mode uses minnum/maxnum semantics, and ieee mode propagates NaNs.
Operation contract
| Property |
Value |
| Semantic phase |
executable |
| Traits |
Pure, Elementwise |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
value |
vector |
required |
— |
| Operand |
lower |
vector |
required |
— |
| Operand |
upper |
vector |
required |
— |
| Result |
result |
vector |
required |
— |
| Attribute |
mode |
enum ClampFMode |
required |
— |
| Attribute |
fastmath |
flags FastMathFlags |
optional |
— |
Verification constraints
HasFloatElement(result)
SameType(value, lower, upper, result)
Examples
%result = vector.clampf<ordered> %value, %lower, %upper : vector<16xf32>
%result = vector.clampf<number, nnan|nsz> %value, %lower, %upper : vector<16xf32>
%result = vector.clampf<ieee> %value, %lower, %upper : vector<16xf32>