diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td +++ b/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";