[Mlir-commits] [mlir] [MLIR][NVVM] Update support for conversions to f8x2 and f6x2 types (PR #137781)
Srinivasa Ravi
llvmlistbot at llvm.org
Mon May 5 04:56:46 PDT 2025
================
@@ -1120,6 +1120,153 @@ def NVVM_CvtToF6x2Op : NVVM_Op<"cvt.to.f6x2"> {
}];
}
+def CVTFP8E4M3 : I32EnumAttrCase<"E4M3", 0, "e4m3">;
+def CVTFP8E5M2 : I32EnumAttrCase<"E5M2", 1, "e5m2">;
+def CVTFP8UE8M0 : I32EnumAttrCase<"UE8M0", 2, "ue8m0">;
+
+def CVTFP8Type : I32EnumAttr<"CVTFP8Type", "NVVM CVTFP8Type kind",
+ [CVTFP8E4M3, CVTFP8E5M2, CVTFP8UE8M0]> {
+ let genSpecializedAttr = 0;
+ let cppNamespace = "::mlir::NVVM";
+}
+def CVTFP8TypeAttr : EnumAttr<NVVM_Dialect, CVTFP8Type, "cvt_fp8_type"> {
+ let assemblyFormat = "`<` $value `>`";
+}
+
+def NVVM_CvtFloatToF8x2Op : NVVM_Op<"cvt.float.to.f8x2"> {
----------------
Wolfram70 wrote:
That makes sense since the Ops take in two `f32` inputs and not just one. I have renamed them in the latest revision to `f32x2`. But since these Ops actually take the inputs as two arguments and not a vector (due to the underlying intrinsic design), this is unlike the other `f16x2`, `f8x2`, etc... cases where they are a vector. So, I was thinking whether it would be better to name it more explicitly, maybe something like `cvt.fpair.to.f8x2`. Please let me know what you think.
https://github.com/llvm/llvm-project/pull/137781
More information about the Mlir-commits
mailing list