2 karma · joined Aug 7, 2014 (12y ago) · 4 submissions
comment 2y ago · link · parent
Each operand is either stored on the stack (s), a virtual register (r), or as an immediate value (i). The add instruction, for instance, has an add_ss variant, an add_rs, and an add_ri variant, among others.
Most instructions store their result in a register, so that subsequent instructions operating on the result can avoid a stack load.
i32/i64/f32/f64.const instructions are completely elided: instead of storing constant values on the stack, they are stored as an immediate operand for the next instruction (this is one area where stitch differs from wasm3, which preloads all constants for a function on the stack every time the function is called)
I hope that clarifies things :-)
comment 2y ago · link · parent
comment 2y ago · link · parent