[Mlir-commits] [mlir] [mlir][emitc] arith.cmpf to EmitC conversion (PR #93671)
Simon Camphausen
llvmlistbot at llvm.org
Wed May 29 06:10:04 PDT 2024
================
@@ -107,6 +107,234 @@ func.func @arith_select(%arg0: i1, %arg1: tensor<8xi32>, %arg2: tensor<8xi32>) -
// -----
+func.func @arith_cmpf_false(%arg0: f32, %arg1: f32) -> i1 {
+ // CHECK-LABEL: arith_cmpf_false
+ // CHECK-SAME: ([[Arg0:[^ ]*]]: f32, [[Arg1:[^ ]*]]: f32)
+ // CHECK-DAG: [[False:[^ ]*]] = "emitc.constant"() <{value = false}> : () -> i1
+ %false = arith.cmpf false, %arg0, %arg1 : f32
+ // CHECK: return [[False]]
+ return %false: i1
+}
+
+// -----
+
+func.func @arith_cmpf_oeq(%arg0: f32, %arg1: f32) -> i1 {
+ // CHECK-LABEL: arith_cmpf_oeq
+ // CHECK-SAME: ([[Arg0:[^ ]*]]: f32, [[Arg1:[^ ]*]]: f32)
+ // CHECK-DAG: [[EQ:[^ ]*]] = emitc.cmp eq, [[Arg0]], [[Arg1]] : (f32, f32) -> i1
+ // CHECK-DAG: [[NaNArg0:[^ ]*]] = emitc.cmp eq, [[Arg0]], [[Arg0]] : (f32, f32) -> i1
+ // CHECK-DAG: [[NaNArg1:[^ ]*]] = emitc.cmp eq, [[Arg1]], [[Arg1]] : (f32, f32) -> i1
----------------
simon-camp wrote:
nit: Capture these values as NotNaNArg for all ordered tests.
https://github.com/llvm/llvm-project/pull/93671
More information about the Mlir-commits
mailing list