[Mlir-commits] [mlir] [mlir][arith][transforms] Adds Truncf f32 to f4e2m1 (PR #144157)
Jakub Kuderski
llvmlistbot at llvm.org
Tue Jun 17 08:33:53 PDT 2025
================
@@ -0,0 +1,58 @@
+// Check various edge cases for truncf/extf ops involving f32 and f4e2m1 types.
+
+// RUN: mlir-opt %s --convert-vector-to-llvm \
+// RUN: --convert-func-to-llvm \
+// RUN: --arith-expand="include-f4e2m1=true" \
+// RUN: --convert-arith-to-llvm | \
+// RUN: mlir-runner -e entry --entry-point-result=void \
+// RUN: --shared-libs=%mlir_c_runner_utils | \
+// RUN: FileCheck %s --match-full-lines
+
+func.func @check_extf(%in : f32) -> () {
+ %trunc = arith.truncf %in : f32 to f4E2M1FN
+ %res = arith.extf %trunc : f4E2M1FN to f32
----------------
kuhar wrote:
what if you pass it as i32 and then `bitcast trunci(x) : i32 to f4`?
https://github.com/llvm/llvm-project/pull/144157
More information about the Mlir-commits
mailing list