Module melior::dialect::ods::math

source ·
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§

Functions§