[PATCH] D74151: Adding sin op in the GLSL extension
Natasha Kononenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 6 11:47:14 PST 2020
NatashaKnk created this revision.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: mravishankar.
Herald added a reviewer: antiagainst.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74151
Files:
mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
Index: mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
===================================================================
--- mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
+++ mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
@@ -200,6 +200,38 @@
// -----
+def SPV_GLSLSinOp : SPV_GLSLUnaryArithmeticOp<"Sin", 13, SPV_Float16or32> {
+ let summary = "Sine of operand in radians";
+
+ let description = [{
+ The standard trigonometric sine of x radians.
+
+ The operand x must be a scalar or vector whose component type is 16-bit or
+ 32-bit floating-point.
+
+ Result Type and the type of x must be the same type. Results are computed
+ per component.
+
+ ### Custom assembly format
+ ```
+ restricted-float-scalar-type ::= `f16` | `f32`
+ restricted-float-scalar-vector-type ::=
+ restricted-float-scalar-type |
+ `vector<` integer-literal `x` restricted-float-scalar-type `>`
+ sin-op ::= ssa-id `=` `spv.GLSL.Sin` ssa-use `:`
+ restricted-float-scalar-vector-type
+ ```
+ For example:
+
+ ```
+ %2 = spv.GLSL.Sin %0 : f32
+ %3 = spv.GLSL.Sin %1 : vector<3xf16>
+ ```
+ }];
+}
+
+// -----
+
def SPV_GLSLExpOp : SPV_GLSLUnaryArithmeticOp<"Exp", 27, SPV_Float16or32> {
let summary = "Exponentiation of Operand 1";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74151.242969.patch
Type: text/x-patch
Size: 1301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200206/5a83a839/attachment.bin>
More information about the llvm-commits
mailing list