Skip to content

Complex

complex

ComplexTypeConstr = ComplexType.constr(AnyFloat) module-attribute

Complex = Dialect('complex', [AbsOp, AddOp, AngleOp, Atan2Op, BitcastOp, ConjOp, ConstantOp, CosOp, CreateOp, DivOp, EqualOp, ExpOp, Expm1Op, ImOp, LogOp, Log1pOp, MulOp, NegOp, NotEqualOp, PowOp, ReOp, RsqrtOp, SignOp, SinOp, SqrtOp, SubOp, TanOp, TanhOp], [ComplexNumberAttr]) module-attribute

ComplexNumberAttr dataclass

Bases: ParametrizedAttribute, Generic[_ComplexNumberElementType]

Source code in xdsl/dialects/complex.py
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@irdl_attr_definition
class ComplexNumberAttr(ParametrizedAttribute, Generic[_ComplexNumberElementType]):
    name = "complex.number"

    real: FloatData = param_def(converter=FloatData.get)
    imag: FloatData = param_def(converter=FloatData.get)
    type: ComplexType[_ComplexNumberElementType]

    def print_parameters(self, printer: Printer) -> None:
        with printer.in_angle_brackets():
            printer.print_string(":")
            printer.print_attribute(self.type.element_type)
            printer.print_string(" ")
            printer.print_float(self.real.data, self.type.element_type)
            printer.print_string(", ")
            printer.print_float(self.imag.data, self.type.element_type)
        printer.print_string(" : ")
        printer.print_attribute(self.type)

    @classmethod
    def parse_parameters(cls, parser: AttrParser) -> Sequence[Attribute]:
        """
        Example:
        ```
        #complex.number<:f64 1.0, 2.0> : complex<f64>
        ```
        """
        with parser.in_angle_brackets():
            parser.parse_punctuation(":")
            pos = parser.pos
            element_type = parser.parse_type()
            if not isa(element_type, AnyFloat):
                parser.raise_error("Invalid element type", pos, parser.pos - 1)
            real = FloatData(parser.parse_float())
            parser.parse_punctuation(",")
            imag = FloatData(parser.parse_float())
        parser.parse_punctuation(":")
        pos = parser.pos
        complex_type = parser.parse_type()
        if not (
            isa(complex_type, ComplexType[AnyFloat])
            and (complex_type.element_type == element_type)
        ):
            parser.raise_error("Complex number type doesn't match element type", pos)
        return [
            real,
            imag,
            ComplexType(element_type),
        ]

name = 'complex.number' class-attribute instance-attribute

real: FloatData = param_def(converter=(FloatData.get)) class-attribute instance-attribute

imag: FloatData = param_def(converter=(FloatData.get)) class-attribute instance-attribute

type: ComplexType[_ComplexNumberElementType] instance-attribute

print_parameters(printer: Printer) -> None

Source code in xdsl/dialects/complex.py
72
73
74
75
76
77
78
79
80
81
def print_parameters(self, printer: Printer) -> None:
    with printer.in_angle_brackets():
        printer.print_string(":")
        printer.print_attribute(self.type.element_type)
        printer.print_string(" ")
        printer.print_float(self.real.data, self.type.element_type)
        printer.print_string(", ")
        printer.print_float(self.imag.data, self.type.element_type)
    printer.print_string(" : ")
    printer.print_attribute(self.type)

parse_parameters(parser: AttrParser) -> Sequence[Attribute] classmethod

Example:

#complex.number<:f64 1.0, 2.0> : complex<f64>
Source code in xdsl/dialects/complex.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@classmethod
def parse_parameters(cls, parser: AttrParser) -> Sequence[Attribute]:
    """
    Example:
    ```
    #complex.number<:f64 1.0, 2.0> : complex<f64>
    ```
    """
    with parser.in_angle_brackets():
        parser.parse_punctuation(":")
        pos = parser.pos
        element_type = parser.parse_type()
        if not isa(element_type, AnyFloat):
            parser.raise_error("Invalid element type", pos, parser.pos - 1)
        real = FloatData(parser.parse_float())
        parser.parse_punctuation(",")
        imag = FloatData(parser.parse_float())
    parser.parse_punctuation(":")
    pos = parser.pos
    complex_type = parser.parse_type()
    if not (
        isa(complex_type, ComplexType[AnyFloat])
        and (complex_type.element_type == element_type)
    ):
        parser.raise_error("Complex number type doesn't match element type", pos)
    return [
        real,
        imag,
        ComplexType(element_type),
    ]

