Op

Enum Op 

Source
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.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Op

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnwindSafe for Op

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.