pub enum Expr {
Show 14 variants
Var(String),
Literal(Literal),
BinOp {
op: BinOp,
lhs: Box<Expr>,
rhs: Box<Expr>,
},
UnaryOp {
op: UnaryOp,
operand: Box<Expr>,
},
Call {
func: BuiltinFunc,
args: Vec<Expr>,
},
Index {
base: Box<Expr>,
index: Box<Expr>,
},
Cast {
expr: Box<Expr>,
to: Type,
},
ThreadId(Dimension),
WorkgroupId(Dimension),
WorkgroupSize(Dimension),
LaneId,
WaveWidth,
Load {
addr: Box<Expr>,
space: AddressSpace,
},
Shuffle {
value: Box<Expr>,
lane: Box<Expr>,
mode: ShuffleMode,
},
}Expand description
HIR expression producing a value.
Variants§
Var(String)
Variable reference.
Literal(Literal)
Literal constant.
BinOp
Binary operation.
UnaryOp
Unary operation.
Call
Built-in function call.
Index
Array/buffer indexing.
Cast
Type cast.
ThreadId(Dimension)
Thread ID in a given dimension.
WorkgroupId(Dimension)
Workgroup ID in a given dimension.
WorkgroupSize(Dimension)
Workgroup size in a given dimension.
LaneId
Lane ID within wave.
WaveWidth
Wave width (number of lanes).
Load
Load from memory.
Shuffle
Wave shuffle operation.
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more