We planned to upgrade GitLab and Mattermost to the latest version this Friday morning (early). You may experience some downtime!

Verified Commit 54ef28e9 authored by Camil Staps's avatar Camil Staps 🚀

Add ABC instructions get_desc_arity_offset, get_thunk_desc and...

Add ABC instructions get_desc_arity_offset, get_thunk_desc and load_module_name (recently added for GraphCopy)
parent 17cf33e9
Pipeline #20132 passed with stages
in 11 minutes and 31 seconds
......@@ -263,7 +263,9 @@ const char *instruction_type (BC_WORD i) {
case Cfill_r31: return "nnnl";
case Cfill_r40: return "nnl";
case Cfill_u: return "nnln";
case Cget_desc_arity_offset: return "";
case Cget_node_arity: return "n";
case Cget_thunk_desc: return "";
case CgtI: return "";
case Chalt: return "";
case CincI: return "";
......@@ -282,6 +284,7 @@ const char *instruction_type (BC_WORD i) {
case Cjsr_eval3: return "";
case ClnR: return "";
case Cload_i: return "i";
case Cload_module_name: return "";
case Cload_si16: return "i";
case Cload_si32: return "i";
case Cload_ui8: return "i";
......
......@@ -249,7 +249,9 @@ enum {
INSTRUCTION(fill_ra0)
INSTRUCTION(fill_ra1)
INSTRUCTION(fill_u)
INSTRUCTION(get_desc_arity_offset)
INSTRUCTION(get_node_arity)
INSTRUCTION(get_thunk_desc)
INSTRUCTION(gtI)
INSTRUCTION(halt)
INSTRUCTION(incI)
......@@ -268,6 +270,7 @@ enum {
INSTRUCTION(jsr_eval3)
INSTRUCTION(lnR)
INSTRUCTION(load_i)
INSTRUCTION(load_module_name)
INSTRUCTION(load_si16)
INSTRUCTION(load_si32)
INSTRUCTION(load_ui8)
......
......@@ -132,7 +132,9 @@ void load_instruction_table(void) {
put_instruction_name("fill_a", parse_instruction_n_n, code_fill_a );
put_instruction_name("fill_u", parse_instruction_a_n_n_a_n, code_fill_u );
put_instruction_name("fill_r", parse_instruction_a_n_n_n_n_n, code_fill_r );
put_instruction_name("get_desc_arity_offset", parse_instruction, code_get_desc_arity_offset );
put_instruction_name("get_node_arity", parse_instruction_n, code_get_node_arity );
put_instruction_name("get_thunk_desc", parse_instruction, code_get_thunk_desc );
put_instruction_name("getWL", parse_instruction_n, code_dummy );
put_instruction_name("gtI", parse_instruction, code_gtI );
put_instruction_name("halt", parse_instruction, code_halt );
......@@ -150,6 +152,7 @@ void load_instruction_table(void) {
put_instruction_name("jsr_ap", parse_instruction_n, code_jsr_ap );
put_instruction_name("lnR", parse_instruction, code_lnR );
put_instruction_name("load_i", parse_instruction_i, code_load_i );
put_instruction_name("load_module_name", parse_instruction, code_load_module_name );
put_instruction_name("load_si16", parse_instruction_i, code_load_si16 );
put_instruction_name("load_si32", parse_instruction_i, code_load_si32 );
put_instruction_name("load_ui8", parse_instruction_i, code_load_ui8 );
......
......@@ -2199,10 +2199,20 @@ void code_fill_r(char descriptor_name[],int a_size,int b_size,int root_offset,in
exit(1);
}
void code_get_desc_arity_offset(void) {
unsupported_instruction_warning(Cget_desc_arity_offset);
add_instruction(Cget_desc_arity_offset);
}
void code_get_node_arity(int a_offset) {
add_instruction_w(Cget_node_arity,-a_offset);
}
void code_get_thunk_desc(void) {
unsupported_instruction_warning(Cget_thunk_desc);
add_instruction(Cget_thunk_desc);
}
void code_gtI(void) {
add_instruction(CgtI);
}
......@@ -2387,6 +2397,11 @@ void code_load_i(CleanInt value) {
add_instruction_i(Cload_i,value);
}
void code_load_module_name(void) {
unsupported_instruction_warning(Cload_module_name);
add_instruction(Cload_module_name);
}
void code_load_si16(CleanInt value) {
unsupported_instruction_warning(Cload_si16);
add_instruction_i(Cload_si16,value);
......
......@@ -112,7 +112,9 @@ void code_fillcaf(char *label_name, int a_stack_size, int b_stack_size);
void code_fill_a(int from_offset, int to_offset);
void code_fill_u(char descriptor_name[], int a_size, int b_size, char code_name[], int a_offset);
void code_fill_r(char descriptor_name[], int a_size, int b_size, int root_offset, int a_offset, int b_offset);
void code_get_desc_arity_offset(void);
void code_get_node_arity(int a_offset);
void code_get_thunk_desc(void);
void code_gtI(void);
void code_halt(void);
void code_incI(void);
......@@ -129,6 +131,7 @@ void code_jsr_ap(int n_apply_args);
void code_jsr_eval(int a_offset);
void code_lnR(void);
void code_load_i(CleanInt value);
void code_load_module_name(void);
void code_load_si16(CleanInt value);
void code_load_si32(CleanInt value);
void code_load_ui8(CleanInt value);
......
......@@ -27,4 +27,4 @@ typedef int64_t CleanInt;
#define BCGEN_INSTRUCTION_TABLE_SIZE 512
#define ABC_MAGIC_NUMBER 0x2a434241
#define ABC_VERSION 3
#define ABC_VERSION 4
......@@ -3574,8 +3574,11 @@ all_instructions t = pre ++ (flatten $ map (\i -> get_output (i t)) $
alias "fill3_r01a" $
alias "fill3_r01b" $
alias "fill_u" $
alias "get_desc_arity_offset" $
alias "get_thunk_desc" $
alias "instruction" $
alias "load_i" $
alias "load_module_name" $
alias "load_si16" $
alias "load_si32" $
alias "load_ui8" $
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment