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

Verified Commit 220a3e99 authored by Camil Staps's avatar Camil Staps 🚀

Fix rare instructions optimised for stack element width (arguments of type N instead of n)

parent 4b7feb1f
Pipeline #16884 passed with stages
in 20 minutes and 12 seconds
......@@ -395,15 +395,15 @@ const char *instruction_type (BC_WORD i) {
case Cpush_r_args_a2l: return "n";
case Cpush_r_args_a3: return "n";
case Cpush_r_args_a4: return "n";
case Cpush_r_args_b: return "nnn";
case Cpush_r_args_b: return "nNn";
case Cpush_r_args_b0b11: return "n";
case Cpush_r_args_b0221: return "n";
case Cpush_r_args_b1111: return "n";
case Cpush_r_args_b1: return "nn";
case Cpush_r_args_b1: return "nN";
case Cpush_r_args_b2l1: return "n";
case Cpush_r_args_b31: return "n";
case Cpush_r_args_b41: return "n";
case Cpush_r_args_b2: return "nn";
case Cpush_r_args_b2: return "nN";
case Cpush_r_args_b1l2: return "n";
case Cpush_r_args_b22: return "n";
case Cpush_t_r_a: return "n";
......@@ -454,7 +454,7 @@ const char *instruction_type (BC_WORD i) {
case Crepl_r_args_a21: return "";
case Crepl_r_args_a31: return "";
case Crepl_r_args_a41: return "";
case Crepl_r_args_aa1: return "n";
case Crepl_r_args_aa1: return "N";
case Cselect: return "";
case CselectBOOL: return "";
case CselectCHAR: return "";
......
......@@ -2828,7 +2828,7 @@ void code_push_r_args_a(int a_offset,int a_size,int b_size,int argument_number,i
add_instruction_w(Cpush_r_args_a4,-a_offset);
return;
}
add_instruction_w_w(Cpush_r_args_aa1,-a_offset,(argument_number-2)<<2);
add_instruction_w_w(Cpush_r_args_aa1,-a_offset,argument_number-2);
return;
}
......@@ -2870,7 +2870,7 @@ void code_push_r_args_b(int a_offset,int a_size,int b_size,int argument_number,i
return;
}
if (a_size+argument_number>=5) {
add_instruction_w_w(Cpush_r_args_b1,-a_offset,(a_size+argument_number-1-1)<<2);
add_instruction_w_w(Cpush_r_args_b1,-a_offset,a_size+argument_number-1-1);
return;
}
}
......@@ -2887,13 +2887,13 @@ void code_push_r_args_b(int a_offset,int a_size,int b_size,int argument_number,i
return;
}
if (a_size+argument_number>=5) {
add_instruction_w_w(Cpush_r_args_b2,-a_offset,(a_size+argument_number-1-1)<<2);
add_instruction_w_w(Cpush_r_args_b2,-a_offset,a_size+argument_number-1-1);
return;
}
}
}
add_instruction_w_w_w(Cpush_r_args_b,-a_offset,(a_size+argument_number-1-1)<<2,n_arguments);
add_instruction_w_w_w(Cpush_r_args_b,-a_offset,a_size+argument_number-1-1,n_arguments);
}
void code_push_r_args_u(int a_offset,int a_size,int b_size) {
......@@ -2971,7 +2971,7 @@ void code_repl_arg(int arity,int argument_n) {
add_instruction(Crepl_r_args_a41);
return;
}
add_instruction_w(Crepl_r_args_aa1,(argument_n-2)<<2);
add_instruction_w(Crepl_r_args_aa1,argument_n-2);
return;
}
......@@ -3075,7 +3075,7 @@ void code_repl_r_args_a(int a_size,int b_size,int argument_number,int n_argument
add_instruction(Crepl_r_args_a41);
return;
}
add_instruction_w(Crepl_r_args_aa1,(argument_number-2)<<2);
add_instruction_w(Crepl_r_args_aa1,argument_number-2);
return;
}
......
......@@ -5180,7 +5180,7 @@ INSTRUCTION_BLOCK(push_r_args_b):
n=(BC_WORD*)asp[((BC_WORD_S*)pc)[1]];
a=(BC_WORD*)n[2];
BC_WORD *ao=&a[bo-3];
BC_WORD *ao=(BC_WORD*)((BC_WORD)a+bo);
bsp-=n_args;
bsp[0]=ao[0];
do {
......
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