Beaver.MLIR.Dialect.Complex (beaver v0.4.7)

Summary

Functions

complex.abs - computes absolute value of a complex number

complex.add - complex addition

complex.angle - computes argument value of a complex number

complex.atan2 - complex 2-argument arctangent

complex.bitcast - computes bitcast between complex and equal arith types

complex.conj - Calculate the complex conjugate

complex.constant

complex.cos - computes cosine of a complex number

complex.create - complex number creation operation

complex.div - complex division

complex.eq - computes whether two complex values are equal

complex.exp - computes exponential of a complex number

complex.expm1 - computes exponential of a complex number minus 1

complex.im - extracts the imaginary part of a complex number

complex.log1p - computes natural logarithm of a complex number

complex.log - computes natural logarithm of a complex number

complex.mul - complex multiplication

complex.neg - Negation operator

complex.neq - computes whether two complex values are not equal

complex.pow - complex power function

complex.powi - complex number raised to signed integer power

complex.re - extracts the real part of a complex number

complex.rsqrt - complex reciprocal of square root

complex.sign - computes sign of a complex number

complex.sin - computes sine of a complex number

complex.sqrt - complex square root

complex.sub - complex subtraction

complex.tan - computes tangent of a complex number

complex.tanh - complex hyperbolic tangent

Functions

abs(ssa)

complex.abs - computes absolute value of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyFloat, floating-point

Description

The abs op takes a single complex number and computes its absolute value.

Example:

%a = complex.abs %b : complex<f32>

add(ssa)

complex.add - complex addition

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The add operation takes two complex numbers and returns their sum.

Example:

%a = complex.add %b, %c : complex<f32>

angle(ssa)

complex.angle - computes argument value of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyFloat, floating-point

Description

The angle op takes a single complex number and computes its argument value with a branch cut along the negative real axis.

Example:

     %a = complex.angle %b : complex<f32>

atan2(ssa)

complex.atan2 - complex 2-argument arctangent

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

For complex numbers it is expressed using complex logarithm atan2(y, x) = -i log((x + i y) / sqrt(x2 + y2))

Example:

%a = complex.atan2 %b, %c : complex<f32>

bitcast(ssa)

complex.bitcast - computes bitcast between complex and equal arith types

Operands

  • operand - Single, AnyType, any type

Results

  • result - Single, AnyType, any type

Description

Example:

     %a = complex.bitcast %b : complex<f32> -> i64

conj(ssa)

complex.conj - Calculate the complex conjugate

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The conj op takes a single complex number and computes the complex conjugate.

Example:

%a = complex.conj %b: complex<f32>

constant(ssa)

complex.constant

cos(ssa)

complex.cos - computes cosine of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The cos op takes a single complex number and computes the cosine of it, i.e. cos(x), where x is the input value.

Example:

%a = complex.cos %b : complex<f32>

create(ssa)

complex.create - complex number creation operation

Operands

  • real - Single, AnyFloat, floating-point
  • imaginary - Single, AnyFloat, floating-point

Results

  • complex - Single, AnyComplex, complex type with floating-point elements

Description

The complex.create operation creates a complex number from two floating-point operands, the real and the imaginary part.

Example:

%a = complex.create %b, %c : complex<f32>

div(ssa)

complex.div - complex division

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The div operation takes two complex numbers and returns result of their division:

%a = complex.div %b, %c : complex<f32>

eq(ssa)

complex.eq - computes whether two complex values are equal

This op has support for result type inference.

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, I1, 1-bit signless integer

Description

The eq op takes two complex numbers and returns whether they are equal.

Example:

%a = complex.eq %b, %c : complex<f32>

exp(ssa)

complex.exp - computes exponential of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The exp op takes a single complex number and computes the exponential of it, i.e. exp(x) or e^(x), where x is the input value. e denotes Euler's number and is approximately equal to 2.718281.

Example:

%a = complex.exp %b : complex<f32>

expm1(ssa)

complex.expm1 - computes exponential of a complex number minus 1

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