ComplexUnaryComplexResultOperation

Bases: IRDLOperation, ABC

Base class for unary operations on complex numbers.

Source code in xdsl/dialects/complex.py
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
class ComplexUnaryComplexResultOperation(IRDLOperation, abc.ABC):
    """Base class for unary operations on complex numbers."""

    T: ClassVar = VarConstraint("T", ComplexTypeConstr)
    complex = operand_def(T)
    result = result_def(T)
    fastmath = prop_def(FastMathFlagsAttr, default_value=FastMathFlagsAttr("none"))

    traits = traits_def(Pure())

    assembly_format = (
        "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)"
    )

    def __init__(
        self,
        operand: SSAValue | Operation,
        fastmath: FastMathFlagsAttr | None = None,
    ):
        operand_ssa = SSAValue.get(operand)
        super().__init__(
            operands=[operand_ssa],
            result_types=[operand_ssa.type],
            properties={"fastmath": fastmath},
        )

T: ClassVar = VarConstraint('T', ComplexTypeConstr) class-attribute instance-attribute

complex = operand_def(T) class-attribute instance-attribute

result = result_def(T) class-attribute instance-attribute

fastmath = prop_def(FastMathFlagsAttr, default_value=(FastMathFlagsAttr('none'))) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)' class-attribute instance-attribute

__init__(operand: SSAValue | Operation, fastmath: FastMathFlagsAttr | None = None)

Source code in xdsl/dialects/complex.py
129
130
131
132
133
134
135
136
137
138
139
def __init__(
    self,
    operand: SSAValue | Operation,
    fastmath: FastMathFlagsAttr | None = None,
):
    operand_ssa = SSAValue.get(operand)
    super().__init__(
        operands=[operand_ssa],
        result_types=[operand_ssa.type],
        properties={"fastmath": fastmath},
    )

ComplexUnaryRealResultOperation

Bases: IRDLOperation, ABC

Base class for unary operations on complex numbers that return a float.

Source code in xdsl/dialects/complex.py
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
class ComplexUnaryRealResultOperation(IRDLOperation, abc.ABC):
    """Base class for unary operations on complex numbers that return a float."""

    T: ClassVar = VarConstraint("T", AnyFloatConstr)

    complex = operand_def(ComplexType.constr(T))
    result = result_def(T)
    fastmath = prop_def(FastMathFlagsAttr, default_value=FastMathFlagsAttr("none"))

    traits = traits_def(Pure())

    assembly_format = (
        "$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)"
    )

    def __init__(
        self,
        operand: SSAValue | Operation,
        fastmath: FastMathFlagsAttr | None = None,
    ):
        operand_ssa = SSAValue.get(operand)
        element_type = cast(ComplexType, operand_ssa.type).element_type
        super().__init__(
            operands=[operand_ssa],
            result_types=[element_type],
            properties={"fastmath": fastmath},
        )

    def verify_(self):
        element_type = cast(ComplexType, self.complex.type).element_type
        if self.result.type != element_type:
            raise VerifyException(
                f"result type {self.result.type} does not match "
                f"complex element type {element_type}"
            )

T: ClassVar = VarConstraint('T', AnyFloatConstr) class-attribute instance-attribute

complex = operand_def(ComplexType.constr(T)) class-attribute instance-attribute

result = result_def(T) class-attribute instance-attribute

fastmath = prop_def(FastMathFlagsAttr, default_value=(FastMathFlagsAttr('none'))) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex)' class-attribute instance-attribute

__init__(operand: SSAValue | Operation, fastmath: FastMathFlagsAttr | None = None)

Source code in xdsl/dialects/complex.py
157
158
159
160
161
162
163
164
165
166
167
168
def __init__(
    self,
    operand: SSAValue | Operation,
    fastmath: FastMathFlagsAttr | None = None,
):
    operand_ssa = SSAValue.get(operand)
    element_type = cast(ComplexType, operand_ssa.type).element_type
    super().__init__(
        operands=[operand_ssa],
        result_types=[element_type],
        properties={"fastmath": fastmath},
    )

verify_()

Source code in xdsl/dialects/complex.py
170
171
172
173
174
175
176
def verify_(self):
    element_type = cast(ComplexType, self.complex.type).element_type
    if self.result.type != element_type:
        raise VerifyException(
            f"result type {self.result.type} does not match "
            f"complex element type {element_type}"
        )

ComplexBinaryOp

Bases: IRDLOperation, ABC

Base class for binary operations on complex numbers.

