[Mlir-commits] [mlir] [MLIR][NVVM] Add sqrt Ops (PR #197422)

Durgadoss R llvmlistbot at llvm.org
Wed May 13 05:58:02 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, it seems RN is the default rounding mode. So, why not make it a defaultValuedAttr with RN as the value?

https://github.com/llvm/llvm-project/pull/197422


More information about the Mlir-commits mailing list