[Mlir-commits] [mlir] [MLIR][NVVM] Add new narrow FP convert Ops (PR #184291)
Durgadoss R
llvmlistbot at llvm.org
Tue Mar 3 03:42:46 PST 2026
================
@@ -1951,6 +1951,45 @@ def NVVM_ConvertF32x2ToF4x2Op : NVVM_Op<"convert.f32x2.to.f4x2"> {
}];
}
+class NVVM_ConvertFPx2ToF4x2Op<string srcType>
+ : NVVM_Op<"convert."#!tolower(srcType)#"x2.to.f4x2"> {
+ let summary = "Convert a pair of "#srcType#" inputs to F4x2";
+ let description = [{
+ This Op converts each of the given }]#srcType#[{ inputs to the specified
+ F4x2 type.
+ The result `dst` is returned as an i8 type where the converted values are
+ packed such that the value converted from `a` is stored in the upper 4 bits
+ of `dst` and the value converted from `b` is stored in the lower 4 bits of
+ `dst`.
+ The `relu` attribute, when set, lowers to the '.relu' variant of
+ the cvt instruction.
+ }];
+ let hasVerifier = 1;
+ let results = (outs I8:$dst);
+ let arguments = (ins
+ VectorOfLengthAndType<[2], [!cast<Type>(srcType)]>:$a,
----------------
durga4github wrote:
Also, instead of `a` can we name it `src` to align it better with `dst`?
https://github.com/llvm/llvm-project/pull/184291
More information about the Mlir-commits
mailing list