[Mlir-commits] [mlir] [mlir][arith] Add `arith.flush_denormals` operation (PR #192641)

Javed Absar llvmlistbot at llvm.org
Fri Apr 17 06:20:40 PDT 2026


================
@@ -990,6 +990,40 @@ def Arith_NegFOp : Arith_FloatUnaryOp<"negf"> {
   let hasFolder = 1;
 }
 
+//===----------------------------------------------------------------------===//
+// FlushDenormalsOp
+//===----------------------------------------------------------------------===//
+
+def Arith_FlushDenormalsOp : Arith_FloatUnaryOp<"flush_denormals"> {
+  let summary = "flush denormal floating-point values to zero";
+  let description = [{
+    The `flush_denormals` operation takes a floating-point value and returns
+    the input value if it is a normal (or zero, infinity, or NaN) value, or
+    a zero of the same type if the input is a denormal (subnormal) value.
+    The sign of zero is preserved when flushing a denormal: negative
+    denormals flush to `-0.0`, positive denormals flush to `+0.0`.
+
----------------
javedabsar1 wrote:

Apparently, in IEEE‑754 floating‑point:-
 - Subnormal is the official IEEE‑754 term, 
- Denormal is an older / colloquial / legacy term that means the same thing.
Given LLVM uses denormal, above is good.
But given we explain 'normal', a line such as 
`subnormal - very close to zero values, smaller than the minimum normal (identified when exp is 0)`, may be useful here.

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


More information about the Mlir-commits mailing list