[Mlir-commits] [mlir] [MLIR][NVVM] Add `nvvm.sin` OP (PR #193775)
Durgadoss R
llvmlistbot at llvm.org
Fri Apr 24 01:25:04 PDT 2026
================
@@ -518,6 +518,35 @@ def NVVM_RcpApproxFtzF32Op : NVVM_IntrOp<"rcp.approx.ftz.f", [Pure], 1> {
let assemblyFormat = "$arg attr-dict `:` type($res)";
}
+//===----------------------------------------------------------------------===//
+// NVVM transcendental op definitions
+//===----------------------------------------------------------------------===//
+// PTX provides only fast approximations for sin/cos/lg2/ex2/tanh. Exposing
+// these as plain `nvvm.{sin,cos,lg2,ex2,tanh}` (without a `.approx` suffix)
+// keeps the NVVM dialect self-contained -- users don't need to reach for
+// `math.*` ops for something that already has a PTX instruction.
+
+def NVVM_SinOp : NVVM_Op<"sin", [Pure, SameOperandsAndResultType]> {
----------------
durga4github wrote:
nit: We could derive from the SingleResultIntrinsic wrapper
https://github.com/llvm/llvm-project/pull/193775
More information about the Mlir-commits
mailing list