stage1 修复设计问题 实现ir2vm
This commit is contained in:
@@ -37,9 +37,11 @@
|
||||
X(case.int2float, V0, SPL_IR_CASE_INT2FLOAT) \
|
||||
X(case.float2int, V0, SPL_IR_CASE_FLOAT2INT) \
|
||||
X(mem.alloca, V0, SPL_IR_MEM_ALLOCA) \
|
||||
X(mem.global_alloc, V0, SPL_IR_MEM_GLOBAL_ALLOC) \
|
||||
X(mem.load, V0, SPL_IR_MEM_LOAD) \
|
||||
X(mem.store, V0, SPL_IR_MEM_STORE) \
|
||||
X(mem.offset, V0, SPL_IR_MEM_OFFSET) \
|
||||
X(mem.field, V0, SPL_IR_MEM_FIELD_PTR) \
|
||||
X(mem.copy, V0, SPL_IR_MEM_COPY) \
|
||||
X(mem.set, V0, SPL_IR_MEM_SET) \
|
||||
X(mem.fence, V0, SPL_IR_MEM_FENCE) \
|
||||
@@ -109,6 +111,10 @@ typedef struct {
|
||||
spl_type_id_t tid;
|
||||
spl_ir_node_ref_t count;
|
||||
} mem_alloc;
|
||||
struct {
|
||||
spl_type_id_t tid;
|
||||
spl_ir_node_ref_t const_node;
|
||||
} mem_global_alloc;
|
||||
struct {
|
||||
spl_type_id_t tid;
|
||||
spl_ir_node_ref_t ptr;
|
||||
@@ -123,6 +129,11 @@ typedef struct {
|
||||
spl_ir_node_ref_t ptr;
|
||||
spl_ir_node_ref_t offset;
|
||||
} mem_offset;
|
||||
struct {
|
||||
spl_type_id_t tid;
|
||||
spl_ir_node_ref_t agg;
|
||||
usize field_idx;
|
||||
} mem_field_ptr;
|
||||
struct {
|
||||
spl_type_id_t tid;
|
||||
spl_ir_node_ref_t dst;
|
||||
@@ -171,12 +182,13 @@ typedef struct {
|
||||
} agg_construct;
|
||||
struct {
|
||||
spl_type_id_t tid;
|
||||
isize field_idx;
|
||||
spl_type_id_t field_tid;
|
||||
usize field_idx;
|
||||
spl_ir_node_ref_t val;
|
||||
} agg_extract;
|
||||
struct {
|
||||
spl_type_id_t tid;
|
||||
isize field_idx;
|
||||
usize field_idx;
|
||||
spl_ir_node_ref_t agg;
|
||||
spl_ir_node_ref_t field;
|
||||
} agg_insert;
|
||||
@@ -233,8 +245,10 @@ typedef struct {
|
||||
} spl_ir_func_t;
|
||||
|
||||
typedef VEC(spl_ir_func_t) spl_ir_func_vec_t;
|
||||
|
||||
typedef struct {
|
||||
spl_ir_func_vec_t funcs;
|
||||
spl_ir_node_vec_t gdata;
|
||||
} spl_ir_t;
|
||||
|
||||
void spl_ir_init(spl_ir_t *ir);
|
||||
|
||||
Reference in New Issue
Block a user