Beaver.MLIR.Dialect.Math (beaver v0.4.8)

Copy Markdown

Summary

Functions

Return op name math.absf as a bitstring.

math.absf - floating point absolute-value operation

Return op name math.absi as a bitstring.

math.absi - integer absolute-value operation

Return op name math.acos as a bitstring.

math.acos - arcus cosine of the specified value

Return op name math.acosh as a bitstring.

math.acosh - Hyperbolic arcus cosine of the given value

Return op name math.asin as a bitstring.

math.asin - arcus sine of the given value

Return op name math.asinh as a bitstring.

math.asinh - hyperbolic arcus sine of the given value

Return op name math.atan2 as a bitstring.

math.atan2 - 2-argument arcus tangent of the given values

Return op name math.atan as a bitstring.

math.atan - arcus tangent of the given value

Return op name math.atanh as a bitstring.

math.atanh - hyperbolic arcus tangent of the given value

Return op name math.cbrt as a bitstring.

math.cbrt - cube root of the specified value

Return op name math.ceil as a bitstring.

math.ceil - ceiling of the specified value

Return op name math.clampf as a bitstring.

math.clampf - floating point clamping operation

Return op name math.copysign as a bitstring.

math.copysign - A copysign operation

Return op name math.cos as a bitstring.

math.cos - cosine of the specified value

Return op name math.cosh as a bitstring.

math.cosh - hyperbolic cosine of the specified value

Return op name math.ctlz as a bitstring.

math.ctlz - counts the leading zeros an integer value

Return op name math.ctpop as a bitstring.

math.ctpop - counts the number of set bits of an integer value

Return op name math.cttz as a bitstring.

math.cttz - counts the trailing zeros an integer value

Return op name math.erf as a bitstring.

math.erf - error function of the specified value

Return op name math.erfc as a bitstring.

math.erfc - complementary error function of the specified value

Return op name math.exp2 as a bitstring.

math.exp2 - base-2 exponential of the specified value

Return op name math.exp as a bitstring.

math.exp - base-e exponential of the specified value

Return op name math.expm1 as a bitstring.

math.expm1 - base-e exponential of the specified value minus 1

Return op name math.floor as a bitstring.

math.floor - floor of the specified value

Return op name math.fma as a bitstring.

math.fma - floating point fused multipy-add operation

Return op name math.fpowi as a bitstring.

math.fpowi - floating point raised to the signed integer power

Return op name math.ipowi as a bitstring.

math.ipowi - signed integer raised to the power of operation

Return op name math.isfinite as a bitstring.

math.isfinite - returns true if the operand classifies as finite

Return op name math.isinf as a bitstring.

math.isinf - returns true if the operand classifies as infinite

Return op name math.isnan as a bitstring.

math.isnan - returns true if the operand classifies as NaN

Return op name math.isnormal as a bitstring.

math.isnormal - returns true if the operand classifies as normal

Return op name math.log1p as a bitstring.

math.log1p - Computes the natural logarithm of one plus the given value

Return op name math.log2 as a bitstring.

math.log2 - base-2 logarithm of the specified value

Return op name math.log10 as a bitstring.

math.log10 - base-10 logarithm of the specified value

Return op name math.log as a bitstring.

math.log - base-e logarithm of the specified value

Return op name math.powf as a bitstring.

math.powf - floating point raised to the power of operation

Return op name math.round as a bitstring.

math.round - round of the specified value

Return op name math.roundeven as a bitstring.

math.roundeven - round of the specified value with halfway cases to even

Return op name math.rsqrt as a bitstring.

math.rsqrt - reciprocal of sqrt (1 / sqrt of the specified value)

Return op name math.sin as a bitstring.

math.sin - sine of the specified value

Return op name math.sincos as a bitstring.

math.sincos - sine and cosine of the specified value

Return op name math.sinh as a bitstring.

math.sinh - hyperbolic sine of the specified value

Return op name math.sqrt as a bitstring.

math.sqrt - sqrt of the specified value

Return op name math.tan as a bitstring.

math.tan - tangent of the specified value

Return op name math.tanh as a bitstring.

math.tanh - hyperbolic tangent of the specified value

Return op name math.trunc as a bitstring.

math.trunc - trunc of the specified value

Functions

