pub enum PeepInstr {
}Expand description
A single instruction in the peephole instruction model.
The instruction set is intentionally small: it covers the stack-machine primitives that appear in common IR back-ends and for which standard peephole identities are well-known.
Variants§
Const(i64)
Push an immediate integer constant.
Add
Integer addition (pops two, pushes one).
Sub
Integer subtraction (pops two, pushes one).
Mul
Integer multiplication (pops two, pushes one).
Div
Integer division (pops two, pushes one).
Neg
Arithmetic negation (pops one, pushes one).
Load(String)
Load the value of a named variable.
Store(String)
Store the top-of-stack into a named variable.
Branch(String)
Conditional branch to the named label.
Jump(String)
Unconditional jump to the named label.
Ret
Return from the current function.
Dup
Duplicate the top-of-stack.
Pop
Discard the top-of-stack.
Swap
Swap the top two stack values.
Nop
No-operation (placeholder; removed by the dead-nop rule).