[Mlir-commits] [mlir] [MLIR][Arith] Add denormal attribute to binary/unary operations (PR #112700)

Diego Caballero llvmlistbot at llvm.org
Fri Nov 22 10:03:57 PST 2024


================
@@ -1161,3 +1161,73 @@ func.func @intflags_func(%arg0: i64, %arg1: i64) {
   %3 = arith.shli %arg0, %arg1 overflow<nsw, nuw> : i64
   return
 }
+
+// CHECK-LABEL: check_denorm_modes
+func.func @check_denorm_modes(%arg0: f32, %arg1: f32, %arg2: f32) {
+  %c_denorm = arith.constant 1.4e-45 : f32
+  // CHECK: %{{.+}} = arith.subf %{{.+}}, %{{.+}} denormal<preserve_sign> : f32
+  %sub_preserve_sign = arith.subf %arg0, %c_denorm denormal<preserve_sign> : f32
+  // CHECK: %{{.+}} = arith.subf %{{.+}}, %{{.+}} denormal<positive_zero> : f32
+  %sub_positive_zero = arith.subf %arg1, %c_denorm denormal<positive_zero> : f32
+  // CHECK: %{{.+}} = arith.subf %{{.+}}, %{{.+}} : f32
----------------
dcaballe wrote:

is there a way to make sure that the default value is not printed? `%{{.*}}` would match `denormal<positive_zero>` if printed

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


More information about the Mlir-commits mailing list