[Mlir-commits] [mlir] [MLIR][NVVM] Add nvvm.addf and nvvm.subf Ops (PR #179162)
Srinivasa Ravi
llvmlistbot at llvm.org
Thu Feb 26 06:24:42 PST 2026
================
@@ -6257,6 +6278,64 @@ def NVVM_Tcgen05MMAWsSparseOp : NVVM_Op<"tcgen05.mma.ws.sp",
}];
}
+def SIMTFloatType : AnyTypeOf<[F16, BF16, F32, F64, VectorOfLengthAndType<[2], [F16, BF16, F32, F64]>]>;
+
+class NVVM_FloatBinaryOp<string mnemonic, list<Trait> traits = []> :
+ NVVM_Op<mnemonic, traits # [Pure, SameOperandsAndResultType]>,
+ Arguments<(ins SIMTFloatType:$lhs, SIMTFloatType:$rhs,
+ DefaultValuedAttr<FPRoundingModeAttr, "FPRoundingMode::NONE">:$rnd,
+ DefaultValuedAttr<SaturationModeAttr, "SaturationMode::NONE">:$sat,
+ DefaultValuedAttr<BoolAttr, "false">:$ftz)>,
+ Results<(outs SIMTFloatType:$res)> {
+ let assemblyFormat = "$lhs `,` $rhs attr-dict `:` type($res)";
+}
+
+def NVVM_AddFOp : NVVM_FloatBinaryOp<"addf", [Commutative]> {
----------------
Wolfram70 wrote:
Ah this is because the `arith` dialect uses `addf` and `subf` so it seemed better to be consistent with that naming.
https://github.com/llvm/llvm-project/pull/179162
More information about the Mlir-commits
mailing list