absf()

Return op name math.absf as a bitstring.

absf(ssa)

math.absf - floating point absolute-value operation

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The absf operation computes the absolute value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.

Example:

// Scalar absolute value.
%a = math.absf %b : f64

absi()

Return op name math.absi as a bitstring.

absi(ssa)

math.absi - integer absolute-value operation

This op has support for result type inference.

Operands

  • operand - Single, SignlessIntegerOrIndexLike, signless-integer-like

Results

  • result - Single, SignlessIntegerOrIndexLike, signless-integer-like

Description

The absi operation computes the absolute value. It takes one operand of integer type (i.e., scalar, tensor or vector) and returns one result of the same type.

Example:

// Scalar absolute value.
%a = math.absi %b : i64

acos()

Return op name math.acos as a bitstring.

acos(ssa)

math.acos - arcus cosine of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The acos operation computes the arcus cosine of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar arcus cosine value.
%a = math.acos %b : f64

acosh()

Return op name math.acosh as a bitstring.

acosh(ssa)

math.acosh - Hyperbolic arcus cosine of the given value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

Syntax:

operation ::= ssa-id `=` `math.acosh` ssa-use `:` type

The acosh operation computes the arcus cosine of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Hyperbolic arcus cosine of scalar value.
%a = math.acosh %b : f64

asin()

Return op name math.asin as a bitstring.

asin(ssa)

math.asin - arcus sine of the given value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

Syntax:

operation ::= ssa-id `=` `math.asin` ssa-use `:` type

The asin operation computes the arcus sine of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Arcus sine of scalar value.
%a = math.asin %b : f64

asinh()

Return op name math.asinh as a bitstring.

asinh(ssa)

math.asinh - hyperbolic arcus sine of the given value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

Syntax:

operation ::= ssa-id `=` `math.asinh` ssa-use `:` type

The asinh operation computes the hyperbolic arcus sine of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Hyperbolic arcus sine of scalar value.
%a = math.asinh %b : f64

atan2()

Return op name math.atan2 as a bitstring.

atan2(ssa)

math.atan2 - 2-argument arcus tangent of the given values

This op has support for result type inference.

Attributes

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

Operands

  • lhs - Single, FloatLike, floating-point-like
  • rhs - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The atan2 operation takes two operands and returns one result, all of which must be of the same type. The operands must be of floating point type (i.e., scalar, tensor or vector).

The 2-argument arcus tangent atan2(y, x) returns the angle in the Euclidian plane between the positive x-axis and the ray through the point (x, y). It is a generalization of the 1-argument arcus tangent which returns the angle on the basis of the ratio y/x.

See also https://en.wikipedia.org/wiki/Atan2

Example:

// Scalar variant.
%a = math.atan2 %b, %c : f32

atan()

Return op name math.atan as a bitstring.

atan(ssa)

math.atan - arcus tangent of the given value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The atan operation computes the arcus tangent of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Arcus tangent of scalar value.
%a = math.atan %b : f64

atanh()

Return op name math.atanh as a bitstring.

atanh(ssa)

math.atanh - hyperbolic arcus tangent of the given value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

Syntax:

operation ::= ssa-id `=` `math.atanh` ssa-use `:` type

The atanh operation computes the hyperbolic arcus tangent of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Hyperbolic arcus tangent of scalar value.
%a = math.atanh %b : f64

cbrt()

Return op name math.cbrt as a bitstring.

cbrt(ssa)

math.cbrt - cube root of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The cbrt operation computes the cube root. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar cube root value.
%a = math.cbrt %b : f64

Note: This op is not equivalent to powf(..., 1/3.0).

ceil()

Return op name math.ceil as a bitstring.

ceil(ssa)

math.ceil - ceiling of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The ceil operation computes the ceiling of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar ceiling value.
%a = math.ceil %b : f64

clampf()

Return op name math.clampf as a bitstring.

clampf(ssa)

math.clampf - floating point clamping operation

This op has support for result type inference.

Attributes

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

Operands

  • value - Single, FloatLike, floating-point-like
  • min - Single, FloatLike, floating-point-like
  • max - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The clampf operation takes three operands and returns one result, each of these is required to be the same type. Operands must be of floating point type (i.e., scalar, tensor or vector).

