@@ -24,21 +24,24 @@ class Complex_Op<string mnemonic, list<Trait> traits = []>
24
24
// one result, all of which must be complex numbers of the same type.
25
25
class ComplexArithmeticOp<string mnemonic, list<Trait> traits = []> :
26
26
Complex_Op<mnemonic, traits # [Pure, SameOperandsAndResultType,
27
- Elementwise, DeclareOpInterfaceMethods<ArithFastMathInterface>]> {
28
- let arguments = (ins Complex<AnyFloat>:$lhs, Complex<AnyFloat>:$rhs, DefaultValuedAttr<
29
- Arith_FastMathAttr, "::mlir::arith::FastMathFlags::none">:$fastmath);
27
+ Elementwise, DeclareOpInterfaceMethods<ArithFastMathInterface>, DeclareOpInterfaceMethods<ArithIntegerOverflowFlagsInterface>]> {
28
+ let arguments = (ins Complex<AnyFloat>:$lhs, Complex<AnyFloat>:$rhs,
29
+ DefaultValuedAttr<Arith_FastMathAttr, "::mlir::arith::FastMathFlags::none">:$fastmath,
30
+ DefaultValuedAttr<Arith_IntegerOverflowAttr,"::mlir::arith::IntegerOverflowFlags::none">:$overflowFlags);
30
31
let results = (outs Complex<AnyFloat>:$result);
31
- let assemblyFormat = "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)";
32
+ let assemblyFormat = "$lhs `,` $rhs (`fastmath` `` $fastmath^)? (`overflow` `` $overflowFlags^)? attr-dict `:` type($result)";
32
33
}
33
34
34
35
// Base class for standard unary operations on complex numbers with a
35
36
// floating-point element type. These operations take one operand and return
36
37
// one result; the operand must be a complex number.
37
38
class ComplexUnaryOp<string mnemonic, list<Trait> traits = []> :
38
- Complex_Op<mnemonic, traits # [Pure, Elementwise, DeclareOpInterfaceMethods<ArithFastMathInterface>]> {
39
- let arguments = (ins Complex<AnyFloat>:$complex, DefaultValuedAttr<
40
- Arith_FastMathAttr, "::mlir::arith::FastMathFlags::none">:$fastmath);
41
- let assemblyFormat = "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)";
39
+ Complex_Op<mnemonic, traits # [Pure, Elementwise,
40
+ DeclareOpInterfaceMethods<ArithFastMathInterface>, DeclareOpInterfaceMethods<ArithIntegerOverflowFlagsInterface>]> {
41
+ let arguments = (ins Complex<AnyFloat>:$complex,
42
+ DefaultValuedAttr<Arith_FastMathAttr, "::mlir::arith::FastMathFlags::none">:$fastmath,
43
+ DefaultValuedAttr<Arith_IntegerOverflowAttr,"::mlir::arith::IntegerOverflowFlags::none">:$overflowFlags);
44
+ let assemblyFormat = "$complex (`fastmath` `` $fastmath^)? (`overflow` `` $overflowFlags^)? attr-dict `:` type($complex)";
42
45
}
43
46
44
47
//===----------------------------------------------------------------------===//
0 commit comments