pub enum CoreInstruction {
Show 47 variants
Alloca(GaiaType, usize),
Load(GaiaType),
Store(GaiaType),
Gep {
base_type: GaiaType,
indices: Vec<usize>,
},
Add(GaiaType),
Sub(GaiaType),
Mul(GaiaType),
Div(GaiaType),
Rem(GaiaType),
And(GaiaType),
Or(GaiaType),
Xor(GaiaType),
Shl(GaiaType),
Shr(GaiaType),
Neg(GaiaType),
Not(GaiaType),
Cmp(CmpCondition, GaiaType),
Cast {
from: GaiaType,
to: GaiaType,
kind: CastKind,
},
PushConstant(GaiaConstant),
Pop,
Dup,
LoadLocal(u32, GaiaType),
StoreLocal(u32, GaiaType),
LoadArg(u32, GaiaType),
StoreArg(u32, GaiaType),
Ret,
Br(String),
BrTrue(String),
BrFalse(String),
Label(String),
Call(String, usize),
CallIndirect(usize),
New(String),
NewArray(GaiaType, bool),
LoadField(String, String),
StoreField(String, String),
LoadElement(GaiaType),
StoreElement(GaiaType),
ArrayLength,
ArrayPush,
Throw,
StructNew(String),
StructGet {
struct_name: String,
field_index: u32,
is_signed: bool,
},
StructSet {
struct_name: String,
field_index: u32,
},
ArrayNew(String),
ArrayGet {
array_name: String,
is_signed: bool,
},
ArraySet(String),
}Expand description
Tier 0: Core low-level instructions (LLVM/Assembly-like)
Variants§
Alloca(GaiaType, usize)
Allocate space on the stack (type, count)
Load(GaiaType)
Load from memory (target register type, pointer)
Store(GaiaType)
Store to memory (value type)
Gep
Get element pointer (calculate offset)
Fields
Add(GaiaType)
Add two values of the specified type.
Sub(GaiaType)
Subtract two values of the specified type.
Mul(GaiaType)
Multiply two values of the specified type.
Div(GaiaType)
Divide two values of the specified type.
Rem(GaiaType)
Remainder of two values of the specified type.
And(GaiaType)
Bitwise AND of two values of the specified type.
Or(GaiaType)
Bitwise OR of two values of the specified type.
Xor(GaiaType)
Bitwise XOR of two values of the specified type.
Shl(GaiaType)
Left shift a value of the specified type.
Shr(GaiaType)
Right shift a value of the specified type.
Neg(GaiaType)
Negate a value of the specified type.
Not(GaiaType)
Bitwise NOT of a value of the specified type.
Cmp(CmpCondition, GaiaType)
Compare two values using the specified condition.
Cast
Cast a value from one type to another with the specified conversion kind.
Fields
PushConstant(GaiaConstant)
Push a constant value onto the stack.
Pop
Pop a value from the stack.
Dup
Duplicate the top value on the stack.
LoadLocal(u32, GaiaType)
Load local variable
StoreLocal(u32, GaiaType)
Store local variable
LoadArg(u32, GaiaType)
Load parameter
StoreArg(u32, GaiaType)
Store parameter
Ret
Return
Br(String)
Unconditional branch
BrTrue(String)
Branch if true
BrFalse(String)
Branch if false
Label(String)
Label
Call(String, usize)
Call function (function name, parameter count)
CallIndirect(usize)
Indirect call (parameter count). Stack: […, func_ptr, arg1, arg2, …]
New(String)
Create new object (type name)
NewArray(GaiaType, bool)
Create new array (element type, whether length is on stack)
LoadField(String, String)
Load field (object type, field name)
StoreField(String, String)
Store field (object type, field name)
LoadElement(GaiaType)
Load array element
StoreElement(GaiaType)
Store array element
ArrayLength
Get array length
ArrayPush
Push element to array (array, value)
Throw
Throw exception
StructNew(String)
Create new GC struct (type name)
StructGet
Get GC struct field (type name, field index)
Fields
StructSet
Set GC struct field (type name, field index)
Fields
ArrayNew(String)
Create new GC array (type name)
ArrayGet
Get GC array element (type name)
Fields
ArraySet(String)
Set GC array element (type name)
Trait Implementations§
Source§impl Clone for CoreInstruction
impl Clone for CoreInstruction
Source§fn clone(&self) -> CoreInstruction
fn clone(&self) -> CoreInstruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more