pub enum CoreInstruction {
Show 46 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,
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)
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
PushConstant(GaiaConstant)
Pop
Dup
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)
StructNew(String)
Create new GC struct (type name)
StructGet
Get GC struct field (type name, field index)
StructSet
Set GC struct field (type name, field index)
ArrayNew(String)
Create new GC array (type name)
ArrayGet
Get GC array element (type name)
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