Source code in xdsl/dialects/complex.py
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
class ComplexBinaryOp(IRDLOperation, abc.ABC):
    """Base class for binary operations on complex numbers."""

    T: ClassVar = VarConstraint("T", ComplexTypeConstr)
    lhs = operand_def(T)
    rhs = operand_def(T)
    result = result_def(T)
    fastmath = prop_def(FastMathFlagsAttr, default_value=FastMathFlagsAttr("none"))

    traits = traits_def(Pure())

    assembly_format = (
        "$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)"
    )

    def __init__(
        self,
        lhs: SSAValue | Operation,
        rhs: SSAValue | Operation,
        fastmath: FastMathFlagsAttr | None = None,
    ):
        lhs_ssa = SSAValue.get(lhs)
        super().__init__(
            operands=[lhs_ssa, rhs],
            result_types=[lhs_ssa.type],
            properties={"fastmath": fastmath},
        )

T: ClassVar = VarConstraint('T', ComplexTypeConstr) class-attribute instance-attribute

lhs = operand_def(T) class-attribute instance-attribute

rhs = operand_def(T) class-attribute instance-attribute

result = result_def(T) class-attribute instance-attribute

fastmath = prop_def(FastMathFlagsAttr, default_value=(FastMathFlagsAttr('none'))) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)' class-attribute instance-attribute

__init__(lhs: SSAValue | Operation, rhs: SSAValue | Operation, fastmath: FastMathFlagsAttr | None = None)

Source code in xdsl/dialects/complex.py
194
195
196
197
198
199
200
201
202
203
204
205
def __init__(
    self,
    lhs: SSAValue | Operation,
    rhs: SSAValue | Operation,
    fastmath: FastMathFlagsAttr | None = None,
):
    lhs_ssa = SSAValue.get(lhs)
    super().__init__(
        operands=[lhs_ssa, rhs],
        result_types=[lhs_ssa.type],
        properties={"fastmath": fastmath},
    )

ComplexCompareOp

Bases: IRDLOperation, ABC

Base class for comparison operations on complex numbers.

Source code in xdsl/dialects/complex.py
208
209
210
211
212
213
214
215
216
217
218
219
220
221
class ComplexCompareOp(IRDLOperation, abc.ABC):
    """Base class for comparison operations on complex numbers."""

    T: ClassVar = VarConstraint("T", ComplexTypeConstr)
    lhs = operand_def(T)
    rhs = operand_def(T)
    result = result_def(IntegerType(1))

    traits = traits_def(Pure())

    assembly_format = "$lhs `,` $rhs attr-dict `:` type($lhs)"

    def __init__(self, lhs: SSAValue | Operation, rhs: SSAValue | Operation):
        super().__init__(operands=[lhs, rhs], result_types=[IntegerType(1)])

T: ClassVar = VarConstraint('T', ComplexTypeConstr) class-attribute instance-attribute

lhs = operand_def(T) class-attribute instance-attribute

rhs = operand_def(T) class-attribute instance-attribute

result = result_def(IntegerType(1)) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$lhs `,` $rhs attr-dict `:` type($lhs)' class-attribute instance-attribute

__init__(lhs: SSAValue | Operation, rhs: SSAValue | Operation)

Source code in xdsl/dialects/complex.py
220
221
def __init__(self, lhs: SSAValue | Operation, rhs: SSAValue | Operation):
    super().__init__(operands=[lhs, rhs], result_types=[IntegerType(1)])

AbsOp dataclass

Bases: ComplexUnaryRealResultOperation

Source code in xdsl/dialects/complex.py
224
225
226
@irdl_op_definition
class AbsOp(ComplexUnaryRealResultOperation):
    name = "complex.abs"

name = 'complex.abs' class-attribute instance-attribute

AddOp dataclass

Bases: ComplexBinaryOp

Source code in xdsl/dialects/complex.py
229
230
231
@irdl_op_definition
class AddOp(ComplexBinaryOp):
    name = "complex.add"

name = 'complex.add' class-attribute instance-attribute

AngleOp dataclass

Bases: ComplexUnaryRealResultOperation

Source code in xdsl/dialects/complex.py
234
235
236
@irdl_op_definition
class AngleOp(ComplexUnaryRealResultOperation):
    name = "complex.angle"

name = 'complex.angle' class-attribute instance-attribute

Atan2Op dataclass

Bases: ComplexBinaryOp

Source code in xdsl/dialects/complex.py
239
240
241
@irdl_op_definition
class Atan2Op(ComplexBinaryOp):
    name = "complex.atan2"