The semantics of the operation are described by:

  clampf(value, min, max) = maxf(minf(value, max), min)

If min > max the resulting value is poison.

Example:

%d = math.clampf %value to [%min, %max] : f64

copysign()

Return op name math.copysign as a bitstring.

copysign(ssa)

math.copysign - A copysign operation

This op has support for result type inference.

Attributes

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

Operands

  • lhs - Single, FloatLike, floating-point-like
  • rhs - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The copysign returns a value with the magnitude of the first operand and the sign of the second operand. It takes two operands and returns one result of the same type. The operands must be of floating point type (i.e., scalar, tensor or vector). It has no standard attributes.

Example:

// Scalar copysign value.
%a = math.copysign %b, %c : f64

cos()

Return op name math.cos as a bitstring.

cos(ssa)

math.cos - cosine of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The cos operation computes the cosine of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar cosine value.
%a = math.cos %b : f64

cosh()

Return op name math.cosh as a bitstring.

cosh(ssa)

math.cosh - hyperbolic cosine of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The cosh operation computes the hyperbolic cosine. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar hyperbolic cosine value.
%a = math.cosh %b : f64

ctlz()

Return op name math.ctlz as a bitstring.

ctlz(ssa)

math.ctlz - counts the leading zeros an integer value

This op has support for result type inference.

Operands

  • operand - Single, SignlessIntegerOrIndexLike, signless-integer-like

Results

  • result - Single, SignlessIntegerOrIndexLike, signless-integer-like

Description

The ctlz operation computes the number of leading zeros of an integer value. It operates on scalar, tensor or vector.

Example:

// Scalar ctlz function value.
%a = math.ctlz %b : i32

ctpop()

Return op name math.ctpop as a bitstring.

ctpop(ssa)

math.ctpop - counts the number of set bits of an integer value

This op has support for result type inference.

Operands

  • operand - Single, SignlessIntegerOrIndexLike, signless-integer-like

Results

  • result - Single, SignlessIntegerOrIndexLike, signless-integer-like

Description

The ctpop operation computes the number of set bits of an integer value. It operates on scalar, tensor or vector.

Example:

// Scalar ctpop function value.
%a = math.ctpop %b : i32

cttz()

Return op name math.cttz as a bitstring.

cttz(ssa)

math.cttz - counts the trailing zeros an integer value

This op has support for result type inference.

Operands

  • operand - Single, SignlessIntegerOrIndexLike, signless-integer-like

Results

  • result - Single, SignlessIntegerOrIndexLike, signless-integer-like

Description

The cttz operation computes the number of trailing zeros of an integer value. It operates on scalar, tensor or vector.

Example:

// Scalar cttz function value.
%a = math.cttz %b : i32

erf()

Return op name math.erf as a bitstring.

erf(ssa)

math.erf - error function of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The erf operation computes the error function. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar error function value.
%a = math.erf %b : f64

erfc()

Return op name math.erfc as a bitstring.

erfc(ssa)

math.erfc - complementary error function of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The erfc operation computes the complementary error function, defined as 1-erf(x). This function is part of libm and is needed for accuracy, since simply calculating 1-erf(x) when x is close to 1 will give inaccurate results. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar error function value.
%a = math.erfc %b : f64

exp2()

Return op name math.exp2 as a bitstring.

exp2(ssa)

math.exp2 - base-2 exponential of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The exp operation takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar natural exponential.
%a = math.exp2 %b : f64

exp()

Return op name math.exp as a bitstring.

exp(ssa)

math.exp - base-e exponential of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The exp operation takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar natural exponential.
%a = math.exp %b : f64

expm1()

Return op name math.expm1 as a bitstring.

expm1(ssa)

math.expm1 - base-e exponential of the specified value minus 1

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

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

The expm1 operation takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar natural exponential minus 1.
%a = math.expm1 %b : f64

floor()

Return op name math.floor as a bitstring.

floor(ssa)

math.floor - floor of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The floor operation computes the floor of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar floor value.
%a = math.floor %b : f64

fma()

Return op name math.fma as a bitstring.

fma(ssa)

math.fma - floating point fused multipy-add operation

This op has support for result type inference.

