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

Marius Brehler llvmlistbot at llvm.org
Wed Jan 15 02:43:27 PST 2025


================
@@ -778,7 +815,9 @@ void mlir::populateArithToEmitCPatterns(TypeConverter &typeConverter,
     ItoFCastOpConversion<arith::SIToFPOp>,
     ItoFCastOpConversion<arith::UIToFPOp>,
     FtoICastOpConversion<arith::FPToSIOp>,
-    FtoICastOpConversion<arith::FPToUIOp>
+    FtoICastOpConversion<arith::FPToUIOp>,
+    FpCastOpConversion<arith::ExtFOp>,
+    FpCastOpConversion<arith::TruncFOp>
----------------
marbre wrote:

Please excuse me for not having ask this earlier, but what's the motivation to convert to `emitc.cast` instead of to an `emitc.call` that calls `truncf` or even adding a new `emitc.trunc` op? @simon-camp WDYT?

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


More information about the Mlir-commits mailing list