complex.expm1(x) := complex.exp(x) - 1

Example:

%a = complex.expm1 %b : complex<f32>

im(ssa)

complex.im - extracts the imaginary part of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • imaginary - Single, AnyFloat, floating-point

Description

The im op takes a single complex number and extracts the imaginary part.

Example:

%a = complex.im %b : complex<f32>

log1p(ssa)

complex.log1p - computes natural logarithm of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The log op takes a single complex number and computes the natural logarithm of one plus the given value, i.e. log(1 + x) or log_e(1 + x), where x is the input value. e denotes Euler's number and is approximately equal to 2.718281.

Example:

%a = complex.log1p %b : complex<f32>

log(ssa)

complex.log - computes natural logarithm of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The log op takes a single complex number and computes the natural logarithm of it, i.e. log(x) or log_e(x), where x is the input value. e denotes Euler's number and is approximately equal to 2.718281.

Example:

%a = complex.log %b : complex<f32>

mul(ssa)

complex.mul - complex multiplication

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The mul operation takes two complex numbers and returns their product:

%a = complex.mul %b, %c : complex<f32>

neg(ssa)

complex.neg - Negation operator

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The neg op takes a single complex number complex and returns -complex.

Example:

%a = complex.neg %b : complex<f32>

neq(ssa)

complex.neq - computes whether two complex values are not equal

This op has support for result type inference.

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, I1, 1-bit signless integer

Description

The neq op takes two complex numbers and returns whether they are not equal.

Example:

%a = complex.neq %b, %c : complex<f32>

pow(ssa)

complex.pow - complex power function

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The pow operation takes a complex number raises it to the given complex exponent.

Example:

%a = complex.pow %b, %c : complex<f32>

powi(ssa)

complex.powi - complex number raised to signed integer power

This op has support for result type inference.

Attributes

  • fastmath - Optional, Arith_FastMathAttr, Floating point fast math flags

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnySignlessInteger, signless integer

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The powi operation takes a base operand of complex type and a power operand of signed integer type and returns one result of the same type as base. The result is base raised to the power of power.

Example:

%a = complex.powi %b, %c : complex<f32>, i32

re(ssa)

complex.re - extracts the real part of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • real - Single, AnyFloat, floating-point

Description

The re op takes a single complex number and extracts the real part.

Example:

%a = complex.re %b : complex<f32>

rsqrt(ssa)

complex.rsqrt - complex reciprocal of square root

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The rsqrt operation computes reciprocal of square root.

Example:

%a = complex.rsqrt %b : complex<f32>

sign(ssa)

complex.sign - computes sign of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The sign op takes a single complex number and computes the sign of it, i.e. y = sign(x) = x / |x| if x != 0, otherwise y = 0.

Example:

%a = complex.sign %b : complex<f32>

sin(ssa)

complex.sin - computes sine of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The sin op takes a single complex number and computes the sine of it, i.e. sin(x), where x is the input value.

Example:

%a = complex.sin %b : complex<f32>

sqrt(ssa)

complex.sqrt - complex square root

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The sqrt operation takes a complex number and returns its square root.

Example:

%a = complex.sqrt %b : complex<f32>

sub(ssa)

complex.sub - complex subtraction

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • lhs - Single, AnyComplex, complex type with floating-point elements
  • rhs - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The sub operation takes two complex numbers and returns their difference.

Example:

%a = complex.sub %b, %c : complex<f32>

tan(ssa)

complex.tan - computes tangent of a complex number

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The tan op takes a single complex number and computes the tangent of it, i.e. tan(x), where x is the input value.

Example:

%a = complex.tan %b : complex<f32>

tanh(ssa)

complex.tanh - complex hyperbolic tangent

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags

Operands

  • complex - Single, AnyComplex, complex type with floating-point elements

Results

  • result - Single, AnyComplex, complex type with floating-point elements

Description

The tanh operation takes a complex number and returns its hyperbolic tangent.

Example:

%a = complex.tanh %b : complex<f32>