Attributes

  • fastmath - Single, Arith_FastMathAttr, Floating point fast math flags
  • roundingmode - Optional, Arith_RoundingModeAttr, Floating point rounding mode

Operands

  • a - Single, FloatLike, floating-point-like
  • b - Single, FloatLike, floating-point-like
  • c - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The fma operation takes three operands and returns one result, each of these is required to be the same type. Operands must be of floating point type (i.e., scalar, tensor or vector).

Example:

// Scalar fused multiply-add: d = a*b + c
%d = math.fma %a, %b, %c : f64

// With an explicit IEEE-754 rounding mode.
%e = math.fma %a, %b, %c to_nearest_even : f64

The semantics of the operation correspond to those of the llvm.fma intrinsic. When no rounding mode is set, lowering to LLVM is guaranteed to produce the llvm.fma.* intrinsic. When a rounding mode is set, the LLVM lowering instead produces llvm.experimental.constrained.fma.

fpowi()

Return op name math.fpowi as a bitstring.

fpowi(ssa)

math.fpowi - floating point raised to the signed integer power

This op has support for result type inference.

Attributes

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

Operands

  • lhs - Single, FloatLike, floating-point-like
  • rhs - Single, SignlessIntegerOrIndexLike, signless-integer-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The fpowi operation takes a base operand of floating point type (i.e. scalar, tensor or vector) and a power operand of integer type (also scalar, tensor or vector) and returns one result of the same type as base. The result is base raised to the power of power. The operation is elementwise for non-scalars, e.g.:

%v = math.fpowi %base, %power : vector<2xf32>, vector<2xi32>

The result is a vector of:

[<math.fpowi %base[0], %power[0]>, <math.fpowi %base[1], %power[1]>]

Example:

// Scalar exponentiation.
%a = math.fpowi %base, %power : f64, i32

ipowi()

Return op name math.ipowi as a bitstring.

ipowi(ssa)

math.ipowi - signed integer raised to the power of operation

This op has support for result type inference.

Operands

  • lhs - Single, SignlessIntegerOrIndexLike, signless-integer-like
  • rhs - Single, SignlessIntegerOrIndexLike, signless-integer-like

Results

  • result - Single, SignlessIntegerOrIndexLike, signless-integer-like

Description

The ipowi operation takes two operands of integer type (i.e., scalar, tensor or vector) and returns one result of the same type. Operands must have the same type.

Example:

// Scalar signed integer exponentiation.
%a = math.ipowi %b, %c : i32

isfinite()

Return op name math.isfinite as a bitstring.

isfinite(ssa)

math.isfinite - returns true if the operand classifies as finite

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, BoolLike, bool-like

Description

Determines if the given floating-point number has finite value i.e. it is normal, subnormal or zero, but not infinite or NaN.

Example:

%f = math.isfinite %a : f32

isinf()

Return op name math.isinf as a bitstring.

isinf(ssa)

math.isinf - returns true if the operand classifies as infinite

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, BoolLike, bool-like

Description

Determines if the given floating-point number is positive or negative infinity.

Example:

%f = math.isinf %a : f32

isnan()

Return op name math.isnan as a bitstring.

isnan(ssa)

math.isnan - returns true if the operand classifies as NaN

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, BoolLike, bool-like

Description

Determines if the given floating-point number is a not-a-number (NaN) value.

Example:

%f = math.isnan %a : f32

isnormal()

Return op name math.isnormal as a bitstring.

isnormal(ssa)

math.isnormal - returns true if the operand classifies as normal

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, BoolLike, bool-like

Description

Determines if the given floating-point number is normal, i.e. is neither zero, subnormal, infinite, nor NaN.

Example:

%f = math.isnormal %a : f32

log1p()

Return op name math.log1p as a bitstring.

log1p(ssa)

math.log1p - Computes the natural logarithm of one plus the given value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

Computes the base-e logarithm of one plus the given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.

log1p(x) := log(1 + x)

Example:

// Scalar log1p operation.
%y = math.log1p %x : f64

log2()

Return op name math.log2 as a bitstring.

log2(ssa)

math.log2 - base-2 logarithm of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

Computes the base-2 logarithm of the given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.

Example:

// Scalar log2 operation.
%y = math.log2 %x : f64

log10()

Return op name math.log10 as a bitstring.

