[Mlir-commits] [mlir] [mlir][arith][transforms] Adds Truncf f32 to f4e2m1 (PR #144157)

Jakub Kuderski llvmlistbot at llvm.org
Tue Jun 17 07:44:39 PDT 2025


================
@@ -322,6 +334,74 @@ struct BFloat16TruncFOpConverter : public OpRewritePattern<arith::TruncFOp> {
   }
 };
 
+struct F4E2M1ExtFOpConverter : public OpRewritePattern<arith::ExtFOp> {
----------------
kuhar wrote:

I understand that this is the reference implementation, but I wonder if the alternative could be to emit a sequence of `select` statements that works as a lookup table. After we exclude the sign bit, I understand that there are only 8 values to choose from, right?

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


More information about the Mlir-commits mailing list