Expand description
math
dialect.
The math dialect is intended to hold mathematical operations on integer and floating types beyond simple arithmetics. Each operation works on scalar, vector or tensor type. On vector and tensor type operations apply elementwise unless explicitly specified otherwise. As an example, the floating point absolute value can be expressed as:
// Scalar absolute value.
%a = math.absf %b : f64
// Vector elementwise absolute value.
%f = math.absf %g : vector<4xf32>
// Tensor elementwise absolute value.
%x = math.absf %y : tensor<4x?xf8>
Structs§
- An
absf
operation. Floating point absolute-value operation. - A builder for an
absf
operation. - An
absi
operation. Integer absolute-value operation. - A builder for an
absi
operation. - An
acos
operation. Arcus cosine of the specified value. - A builder for an
acos
operation. - An
acosh
operation. Hyperbolic arcus cosine of the given value. - A builder for an
acosh
operation. - An
asin
operation. Arcus sine of the given value. - A builder for an
asin
operation. - An
asinh
operation. Hyperbolic arcus sine of the given value. - A builder for an
asinh
operation. - An
atan2
operation. 2-argument arcus tangent of the given values. - A builder for an
atan2
operation. - An
atan
operation. Arcus tangent of the given value. - A builder for an
atan
operation. - An
atanh
operation. Hyperbolic arcus tangent of the given value. - A builder for an
atanh
operation. - A
cbrt
operation. Cube root of the specified value. - A builder for a
cbrt
operation. - A
ceil
operation. Ceiling of the specified value. - A builder for a
ceil
operation. - A
copysign
operation. A copysign operation. - A builder for a
copysign
operation. - A
cos
operation. Cosine of the specified value. - A builder for a
cos
operation. - A
cosh
operation. Hyperbolic cosine of the specified value. - A builder for a
cosh
operation. - A
ctlz
operation. Counts the leading zeros an integer value. - A builder for a
ctlz
operation. - A
cttz
operation. Counts the trailing zeros an integer value. - A builder for a
cttz
operation. - A
ctpop
operation. Counts the number of set bits of an integer value. - A builder for a
ctpop
operation. - An
erf
operation. Error function of the specified value. - A builder for an
erf
operation. - An
exp2
operation. Base-2 exponential of the specified value. - A builder for an
exp2
operation. - An
expm1
operation. Base-e exponential of the specified value minus 1. - A builder for an
expm1
operation. - An
exp
operation. Base-e exponential of the specified value. - A builder for an
exp
operation. - A
fpowi
operation. Floating point raised to the signed integer power. - A builder for a
fpowi
operation. - A
floor
operation. Floor of the specified value. - A builder for a
floor
operation. - A
fma
operation. Floating point fused multipy-add operation. - A builder for a
fma
operation. - An
ipowi
operation. Signed integer raised to the power of operation. - A builder for an
ipowi
operation. - A
log1p
operation. Computes the natural logarithm of one plus the given value. - A builder for a
log1p
operation. - A
log2
operation. Base-2 logarithm of the specified value. - A builder for a
log2
operation. - A
log10
operation. Base-10 logarithm of the specified value. - A builder for a
log10
operation. - A
log
operation. Base-e logarithm of the specified value. - A builder for a
log
operation. - A
powf
operation. Floating point raised to the power of operation. - A builder for a
powf
operation. - A
roundeven
operation. Round of the specified value with halfway cases to even. - A builder for a
roundeven
operation. - A
round
operation. Round of the specified value. - A builder for a
round
operation. - A
rsqrt
operation. Reciprocal of sqrt (1 / sqrt of the specified value). - A builder for a
rsqrt
operation. - A
sin
operation. Sine of the specified value. - A builder for a
sin
operation. - A
sinh
operation. Hyperbolic sine of the specified value. - A builder for a
sinh
operation. - A
sqrt
operation. Sqrt of the specified value. - A builder for a
sqrt
operation. - A
tan
operation. Tangent of the specified value. - A builder for a
tan
operation. - A
tanh
operation. Hyperbolic tangent of the specified value. - A builder for a
tanh
operation. - A
trunc
operation. Trunc of the specified value. - A builder for a
trunc
operation.
Functions§
- Creates an
absf
operation. - Creates an
absi
operation. - Creates an
acos
operation. - Creates an
acosh
operation. - Creates an
asin
operation. - Creates an
asinh
operation. - Creates an
atan
operation. - Creates an
atan2
operation. - Creates an
atanh
operation. - Creates a
cbrt
operation. - Creates a
ceil
operation. - Creates a
copysign
operation. - Creates a
cos
operation. - Creates a
cosh
operation. - Creates a
ctlz
operation. - Creates a
ctpop
operation. - Creates a
cttz
operation. - Creates an
erf
operation. - Creates an
exp
operation. - Creates an
exp2
operation. - Creates an
expm1
operation. - Creates a
floor
operation. - Creates a
fma
operation. - Creates a
fpowi
operation. - Creates an
ipowi
operation. - Creates a
log
operation. - Creates a
log1p
operation. - Creates a
log2
operation. - Creates a
log10
operation. - Creates a
powf
operation. - Creates a
round
operation. - Creates a
roundeven
operation. - Creates a
rsqrt
operation. - Creates a
sin
operation. - Creates a
sinh
operation. - Creates a
sqrt
operation. - Creates a
tan
operation. - Creates a
tanh
operation. - Creates a
trunc
operation.