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

Pradeep Kumar llvmlistbot at llvm.org
Wed May 13 06:07:26 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,
----------------
schwarzschild-radius wrote:

There are no default rounding mode for sqrt, right? (https://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sqrt)

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


More information about the Mlir-commits mailing list