[Mlir-commits] [mlir] [mlir][math] Fix the description of the semantics of math.clampf (PR #175012)

Fabian Mora llvmlistbot at llvm.org
Fri Jan 16 08:02:46 PST 2026


================
@@ -365,8 +365,9 @@ def Math_ClampFOp : Math_FloatTernaryOp<"clampf"> {
 
     The semantics of the operation are described by:
     ```
-      clampf(value, min, max) = maxf(minf(value, min), max)
+      clampf(value, min, max) = maxf(minf(value, max), min)
     ```
+    If `min>max` the resulting value is undefined.
----------------
fabianmcg wrote:

```suggestion
    If `min>max` the resulting value is poison.
```

https://github.com/llvm/llvm-project/pull/175012


More information about the Mlir-commits mailing list