[Mlir-commits] [mlir] [MLIR][NVVM] Add support for narrow-fp to bf16x2 conversions (PR #200157)
Durgadoss R
llvmlistbot at llvm.org
Mon Jun 1 04:39:31 PDT 2026
================
@@ -2185,32 +2185,54 @@ class NVVM_ConvertToFP16x2Op_Base <string srcType, Type srcArgType, string dstTy
!tolower(dstType) # [{.
The result `dst` is represented as a vector of }] # !tolower(dstType) # [{ elements.
- }] #
- !if(!eq(dstType, "F16"),
- [{The `relu` attribute, when set, lowers to the '.relu' variant of
- the cvt instruction."}], "") # [{
-
+
+ The `relu` attribute, when set, lowers to the '.relu' variant of
+ the cvt instruction.}] #
+
+ !if(!eq(dstType, "BF16"),
+ [{
+
+ The `sat` attribute specifies the saturation mode.
+
+ The optional scaling-factors for each of the inputs are provided through
+ the operand `scaleFactor` as a packed i16 type. Only `ue8m0` is supported
+ as the type of the scale-factor currently.}], "") # [{
+
[For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt)
}];
let results = (outs VectorOfLengthAndType<[2], [!cast<Type>(dstType)]>:$dst);
let arguments = !if(!eq(dstType, "F16"),
(ins srcArgType:$src,
- DefaultValuedAttr<BoolAttr, "false">:$relu,
- TypeAttr:$srcType),
+ TypeAttrOf<AnyTypeOf<supportedTypes>>:$srcType,
----------------
durga4github wrote:
I spent a few minutes trying to remember what is the difference between `srcType` and `srcArgType`..;-)
May be, let us rename srcArgType to srcStorageType/srcContainerType...that is more representative of what it is?
https://github.com/llvm/llvm-project/pull/200157
More information about the Mlir-commits
mailing list