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

Jakub Kuderski llvmlistbot at llvm.org
Mon Jun 16 09:43:18 PDT 2025


================
@@ -34,6 +34,18 @@ static Value createConst(Location loc, Type type, int value,
   return rewriter.create<arith::ConstantOp>(loc, attr);
 }
 
+/// Create an float constant.
+static Value createFloatConst(Location loc, Type type, float value,
----------------
kuhar wrote:

Consider padding `value` as APFloat -- otherwise `float value` may not be representable by the target float type when the caller expects its.

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


More information about the Mlir-commits mailing list