pub enum Instr<'a> {
Show 19 variants
Add(Value, Value),
Sub(Value, Value),
Mul(Value, Value),
Div(Value, Value),
Rem(Value, Value),
Cmp(Type<'a>, Cmp, Value, Value),
And(Value, Value),
Or(Value, Value),
Copy(Value),
Ret(Option<Value>),
Jnz(Value, String, String),
Jmp(String),
Call(String, Vec<(Type<'a>, Value)>),
Alloc4(u32),
Alloc8(u64),
Alloc16(u128),
Store(Type<'a>, Value, Value),
Load(Type<'a>, Value),
Blit(Value, Value, u64),
}Expand description
QBE instruction
Variants§
Add(Value, Value)
Adds values of two temporaries together
Sub(Value, Value)
Subtracts the second value from the first one
Mul(Value, Value)
Multiplies values of two temporaries
Div(Value, Value)
Divides the first value by the second one
Rem(Value, Value)
Returns a remainder from division
Cmp(Type<'a>, Cmp, Value, Value)
Performs a comparion between values
And(Value, Value)
Performs a bitwise AND on values
Or(Value, Value)
Performs a bitwise OR on values
Copy(Value)
Copies either a temporary or a literal value
Ret(Option<Value>)
Return from a function, optionally with a value
Jnz(Value, String, String)
Jumps to first label if a value is nonzero or to the second one otherwise
Jmp(String)
Unconditionally jumps to a label
Call(String, Vec<(Type<'a>, Value)>)
Calls a function
Alloc4(u32)
Allocates a 4-byte aligned area on the stack
Alloc8(u64)
Allocates a 8-byte aligned area on the stack
Alloc16(u128)
Allocates a 16-byte aligned area on the stack
Store(Type<'a>, Value, Value)
Stores a value into memory pointed to by destination.
(type, destination, value)
Load(Type<'a>, Value)
Loads a value from memory pointed to by source
(type, source)
Blit(Value, Value, u64)
(source, destination, n)
Copy n bytes from the source address to the destination address.
n must be a constant value.
Minimum supported QBE version
1.1
Trait Implementations§
source§impl<'a> Ord for Instr<'a>
impl<'a> Ord for Instr<'a>
source§impl<'a> PartialOrd<Instr<'a>> for Instr<'a>
impl<'a> PartialOrd<Instr<'a>> for Instr<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more