Skip to main content

Module op

Module op 

Source
Expand description

Primitive operators. Each function, such as add, matches its operand types and folds constants, where a node constructor such as Add::new takes operands as given; Rust operators such as &x + 1 build an ExprResult, and PrimOps has the rest.

Structs§

ExprResult
An expression being built by operators, or the first error any step raised.

Enums§

ConstValue
The value of a constant: an integer or a double.

Traits§

Operand
An operand of an operator: an expression, an ExprResult or a literal.
PrimOps
The operations Rust has no operator for, as methods of ExprResult and every expression handle.

Functions§

abs
Build the absolute value of x; a constant folds.
abs_at
Build abs at the location loc.
acos
Build the arc cosine of the float x.
acos_at
Build acos at the location loc.
acosh
Build the inverse hyperbolic cosine of the float x.
acosh_at
Build acosh at the location loc.
add
Build a + b.
add_at
Build add at the location loc.
all
Build the conjunction of conds (Python tvm_tirx.ir.prim.op.all).
all_at
Build all at the location loc.
any
Build the disjunction of conds (Python tvm_tirx.ir.prim.op.any).
any_at
Build any at the location loc.
asin
Build the arc sine of the float x.
asin_at
Build asin at the location loc.
asinh
Build the inverse hyperbolic sine of the float x.
asinh_at
Build asinh at the location loc.
assume
Build a statement that cond holds, for simplifications.
assume_at
Build assume at the location loc.
atan
Build the arc tangent of the float x.
atan2
Build the arc tangent of x / y, by the signs of both.
atan2_at
Build atan2 at the location loc.
atan_at
Build atan at the location loc.
atanh
Build the inverse hyperbolic tangent of the float x.
atanh_at
Build atanh at the location loc.
bitwise_and
Build a & b of two integers or booleans.
bitwise_and_at
Build bitwise_and at the location loc.
bitwise_not
Build the node ~a of an integer or boolean, which neither promotes nor folds.
bitwise_not_at
Build bitwise_not at the location loc.
bitwise_or
Build a | b of two integers or booleans.
bitwise_or_at
Build bitwise_or at the location loc.
bitwise_xor
Build a ^ b of two integers or booleans.
bitwise_xor_at
Build bitwise_xor at the location loc.
cast
Convert value to the type ty, folding a constant that keeps its value and broadcasting a scalar to a vector type.
cast_at
Build cast at the location loc.
ceil
Round x up.
ceil_at
Build ceil at the location loc.
ceildiv
Build a / b, rounding up, of two integers: floordiv(a + b - 1, b).
ceildiv_at
Build ceildiv at the location loc.
clz
Build the number of leading zero bits of x.
clz_at
Build clz at the location loc.
convert
Convert value into a primitive expression: a Rust bool, integer or float becomes a constant of the default type, and a primitive expression is returned as is (prim.convert).
copysign
Build x with the sign of y.
copysign_at
Build copysign at the location loc.
cos
Build the cosine of the float x.
cos_at
Build cos at the location loc.
cosh
Build the hyperbolic cosine of the float x.
cosh_at
Build cosh at the location loc.
div
Build a / b; integer division rounds towards zero.
div_at
Build div at the location loc.
eq
Build the boolean a == b.
eq_at
Build eq at the location loc.
erf
Build the error function of x.
erf_at
Build erf at the location loc.
exp
Build e to the power x.
exp2
Build 2 to the power x.
exp2_at
Build exp2 at the location loc.
exp10
Build 10 to the power x.
exp10_at
Build exp10 at the location loc.
exp_at
Build exp at the location loc.
floor
Round x down.
floor_at
Build floor at the location loc.
floordiv
Build a / b, rounding down, of two integers.
floordiv_at
Build floordiv at the location loc.
floormod
Build the remainder of floordiv, with the sign of b.
floormod_at
Build floormod at the location loc.
fma
Build x * y + z in one rounding.
fma_at
Build fma at the location loc.
fmod
Build the floating-point remainder of x / y, of two matched floats.
fmod_at
Build fmod at the location loc.
ge
Build the boolean a >= b.
ge_at
Build ge at the location loc.
gt
Build the boolean a > b.
gt_at
Build gt at the location loc.
hypot
Build sqrt(x * x + y * y).
hypot_at
Build hypot at the location loc.
if_then_else
Build true_value where cond holds and false_value elsewhere, evaluating only the chosen one.
if_then_else_at
Build if_then_else at the location loc.
indexdiv
Build a / b over non-negative indices, which is floordiv.
indexdiv_at
Build indexdiv at the location loc.
indexmod
Build a % b over non-negative indices, which is floormod.
indexmod_at
Build indexmod at the location loc.
infinity
Create the positive infinity of the scalar float16, float32 or float64 type ty.
infinity_at
Build infinity at the location loc.
isfinite
Build whether x is finite.
isfinite_at
Build isfinite at the location loc.
isinf
Build whether x is infinite.
isinf_at
Build isinf at the location loc.
isnan
Build whether x is NaN.
isnan_at
Build isnan at the location loc.
ldexp
Build x * 2 ^ y.
ldexp_at
Build ldexp at the location loc.
le
Build the boolean a <= b.
le_at
Build le at the location loc.
likely
Mark cond as likely to hold; an integer constant is itself.
likely_at
Build likely at the location loc.
log
Build the natural logarithm of x.
log2
Build the base-2 logarithm of x.
log1p
Build log(1 + x).
log1p_at
Build log1p at the location loc.
log2_at
Build log2 at the location loc.
log10
Build the base-10 logarithm of x.
log10_at
Build log10 at the location loc.
log_at
Build log at the location loc.
logical_and
Build the boolean a && b; a constant side folds.
logical_and_at
Build logical_and at the location loc.
logical_not
Build the boolean !a; a constant folds.
logical_not_at
Build logical_not at the location loc.
logical_or
Build the boolean a || b; a constant side folds.
logical_or_at
Build logical_or at the location loc.
lt
Build the boolean a < b.
lt_at
Build lt at the location loc.
make_const
Create the constant value of the type ty, broadcast over the lanes of a vector type.
make_const_at
Build make_const at the location loc.
match_types
Bring a and b to one type, as every binary operator does first.
match_types_at
Run match_types with the casts at the location loc.
max
Build the larger of a and b; a symbolic infinity on either side decides it.
max_at
Build max at the location loc.
max_value
Create the largest value of the scalar type ty.
max_value_at
Build max_value at the location loc.
min
Build the smaller of a and b; a symbolic infinity on either side decides it.
min_at
Build min at the location loc.
min_value
Create the smallest value of the scalar type ty.
min_value_at
Build min_value at the location loc.
mul
Build a * b.
mul_at
Build mul at the location loc.
ne
Build the boolean a != b.
ne_at
Build ne at the location loc.
nearbyint
Round x to the nearest integer under the current rounding mode, a tie to even.
nearbyint_at
Build nearbyint at the location loc.
neg
Build -a, folding a constant.
neg_at
Build neg at the location loc.
nextafter
Build the next representable value after x towards y.
nextafter_at
Build nextafter at the location loc.
popcount
Build the number of set bits of x.
popcount_at
Build popcount at the location loc.
pow
Build x to the power y, of two matched floats.
pow_at
Build pow at the location loc.
round
Round x to the nearest integer; a constant folds a tie to even.
round_at
Build round at the location loc.
rsqrt
Build the reciprocal square root of x.
rsqrt_at
Build rsqrt at the location loc.
shift_left
Build a << b of two integers.
shift_left_at
Build shift_left at the location loc.
shift_right
Build a >> b of two integers, sign-extending.
shift_right_at
Build shift_right at the location loc.
sigmoid
Build the sigmoid of x.
sigmoid_at
Build sigmoid at the location loc.
sin
Build the sine of the float x.
sin_at
Build sin at the location loc.
sinh
Build the hyperbolic sine of the float x.
sinh_at
Build sinh at the location loc.
sqrt
Build the square root of x.
sqrt_at
Build sqrt at the location loc.
sub
Build a - b.
sub_at
Build sub at the location loc.
tan
Build the tangent of the float x.
tan_at
Build tan at the location loc.
tanh
Build the hyperbolic tangent of the float x.
tanh_at
Build tanh at the location loc.
trunc
Round x towards zero.
trunc_at
Build trunc at the location loc.
truncdiv
Build a / b, rounding towards zero, of two integers.
truncdiv_at
Build truncdiv at the location loc.
truncmod
Build the remainder of truncdiv, with the sign of a.
truncmod_at
Build truncmod at the location loc.
vscale
Build the int32 call vscale(), the factor of the lanes of a scalable vector (prim.vscale).
vscale_at
Build vscale at the location loc.