name = 'complex.atan2' class-attribute instance-attribute

BitcastOp

Bases: IRDLOperation

compute between complex and and equal arith types

Source code in xdsl/dialects/complex.py
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
@irdl_op_definition
class BitcastOp(IRDLOperation):
    """
    compute between complex and and equal arith types
    """

    name = "complex.bitcast"
    operand = operand_def(
        ComplexType.constr(AnyFloatConstr) | AnyFloatConstr | BaseAttr(IntegerType)
    )
    result = result_def(
        ComplexType.constr(AnyFloatConstr) | AnyFloatConstr | BaseAttr(IntegerType)
    )

    traits = traits_def(Pure())

    assembly_format = "$operand attr-dict `:` type($operand) `to` type($result)"

    def __init__(self, operand: SSAValue | Operation, result_type: Attribute):
        super().__init__(operands=[operand], result_types=[result_type])

    def verify_(self) -> None:
        in_type = self.operand.type
        res_type = self.result.type

        # We allow this to be legal as it can be folded away
        if in_type == res_type:
            return

        if in_complex := isa(in_type, ComplexType[AnyFloat]):
            in_bitwidth = in_type.element_type.bitwidth * 2
        else:
            in_bitwidth = cast(FixedBitwidthType, in_type).bitwidth

        if out_complex := isa(res_type, ComplexType[AnyFloat]):
            out_bitwidth = res_type.element_type.bitwidth * 2
        else:
            out_bitwidth = cast(FixedBitwidthType, res_type).bitwidth

        if not ((in_bitwidth == out_bitwidth) and (in_complex != out_complex)):
            raise VerifyException(
                f"Expected ('{in_type}', '{res_type}') to be bitcast between complex and equal arith types"
            )

name = 'complex.bitcast' class-attribute instance-attribute

operand = operand_def(ComplexType.constr(AnyFloatConstr) | AnyFloatConstr | BaseAttr(IntegerType)) class-attribute instance-attribute

result = result_def(ComplexType.constr(AnyFloatConstr) | AnyFloatConstr | BaseAttr(IntegerType)) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$operand attr-dict `:` type($operand) `to` type($result)' class-attribute instance-attribute

__init__(operand: SSAValue | Operation, result_type: Attribute)

Source code in xdsl/dialects/complex.py
262
263
def __init__(self, operand: SSAValue | Operation, result_type: Attribute):
    super().__init__(operands=[operand], result_types=[result_type])

verify_() -> None

Source code in xdsl/dialects/complex.py
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
def verify_(self) -> None:
    in_type = self.operand.type
    res_type = self.result.type

    # We allow this to be legal as it can be folded away
    if in_type == res_type:
        return

    if in_complex := isa(in_type, ComplexType[AnyFloat]):
        in_bitwidth = in_type.element_type.bitwidth * 2
    else:
        in_bitwidth = cast(FixedBitwidthType, in_type).bitwidth

    if out_complex := isa(res_type, ComplexType[AnyFloat]):
        out_bitwidth = res_type.element_type.bitwidth * 2
    else:
        out_bitwidth = cast(FixedBitwidthType, res_type).bitwidth

    if not ((in_bitwidth == out_bitwidth) and (in_complex != out_complex)):
        raise VerifyException(
            f"Expected ('{in_type}', '{res_type}') to be bitcast between complex and equal arith types"
        )

ConjOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
289
290
291
@irdl_op_definition
class ConjOp(ComplexUnaryComplexResultOperation):
    name = "complex.conj"

name = 'complex.conj' class-attribute instance-attribute

ConstantOp

Bases: IRDLOperation, ConstantLikeInterface

Source code in xdsl/dialects/complex.py
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
@irdl_op_definition
class ConstantOp(IRDLOperation, ConstantLikeInterface):
    name = "complex.constant"
    T: ClassVar = VarConstraint("T", AnyFloatConstr | base(IntegerType))
    value = prop_def(
        ArrayOfConstraint(
            RangeOf(
                AnyOf(
                    [
                        ParamAttrConstraint(IntegerAttr, (AnyAttr(), T)),
                        ParamAttrConstraint(FloatAttr, (AnyAttr(), T)),
                    ]
                )
            ).of_length(EqIntConstraint(2))
        )
    )

    # In contrast to other operations, `complex.constant` can
    # have any complex result type, not just floating point:
    complex = result_def(ComplexType.constr(T))

    traits = traits_def(Pure())

    assembly_format = "$value attr-dict `:` type($complex)"

    def __init__(self, value: ArrayAttr, result_type: ComplexType):
        super().__init__(properties={"value": value}, result_types=[result_type])

    def get_constant_value(self) -> Attribute:
        return self.value

    @staticmethod
    def from_floats(value: tuple[float, float], type: AnyFloat) -> ConstantOp:
        return ConstantOp(
            ArrayAttr([FloatAttr(value[0], type), FloatAttr(value[1], type)]),
            ComplexType(type),
        )

    @staticmethod
    def from_ints(value: tuple[int, int], type: IntegerType) -> ConstantOp:
        return ConstantOp(
            ArrayAttr([IntegerAttr(value[0], type), IntegerAttr(value[1], type)]),
            ComplexType(type),
        )

