[Mlir-commits] [mlir] [MLIR][NVVM] Add sqrt Ops (PR #197422)
Durgadoss R
llvmlistbot at llvm.org
Thu May 14 04:43:45 PDT 2026
================
@@ -6544,6 +6544,41 @@ def NVVM_FmaOp : NVVM_Op<"fma", [Pure, SameOperandsAndResultType]> {
}];
}
+//===----------------------------------------------------------------------===//
+// NVVM sqrt op definitions
+//===----------------------------------------------------------------------===//
+
+def NVVM_SqrtOp
+ : NVVM_SingleResultIntrinsicOp<"sqrt", [Pure, SameOperandsAndResultType]> {
+ let summary = "Take the square root of a value";
+ let description = [{
+ Compute sqrt(a) and store the result in d.
+
+ For more information, see PTX ISA:
+ [sqrt](https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sqrt)
+ }];
+ let arguments = (ins AnyTypeOf<[F32, F64]>:$src, FPArithRoundingMode:$rnd,
----------------
durga4github wrote:
ok, I asked here looking at the comment below (where we were indexing earlier).
So, yes, in this case, defValueAttr does not make sense. We can leave it as is.
https://github.com/llvm/llvm-project/pull/197422
More information about the Mlir-commits
mailing list