Enum qbe::Instr

source ·
pub enum Instr<'a> {
Show 19 variants Add(ValueValue), Sub(ValueValue), Mul(ValueValue), Div(ValueValue), Rem(ValueValue), Cmp(Type<'a>, CmpValueValue), And(ValueValue), Or(ValueValue), Copy(Value), Ret(Option<Value>), Jnz(ValueStringString), Jmp(String), Call(StringVec<(Type<'a>, Value)>), Alloc4(u32), Alloc8(u64), Alloc16(u128), Store(Type<'a>, ValueValue), Load(Type<'a>, Value), Blit(ValueValueu64),
}
Expand description

QBE instruction

Variants§

§

Add(ValueValue)

Adds values of two temporaries together

§

Sub(ValueValue)

Subtracts the second value from the first one

§

Mul(ValueValue)

Multiplies values of two temporaries

§

Div(ValueValue)

Divides the first value by the second one

§

Rem(ValueValue)

Returns a remainder from division

§

Cmp(Type<'a>, CmpValueValue)

Performs a comparion between values

§

And(ValueValue)

Performs a bitwise AND on values

§

Or(ValueValue)

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(ValueStringString)

Jumps to first label if a value is nonzero or to the second one otherwise

§

Jmp(String)

Unconditionally jumps to a label

§

Call(StringVec<(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>, ValueValue)

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(ValueValueu64)

(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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.