name = 'complex.constant' class-attribute instance-attribute

T: ClassVar = VarConstraint('T', AnyFloatConstr | base(IntegerType)) class-attribute instance-attribute

value = prop_def(ArrayOfConstraint(RangeOf(AnyOf([ParamAttrConstraint(IntegerAttr, (AnyAttr(), T)), ParamAttrConstraint(FloatAttr, (AnyAttr(), T))])).of_length(EqIntConstraint(2)))) class-attribute instance-attribute

complex = result_def(ComplexType.constr(T)) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$value attr-dict `:` type($complex)' class-attribute instance-attribute

__init__(value: ArrayAttr, result_type: ComplexType)

Source code in xdsl/dialects/complex.py
319
320
def __init__(self, value: ArrayAttr, result_type: ComplexType):
    super().__init__(properties={"value": value}, result_types=[result_type])

get_constant_value() -> Attribute

Source code in xdsl/dialects/complex.py
322
323
def get_constant_value(self) -> Attribute:
    return self.value

from_floats(value: tuple[float, float], type: AnyFloat) -> ConstantOp staticmethod

Source code in xdsl/dialects/complex.py
325
326
327
328
329
330
@staticmethod
def from_floats(value: tuple[float, float], type: AnyFloat) -> ConstantOp:
    return ConstantOp(
        ArrayAttr([FloatAttr(value[0], type), FloatAttr(value[1], type)]),
        ComplexType(type),
    )

from_ints(value: tuple[int, int], type: IntegerType) -> ConstantOp staticmethod

Source code in xdsl/dialects/complex.py
332
333
334
335
336
337
@staticmethod
def from_ints(value: tuple[int, int], type: IntegerType) -> ConstantOp:
    return ConstantOp(
        ArrayAttr([IntegerAttr(value[0], type), IntegerAttr(value[1], type)]),
        ComplexType(type),
    )

CosOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
340
341
342
@irdl_op_definition
class CosOp(ComplexUnaryComplexResultOperation):
    name = "complex.cos"

name = 'complex.cos' class-attribute instance-attribute

CreateOp

Bases: IRDLOperation

Source code in xdsl/dialects/complex.py
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
@irdl_op_definition
class CreateOp(IRDLOperation):
    name = "complex.create"
    T: ClassVar = VarConstraint("T", AnyFloatConstr)
    real = operand_def(T)
    imaginary = operand_def(T)
    complex = result_def(ComplexType.constr(T))

    traits = traits_def(Pure())

    assembly_format = "$real `,` $imaginary attr-dict `:` type($complex)"

    def __init__(
        self,
        real: SSAValue | Operation,
        imaginary: SSAValue | Operation,
        result_type: ComplexType,
    ):
        super().__init__(operands=[real, imaginary], result_types=[result_type])

name = 'complex.create' class-attribute instance-attribute

T: ClassVar = VarConstraint('T', AnyFloatConstr) class-attribute instance-attribute

real = operand_def(T) class-attribute instance-attribute

imaginary = operand_def(T) class-attribute instance-attribute

complex = result_def(ComplexType.constr(T)) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

assembly_format = '$real `,` $imaginary attr-dict `:` type($complex)' class-attribute instance-attribute

__init__(real: SSAValue | Operation, imaginary: SSAValue | Operation, result_type: ComplexType)

Source code in xdsl/dialects/complex.py
357
358
359
360
361
362
363
def __init__(
    self,
    real: SSAValue | Operation,
    imaginary: SSAValue | Operation,
    result_type: ComplexType,
):
    super().__init__(operands=[real, imaginary], result_types=[result_type])

DivOp dataclass

Bases: ComplexBinaryOp

