[Mlir-commits] [mlir] e952bb7 - [MLIR][Standard] Add `atan` to standard dialect

Frederik Gossen llvmlistbot at llvm.org
Tue Sep 22 06:17:12 PDT 2020


Author: Frederik Gossen
Date: 2020-09-22T13:16:36Z
New Revision: e952bb709ff70e45c80434fbb8e0b97b52afcf01

URL: https://github.com/llvm/llvm-project/commit/e952bb709ff70e45c80434fbb8e0b97b52afcf01
DIFF: https://github.com/llvm/llvm-project/commit/e952bb709ff70e45c80434fbb8e0b97b52afcf01.diff

LOG: [MLIR][Standard] Add `atan` to standard dialect

Differential Revision: https://reviews.llvm.org/D88091

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/StandardOps/IR/Ops.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
index 2113dfeb4c089..6eabc00d412df 100644
--- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
+++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
@@ -492,6 +492,43 @@ def AssumeAlignmentOp : Std_Op<"assume_alignment"> {
   let assemblyFormat = "$memref `,` $alignment attr-dict `:` type($memref)";
 }
 
+//===----------------------------------------------------------------------===//
+// AtanOp
+//===----------------------------------------------------------------------===//
+
+def AtanOp : FloatUnaryOp<"atan", []>{
+  let summary = "arcus tangent of the given value";
+  let description = [{
+    Syntax:
+
+    ```
+    operation ::= ssa-id `=` `std.atan` ssa-use `:` type
+    ```
+
+    The `atan` operation computes the arcus tangent of a given value.  It takes
+    one operand and returns one result of the same type.  This type may be a
+    float scalar type, a vector whose element type is float, or a tensor of
+    floats.  It has no standard attributes.
+
+    Example:
+
+    ```mlir
+    // Arcus tangent of scalar value.
+    %a = atan %b : f64
+
+    // SIMD vector element-wise arcus tangent.
+    %f = atan %g : vector<4xf32>
+
+    // Tensor element-wise arcus tangent.
+    %x = atan %y : tensor<4x?xf8>
+    ```
+  }];
+}
+
+//===----------------------------------------------------------------------===//
+// AtomicRMWOp
+//===----------------------------------------------------------------------===//
+
 def AtomicRMWOp : Std_Op<"atomic_rmw", [
       AllTypesMatch<["value", "result"]>,
       TypesMatchWith<"value type matches element type of memref",
@@ -1354,6 +1391,10 @@ def CosOp : FloatUnaryOp<"cos"> {
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// SinOp
+//===----------------------------------------------------------------------===//
+
 def SinOp : FloatUnaryOp<"sin"> {
   let summary = "sine of the specified value";
   let description = [{
@@ -1383,7 +1424,6 @@ def SinOp : FloatUnaryOp<"sin"> {
   }];
 }
 
-
 //===----------------------------------------------------------------------===//
 // DeallocOp
 //===----------------------------------------------------------------------===//


        


More information about the Mlir-commits mailing list