[Mlir-commits] [mlir] [mlir][arith][transforms] Adds Truncf f32 to f4e2m1 (PR #144157)
Jakub Kuderski
llvmlistbot at llvm.org
Tue Jun 17 12:55:31 PDT 2025
================
@@ -51,8 +62,10 @@ func.func @entry() {
func.call @check_truncf(%nan) : (f32) -> ()
// CHECK: 0
- func.call @check_extf(%zero) : (f32) -> ()
+ %zeroF4 = arith.truncf %zero : f32 to f4E2M1FN
+ func.call @check_extf(%zeroF4) : (f4E2M1FN) -> ()
// CHECK: 0.5
- func.call @check_extf(%half) : (f32) -> ()
+ %halfF4 = arith.truncf %half : f32 to f4E2M1FN
+ func.call @check_extf(%halfF4) : (f4E2M1FN) -> ()
----------------
kuhar wrote:
We are we checking these two values only? I'd be interested to see what happens when we truncate something outside of the 16 possible values, e.g., 42.3, -3.14, some large constant, etc.
https://github.com/llvm/llvm-project/pull/144157
More information about the Mlir-commits
mailing list