Source code in xdsl/dialects/complex.py
366
367
368
@irdl_op_definition
class DivOp(ComplexBinaryOp):
    name = "complex.div"

name = 'complex.div' class-attribute instance-attribute

EqualOp dataclass

Bases: ComplexCompareOp

Source code in xdsl/dialects/complex.py
371
372
373
@irdl_op_definition
class EqualOp(ComplexCompareOp):
    name = "complex.eq"

name = 'complex.eq' class-attribute instance-attribute

ExpOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
376
377
378
@irdl_op_definition
class ExpOp(ComplexUnaryComplexResultOperation):
    name = "complex.exp"

name = 'complex.exp' class-attribute instance-attribute

Expm1Op dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
381
382
383
@irdl_op_definition
class Expm1Op(ComplexUnaryComplexResultOperation):
    name = "complex.expm1"

name = 'complex.expm1' class-attribute instance-attribute

ImOp dataclass

Bases: ComplexUnaryRealResultOperation

Source code in xdsl/dialects/complex.py
386
387
388
@irdl_op_definition
class ImOp(ComplexUnaryRealResultOperation):
    name = "complex.im"

name = 'complex.im' class-attribute instance-attribute

LogOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
391
392
393
@irdl_op_definition
class LogOp(ComplexUnaryComplexResultOperation):
    name = "complex.log"

name = 'complex.log' class-attribute instance-attribute

Log1pOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
396
397
398
@irdl_op_definition
class Log1pOp(ComplexUnaryComplexResultOperation):
    name = "complex.log1p"

name = 'complex.log1p' class-attribute instance-attribute

MulOp dataclass

Bases: ComplexBinaryOp

Source code in xdsl/dialects/complex.py
401
402
403
@irdl_op_definition
class MulOp(ComplexBinaryOp):
    name = "complex.mul"

name = 'complex.mul' class-attribute instance-attribute

NegOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
406
407
408
@irdl_op_definition
class NegOp(ComplexUnaryComplexResultOperation):
    name = "complex.neg"

name = 'complex.neg' class-attribute instance-attribute

NotEqualOp dataclass

Bases: ComplexCompareOp

Source code in xdsl/dialects/complex.py
411
412
413
@irdl_op_definition
class NotEqualOp(ComplexCompareOp):
    name = "complex.neq"

name = 'complex.neq' class-attribute instance-attribute

PowOp dataclass

Bases: ComplexBinaryOp

Source code in xdsl/dialects/complex.py
416
417
418
@irdl_op_definition
class PowOp(ComplexBinaryOp):
    name = "complex.pow"

name = 'complex.pow' class-attribute instance-attribute

ReOp dataclass

Bases: ComplexUnaryRealResultOperation

Source code in xdsl/dialects/complex.py
421
422
423
@irdl_op_definition
class ReOp(ComplexUnaryRealResultOperation):
    name = "complex.re"

name = 'complex.re' class-attribute instance-attribute

RsqrtOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
426
427
428
@irdl_op_definition
class RsqrtOp(ComplexUnaryComplexResultOperation):
    name = "complex.rsqrt"

name = 'complex.rsqrt' class-attribute instance-attribute

SignOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
431
432
433
@irdl_op_definition
class SignOp(ComplexUnaryComplexResultOperation):
    name = "complex.sign"

name = 'complex.sign' class-attribute instance-attribute

SinOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
436
437
438
@irdl_op_definition
class SinOp(ComplexUnaryComplexResultOperation):
    name = "complex.sin"

name = 'complex.sin' class-attribute instance-attribute

SqrtOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
441
442
443
@irdl_op_definition
class SqrtOp(ComplexUnaryComplexResultOperation):
    name = "complex.sqrt"

name = 'complex.sqrt' class-attribute instance-attribute

SubOp dataclass

Bases: ComplexBinaryOp

Source code in xdsl/dialects/complex.py
446
447
448
@irdl_op_definition
class SubOp(ComplexBinaryOp):
    name = "complex.sub"

name = 'complex.sub' class-attribute instance-attribute

TanOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
451
452
453
@irdl_op_definition
class TanOp(ComplexUnaryComplexResultOperation):
    name = "complex.tan"

name = 'complex.tan' class-attribute instance-attribute

TanhOp dataclass

Bases: ComplexUnaryComplexResultOperation

Source code in xdsl/dialects/complex.py
456
457
458
@irdl_op_definition
class TanhOp(ComplexUnaryComplexResultOperation):
    name = "complex.tanh"

name = 'complex.tanh' class-attribute instance-attribute