log10(ssa)

math.log10 - base-10 logarithm of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

Computes the base-10 logarithm of the given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.

Example:

// Scalar log10 operation.
%y = math.log10 %x : f64

log()

Return op name math.log as a bitstring.

log(ssa)

math.log - base-e logarithm of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

Computes the base-e logarithm of the given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.

Example:

// Scalar log operation.
%y = math.log %x : f64

powf()

Return op name math.powf as a bitstring.

powf(ssa)

math.powf - floating point raised to the power of operation

This op has support for result type inference.

Attributes

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

Operands

  • lhs - Single, FloatLike, floating-point-like
  • rhs - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The powf operation takes two operands of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. Operands must have the same type.

Example:

// Scalar exponentiation.
%a = math.powf %b, %c : f64

round()

Return op name math.round as a bitstring.

round(ssa)

math.round - round of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The round operation returns the operand rounded to the nearest integer value in floating-point format. It takes one operand of floating point type (i.e., scalar, tensor or vector) and produces one result of the same type. The operation rounds the argument to the nearest integer value in floating-point format, rounding halfway cases away from zero, regardless of the current rounding direction.

Example:

// Scalar round operation.
%a = math.round %b : f64

roundeven()

Return op name math.roundeven as a bitstring.

roundeven(ssa)

math.roundeven - round of the specified value with halfway cases to even

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The roundeven operation returns the operand rounded to the nearest integer value in floating-point format. It takes one operand of floating point type (i.e., scalar, tensor or vector) and produces one result of the same type. The operation rounds the argument to the nearest integer value in floating-point format, rounding halfway cases to even, regardless of the current rounding direction.

Example:

// Scalar round operation.
%a = math.roundeven %b : f64

rsqrt()

Return op name math.rsqrt as a bitstring.

rsqrt(ssa)

math.rsqrt - reciprocal of sqrt (1 / sqrt of the specified value)

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The rsqrt operation computes the reciprocal of the square root. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar reciprocal square root value.
%a = math.rsqrt %b : f64

sin()

Return op name math.sin as a bitstring.

sin(ssa)

math.sin - sine of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The sin operation computes the sine of a given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar sine value.
%a = math.sin %b : f64

sincos()

Return op name math.sincos as a bitstring.

sincos(ssa)

math.sincos - sine and cosine of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • sin - Single, FloatLike, floating-point-like
  • cos - Single, FloatLike, floating-point-like

Description

The sincos operation computes both the sine and cosine of a given value simultaneously. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns two results of the same type. This operation can be more efficient than computing sine and cosine separately when both values are needed.

Example:

// Scalar sine and cosine values.
%sin, %cos = math.sincos %input : f64

sinh()

Return op name math.sinh as a bitstring.

sinh(ssa)

math.sinh - hyperbolic sine of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The sinh operation computes the hyperbolic sine. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar hyperbolic sine value.
%a = math.sinh %b : f64

sqrt()

Return op name math.sqrt as a bitstring.

sqrt(ssa)

math.sqrt - sqrt of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The sqrt operation computes the square root. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar square root value.
%a = math.sqrt %b : f64

tan()

Return op name math.tan as a bitstring.

tan(ssa)

math.tan - tangent of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The tan operation computes the tangent. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar tangent value.
%a = math.tan %b : f64

tanh()

Return op name math.tanh as a bitstring.

tanh(ssa)

math.tanh - hyperbolic tangent of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The tanh operation computes the hyperbolic tangent. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type. It has no standard attributes.

Example:

// Scalar hyperbolic tangent value.
%a = math.tanh %b : f64

trunc()

Return op name math.trunc as a bitstring.

trunc(ssa)

math.trunc - trunc of the specified value

This op has support for result type inference.

Attributes

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

Operands

  • operand - Single, FloatLike, floating-point-like

Results

  • result - Single, FloatLike, floating-point-like

Description

The trunc operation returns the operand rounded to the nearest integer value in floating-point format. It takes one operand of floating point type (i.e., scalar, tensor or vector) and produces one result of the same type. The operation always rounds to the nearest integer not larger in magnitude than the operand, regardless of the current rounding direction.

Example:

// Scalar trunc operation.
%a = math.trunc %b : f64