forked from OSchip/llvm-project
[mlir] Add RSqrt tp ComplexOps.td.
Differential Revision: https://reviews.llvm.org/D126202
This commit is contained in:
parent
2ac5ebedea
commit
a3a85fe59f
|
@ -387,6 +387,25 @@ def ReOp : ComplexUnaryOp<"re",
|
|||
let hasFolder = 1;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// RsqrtOp
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def RsqrtOp : ComplexUnaryOp<"rsqrt", [SameOperandsAndResultType]> {
|
||||
let summary = "complex reciprocal of square root";
|
||||
let description = [{
|
||||
The `rsqrt` operation computes reciprocal of square root.
|
||||
|
||||
Example:
|
||||
|
||||
```mlir
|
||||
%a = complex.rsqrt %b : complex<f32>
|
||||
```
|
||||
}];
|
||||
|
||||
let results = (outs Complex<AnyFloat>:$result);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// SignOp
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -61,5 +61,18 @@ func.func @ops(%f: f32) {
|
|||
|
||||
// CHECK: complex.sub %[[C]], %[[C]] : complex<f32>
|
||||
%diff = complex.sub %complex, %complex : complex<f32>
|
||||
|
||||
// CHECK: complex.tanh %[[C]] : complex<f32>
|
||||
%tanh = complex.tanh %complex : complex<f32>
|
||||
|
||||
// CHECK: complex.pow %[[C]], %[[C]] : complex<f32>
|
||||
%pow = complex.pow %complex, %complex : complex<f32>
|
||||
|
||||
// CHECK: complex.sqrt %[[C]] : complex<f32>
|
||||
%sqrt = complex.sqrt %complex : complex<f32>
|
||||
|
||||
// CHECK: complex.rsqrt %[[C]] : complex<f32>
|
||||
%rsqrt = complex.rsqrt %complex : complex<f32>
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue