Skip to main content

Module prim

Module prim 

Source
Expand description

Primitive expressions. Each node, such as Add or Ramp, is a PrimExpr whose new only checks its operand types; the functions of op, which operators such as &x + 1 call, also match the operand types and fold constants.

Re-exports§

pub use expr::*;
pub use op::*;
pub use vector_expr::*;

Modules§

expr
Primitive operations. Each node, such as Add, LT or Select, applies one operation to PrimExpr operands, lane by lane for vectors; its new checks the operand types and derives the node’s type, without the promotion and folding of op.
op
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.
vector_expr
Vector expressions. A vector is built from scalars by a Ramp (lanes values from base by stride) or a Broadcast (one value repeated), and rearranged by a Shuffle; its lane count is a constant or, for a scalable vector, vscale() * factor.

Functions§

expr_deep_equal
Return whether lhs and rhs are the same expression tree, comparing variables by identity; structural equality also matches distinct variables bound at the same place.