[Mlir-commits] [mlir] [mlir][arith] Add rounding mode flags to binary arithmetic operations (PR #188458)

Matthias Springer llvmlistbot at llvm.org
Thu Apr 16 08:09:23 PDT 2026


================
@@ -957,14 +988,17 @@ def Arith_NegFOp : Arith_FloatUnaryOp<"negf"> {
 // AddFOp
 //===----------------------------------------------------------------------===//
 
-def Arith_AddFOp : Arith_FloatBinaryOp<"addf", [Commutative]> {
+def Arith_AddFOp : Arith_FloatBinaryOpWithRoundingMode<"addf", [Commutative]> {
   let summary = "floating point addition operation";
   let description = [{
     The `addf` operation takes two operands and returns one result, each of
     these is required to be the same type. This type may be a floating point
     scalar type, a vector whose element type is a floating point type, or a
     floating point tensor.
 
+    If the value cannot be exactly represented, it is rounded using the
+    provided rounding mode or the default one if no rounding mode is provided.
----------------
matthias-springer wrote:

I updated the top-level documentation of the arith dialect based on @krzysz00's comment.

@krzysz00 @joker-eph @rengolin Can you double-check the [wording](https://github.com/llvm/llvm-project/pull/188458/changes#diff-7375d80a4a49d2feb94678291b3562b12453ca9b7573cf58ffc30f3a54236085R33)? If this is not what you expected, please comment with the exact wording that you'd like to see here.


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


More information about the Mlir-commits mailing list