[Mlir-commits] [mlir] [mlir][emitc] Support convert arith.extf and arith.truncf to emitc (PR #121184)

Jianjian Guan llvmlistbot at llvm.org
Fri Jan 10 01:50:40 PST 2025


================
@@ -149,3 +149,43 @@ func.func @arith_remui_vector(%arg0: vector<5xi32>, %arg1: vector<5xi32>) -> vec
   %divui = arith.remui %arg0, %arg1 : vector<5xi32>
   return %divui: vector<5xi32>
 }
+
+// -----
+
+func.func @arith_truncf(%arg0: f64) -> f32 {
+  // expected-error @+1 {{failed to legalize operation 'arith.truncf'}}
+  %truncd = arith.truncf %arg0 to_nearest_away : f64 to f32
+  return %truncd : f32
+}
+
+// -----
+
+func.func @arith_extf_f128(%arg0: f32) -> f128 {
+  // expected-error @+1 {{failed to legalize operation 'arith.truncf'}}
+  %extd = arith.extf %arg0 : f32 to f128
+  return %extd : f128
+}
+
+// -----
+
+func.func @arith_truncf_f128(%arg0: f128) -> f32 {
+  // expected-error @+1 {{failed to legalize operation 'arith.truncf'}}
+  %truncd = arith.truncf %arg0 : f128 to f32
+  return %truncd : f32
+}
+
+// -----
+
+func.func @arith_extf_vector(%arg0: vector<4xf32>) -> vector<4xf64> {
+  // expected-error @+1 {{failed to legalize operation 'arith.truncf'}}
----------------
jacquesguan wrote:

Fixed

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


More information about the Mlir-commits mailing list