pub enum Op {
Show 67 variants
PushConst(u32),
Pop,
LoadHot(u8),
StoreHot(u8),
LoadQ(u8),
StoreQ(u8),
LoadCold(u32),
StoreCold(u32),
Add,
Sub,
Mul,
Div,
Mod,
Pow,
Neg,
Eq,
Neq,
Gt,
Lt,
Geq,
Leq,
And,
Or,
Not,
Sin,
Cos,
Tan,
Asin,
Acos,
Atan,
Sqrt,
Exp,
Log,
Log10,
Ln,
AbsF,
SignF,
Floor,
Ceil,
Round,
Fract,
Trunc,
Sinh,
Cosh,
Tanh,
Sqr,
ToRad,
ToDeg,
Int,
Bnot,
Atan2,
FmodF,
MinF,
MaxF,
Above,
Below,
Equal,
Band,
Bor,
Sigmoid,
ClampF,
IfSelect,
Rand,
Gmegabuf,
Megabuf,
GmegabufSet,
MegabufSet,
}Expand description
Stack-machine opcodes. The u8 / u32 payloads stay inline so the
Vec<Op> is a flat array the interpreter scans linearly.
Variants§
PushConst(u32)
Push consts[idx] onto the stack.
Pop
Drop the top of stack.
LoadHot(u8)
Push the value of hot slot idx (one of the HOT_* constants).
StoreHot(u8)
Pop and write into hot slot idx.
LoadQ(u8)
Push q-channel idx (0-based: LoadQ(0) → q1).
StoreQ(u8)
Pop and write into q-channel idx.
LoadCold(u32)
Push ctx.get(cold_names[idx]).unwrap_or(0.0).
StoreCold(u32)
Pop and call ctx.set(cold_names[idx], v).
Add
Sub
Mul
Div
Mod
Pow
Neg
Eq
Neq
Gt
Lt
Geq
Leq
And
Or
Not
Sin
Cos
Tan
Asin
Acos
Atan
Sqrt
Exp
Log
Log10
Ln
AbsF
SignF
Floor
Ceil
Round
Fract
Trunc
Sinh
Cosh
Tanh
Sqr
ToRad
ToDeg
Int
Bnot
Atan2
FmodF
MinF
MaxF
Above
Below
Equal
Band
Bor
Sigmoid
ClampF
IfSelect
MD2 if(cond, then, else) (and milkif) — if returns then
when cond != 0, else else. The bytecode evaluates both
branches and selects — same as evalexpr’s builtin if does.
Rand
rand(max) — pseudo-random value in [0, max) seeded by the
system clock (matches the evalexpr-registered rand).
Gmegabuf
gmegabuf(idx) — read slot idx from the thread-local gmegabuf.
Out-of-range / non-finite indices push 0.0.
Megabuf
megabuf(idx) — same shape as Gmegabuf against the megabuf.
GmegabufSet
gmegabuf_set(idx, val) — write val to slot idx. Pushes
0.0 (evalexpr returns Empty on assignments; the rest of the
VM treats that as a numeric 0.0).
MegabufSet
megabuf_set(idx, val) — same shape as GmegabufSet against
the megabuf.