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§
- Expr
Result - An expression being built by operators, or the first error any step raised.
Enums§
- Const
Value - The value of a constant: an integer or a double.
Traits§
- Operand
- An operand of an operator: an expression, an
ExprResultor a literal. - PrimOps
- The operations Rust has no operator for, as methods of
ExprResultand every expression handle.
Functions§
- abs
- Build the absolute value of
x; a constant folds. - abs_at
- Build
absat the locationloc. - acos
- Build the arc cosine of the float
x. - acos_at
- Build
acosat the locationloc. - acosh
- Build the inverse hyperbolic cosine of the float
x. - acosh_
at - Build
acoshat the locationloc. - add
- Build
a + b. - add_at
- Build
addat the locationloc. - all
- Build the conjunction of
conds(Pythontvm_tirx.ir.prim.op.all). - all_at
- Build
allat the locationloc. - any
- Build the disjunction of
conds(Pythontvm_tirx.ir.prim.op.any). - any_at
- Build
anyat the locationloc. - asin
- Build the arc sine of the float
x. - asin_at
- Build
asinat the locationloc. - asinh
- Build the inverse hyperbolic sine of the float
x. - asinh_
at - Build
asinhat the locationloc. - assume
- Build a statement that
condholds, for simplifications. - assume_
at - Build
assumeat the locationloc. - 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
atan2at the locationloc. - atan_at
- Build
atanat the locationloc. - atanh
- Build the inverse hyperbolic tangent of the float
x. - atanh_
at - Build
atanhat the locationloc. - bitwise_
and - Build
a & bof two integers or booleans. - bitwise_
and_ at - Build
bitwise_andat the locationloc. - bitwise_
not - Build the node
~aof an integer or boolean, which neither promotes nor folds. - bitwise_
not_ at - Build
bitwise_notat the locationloc. - bitwise_
or - Build
a | bof two integers or booleans. - bitwise_
or_ at - Build
bitwise_orat the locationloc. - bitwise_
xor - Build
a ^ bof two integers or booleans. - bitwise_
xor_ at - Build
bitwise_xorat the locationloc. - cast
- Convert
valueto the typety, folding a constant that keeps its value and broadcasting a scalar to a vector type. - cast_at
- Build
castat the locationloc. - ceil
- Round
xup. - ceil_at
- Build
ceilat the locationloc. - ceildiv
- Build
a / b, rounding up, of two integers:floordiv(a + b - 1, b). - ceildiv_
at - Build
ceildivat the locationloc. - clz
- Build the number of leading zero bits of
x. - clz_at
- Build
clzat the locationloc. - convert
- Convert
valueinto a primitive expression: a Rustbool, integer or float becomes a constant of the default type, and a primitive expression is returned as is (prim.convert). - copysign
- Build
xwith the sign ofy. - copysign_
at - Build
copysignat the locationloc. - cos
- Build the cosine of the float
x. - cos_at
- Build
cosat the locationloc. - cosh
- Build the hyperbolic cosine of the float
x. - cosh_at
- Build
coshat the locationloc. - div
- Build
a / b; integer division rounds towards zero. - div_at
- Build
divat the locationloc. - eq
- Build the boolean
a == b. - eq_at
- Build
eqat the locationloc. - erf
- Build the error function of
x. - erf_at
- Build
erfat the locationloc. - exp
- Build
eto the powerx. - exp2
- Build
2to the powerx. - exp2_at
- Build
exp2at the locationloc. - exp10
- Build
10to the powerx. - exp10_
at - Build
exp10at the locationloc. - exp_at
- Build
expat the locationloc. - floor
- Round
xdown. - floor_
at - Build
floorat the locationloc. - floordiv
- Build
a / b, rounding down, of two integers. - floordiv_
at - Build
floordivat the locationloc. - floormod
- Build the remainder of
floordiv, with the sign ofb. - floormod_
at - Build
floormodat the locationloc. - fma
- Build
x * y + zin one rounding. - fma_at
- Build
fmaat the locationloc. - fmod
- Build the floating-point remainder of
x / y, of two matched floats. - fmod_at
- Build
fmodat the locationloc. - ge
- Build the boolean
a >= b. - ge_at
- Build
geat the locationloc. - gt
- Build the boolean
a > b. - gt_at
- Build
gtat the locationloc. - hypot
- Build
sqrt(x * x + y * y). - hypot_
at - Build
hypotat the locationloc. - if_
then_ else - Build
true_valuewherecondholds andfalse_valueelsewhere, evaluating only the chosen one. - if_
then_ else_ at - Build
if_then_elseat the locationloc. - indexdiv
- Build
a / bover non-negative indices, which isfloordiv. - indexdiv_
at - Build
indexdivat the locationloc. - indexmod
- Build
a % bover non-negative indices, which isfloormod. - indexmod_
at - Build
indexmodat the locationloc. - infinity
- Create the positive infinity of the scalar
float16,float32orfloat64typety. - infinity_
at - Build
infinityat the locationloc. - isfinite
- Build whether
xis finite. - isfinite_
at - Build
isfiniteat the locationloc. - isinf
- Build whether
xis infinite. - isinf_
at - Build
isinfat the locationloc. - isnan
- Build whether
xis NaN. - isnan_
at - Build
isnanat the locationloc. - ldexp
- Build
x * 2 ^ y. - ldexp_
at - Build
ldexpat the locationloc. - le
- Build the boolean
a <= b. - le_at
- Build
leat the locationloc. - likely
- Mark
condas likely to hold; an integer constant is itself. - likely_
at - Build
likelyat the locationloc. - log
- Build the natural logarithm of
x. - log2
- Build the base-2 logarithm of
x. - log1p
- Build
log(1 + x). - log1p_
at - Build
log1pat the locationloc. - log2_at
- Build
log2at the locationloc. - log10
- Build the base-10 logarithm of
x. - log10_
at - Build
log10at the locationloc. - log_at
- Build
logat the locationloc. - logical_
and - Build the boolean
a && b; a constant side folds. - logical_
and_ at - Build
logical_andat the locationloc. - logical_
not - Build the boolean
!a; a constant folds. - logical_
not_ at - Build
logical_notat the locationloc. - logical_
or - Build the boolean
a || b; a constant side folds. - logical_
or_ at - Build
logical_orat the locationloc. - lt
- Build the boolean
a < b. - lt_at
- Build
ltat the locationloc. - make_
const - Create the constant
valueof the typety, broadcast over the lanes of a vector type. - make_
const_ at - Build
make_constat the locationloc. - match_
types - Bring
aandbto one type, as every binary operator does first. - match_
types_ at - Run
match_typeswith the casts at the locationloc. - max
- Build the larger of
aandb; a symbolic infinity on either side decides it. - max_at
- Build
maxat the locationloc. - max_
value - Create the largest value of the scalar type
ty. - max_
value_ at - Build
max_valueat the locationloc. - min
- Build the smaller of
aandb; a symbolic infinity on either side decides it. - min_at
- Build
minat the locationloc. - min_
value - Create the smallest value of the scalar type
ty. - min_
value_ at - Build
min_valueat the locationloc. - mul
- Build
a * b. - mul_at
- Build
mulat the locationloc. - ne
- Build the boolean
a != b. - ne_at
- Build
neat the locationloc. - nearbyint
- Round
xto the nearest integer under the current rounding mode, a tie to even. - nearbyint_
at - Build
nearbyintat the locationloc. - neg
- Build
-a, folding a constant. - neg_at
- Build
negat the locationloc. - nextafter
- Build the next representable value after
xtowardsy. - nextafter_
at - Build
nextafterat the locationloc. - popcount
- Build the number of set bits of
x. - popcount_
at - Build
popcountat the locationloc. - pow
- Build
xto the powery, of two matched floats. - pow_at
- Build
powat the locationloc. - round
- Round
xto the nearest integer; a constant folds a tie to even. - round_
at - Build
roundat the locationloc. - rsqrt
- Build the reciprocal square root of
x. - rsqrt_
at - Build
rsqrtat the locationloc. - shift_
left - Build
a << bof two integers. - shift_
left_ at - Build
shift_leftat the locationloc. - shift_
right - Build
a >> bof two integers, sign-extending. - shift_
right_ at - Build
shift_rightat the locationloc. - sigmoid
- Build the sigmoid of
x. - sigmoid_
at - Build
sigmoidat the locationloc. - sin
- Build the sine of the float
x. - sin_at
- Build
sinat the locationloc. - sinh
- Build the hyperbolic sine of the float
x. - sinh_at
- Build
sinhat the locationloc. - sqrt
- Build the square root of
x. - sqrt_at
- Build
sqrtat the locationloc. - sub
- Build
a - b. - sub_at
- Build
subat the locationloc. - tan
- Build the tangent of the float
x. - tan_at
- Build
tanat the locationloc. - tanh
- Build the hyperbolic tangent of the float
x. - tanh_at
- Build
tanhat the locationloc. - trunc
- Round
xtowards zero. - trunc_
at - Build
truncat the locationloc. - truncdiv
- Build
a / b, rounding towards zero, of two integers. - truncdiv_
at - Build
truncdivat the locationloc. - truncmod
- Build the remainder of
truncdiv, with the sign ofa. - truncmod_
at - Build
truncmodat the locationloc. - vscale
- Build the
int32callvscale(), the factor of the lanes of a scalable vector (prim.vscale). - vscale_
at - Build
vscaleat the locationloc.