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

Renato Golin llvmlistbot at llvm.org
Wed Mar 25 06:46:04 PDT 2026


================
@@ -988,14 +1022,17 @@ def Arith_AddFOp : Arith_FloatBinaryOp<"addf", [Commutative]> {
 // SubFOp
 //===----------------------------------------------------------------------===//
 
-def Arith_SubFOp : Arith_FloatBinaryOp<"subf"> {
+def Arith_SubFOp : Arith_FloatBinaryOpWithRoundingMode<"subf"> {
   let summary = "floating point subtraction operation";
   let description = [{
     The `subf` 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.
----------------
rengolin wrote:

Perhaps a link to that document?

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


More information about the Mlir-commits mailing list