[Mlir-commits] [mlir] f3eeefe - [mlir] Add Expm1 tp ComplexOps.td.

Alexander Belyaev llvmlistbot at llvm.org
Mon May 23 07:33:45 PDT 2022


Author: Alexander Belyaev
Date: 2022-05-23T16:31:16+02:00
New Revision: f3eeefe4490efb6e9821e87ddf51f2d60ba435f6

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

LOG: [mlir] Add Expm1 tp ComplexOps.td.

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

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
    mlir/test/Dialect/Complex/ops.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td b/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
index 3073d4e08866..4a7377e7fe64 100644
--- a/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
+++ b/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
@@ -222,6 +222,31 @@ def ExpOp : ComplexUnaryOp<"exp", [SameOperandsAndResultType]> {
   let results = (outs Complex<AnyFloat>:$result);
 }
 
+//===----------------------------------------------------------------------===//
+// Expm1Op
+//===----------------------------------------------------------------------===//
+
+def Expm1Op : ComplexUnaryOp<"expm1", [SameOperandsAndResultType]> {
+  let summary = "computes exponential of a complex number minus 1";
+  let description = [{
+    Syntax:
+
+    ```
+    operation ::= ssa-id `=` `complex.expm1` ssa-use `:` type
+    ```
+
+    complex.expm1(x) := complex.exp(x) - 1
+
+    Example:
+
+    ```mlir
+    %a = complex.expm1 %b : complex<f32>
+    ```
+  }];
+
+  let results = (outs Complex<AnyFloat>:$result);
+}
+
 //===----------------------------------------------------------------------===//
 // ImOp
 //===----------------------------------------------------------------------===//

diff  --git a/mlir/test/Dialect/Complex/ops.mlir b/mlir/test/Dialect/Complex/ops.mlir
index f0f80e080297..1b302af74b9c 100644
--- a/mlir/test/Dialect/Complex/ops.mlir
+++ b/mlir/test/Dialect/Complex/ops.mlir
@@ -38,6 +38,9 @@ func.func @ops(%f: f32) {
   // CHECK: complex.exp %[[C]] : complex<f32>
   %exp = complex.exp %complex : complex<f32>
 
+  // CHECK: complex.expm1 %[[C]] : complex<f32>
+  %expm1 = complex.expm1 %complex : complex<f32>
+
   // CHECK: complex.log %[[C]] : complex<f32>
   %log = complex.log %complex : complex<f32>
 


        


More information about the Mlir-commits mailing list