forked from OSchip/llvm-project
[mlir] Add Expm1 tp ComplexOps.td.
Differential Revision: https://reviews.llvm.org/D126206
This commit is contained in:
parent
9293539064
commit
f3eeefe449
|
@ -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
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue