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

Verified Commit ddeddcf7 authored by Camil Staps's avatar Camil Staps 🚀

Specialise fill2_r depending on whether the argument in the head block is filled

parent 2bb43de6
Pipeline #16729 failed with stages
in 14 minutes and 19 seconds
......@@ -219,8 +219,10 @@ const char *instruction_type (BC_WORD i) {
case Cfill2b002: return "nn";
case Cfill2b011: return "nn";
case Cfill2b012: return "nn";
case Cfill2_r0: return "nnnn";
case Cfill2_r1: return "nlnn";
case Cfill2_r00: return "nnnn";
case Cfill2_r01: return "nnnn";
case Cfill2_r10: return "nlnn";
case Cfill2_r11: return "nlnn";
case Cfill3_r: return "nlnnn";
case Cfill3_r01a: return "nln";
case Cfill3_r01b: return "nln";
......
......@@ -199,8 +199,10 @@ enum {
INSTRUCTION(fill2b002)
INSTRUCTION(fill2b011)
INSTRUCTION(fill2b012)
INSTRUCTION(fill2_r0)
INSTRUCTION(fill2_r1)
INSTRUCTION(fill2_r00)
INSTRUCTION(fill2_r01)
INSTRUCTION(fill2_r10)
INSTRUCTION(fill2_r11)
INSTRUCTION(fill3)
INSTRUCTION(fill3a10)
INSTRUCTION(fill3a11)
......
......@@ -1879,13 +1879,20 @@ void code_fill2_r(char descriptor_name[],int a_size,int b_size,int root_offset,c
}
uint32_t bitvec=0;
for (i=ab_size; i>0; i--)
for (i=ab_size; i>1; i--)
bitvec=(bitvec<<1)|(bits[i]=='1' ? 1 : 0);
if (bits[0]=='0')
add_instruction_w_w_w(Cfill2_r0,-root_offset,a_size,bitvec);
else
add_instruction_w_label_offset_w_w(Cfill2_r1,-root_offset,descriptor_name,2,a_size,bitvec);
if (bits[0]=='0') {
if (bits[1]=='0')
add_instruction_w_w_w(Cfill2_r00,-root_offset,a_size-1,bitvec);
else
add_instruction_w_w_w(Cfill2_r01,-root_offset,a_size,bitvec);
} else {
if (bits[1]=='0')
add_instruction_w_label_offset_w_w(Cfill2_r10,-root_offset,descriptor_name,2,a_size-1,bitvec);
else
add_instruction_w_label_offset_w_w(Cfill2_r11,-root_offset,descriptor_name,2,a_size,bitvec);
}
}
void code_fill3(char descriptor_name[],int arity,int a_offset,char bits[]) {
......
......@@ -2801,22 +2801,38 @@ INSTRUCTION_BLOCK(fill2ab013):
pc+=5;
END_INSTRUCTION_BLOCK;
}
INSTRUCTION_BLOCK(fill2_r0):
INSTRUCTION_BLOCK(fill2_r00):
{
BC_WORD *n,*args,bits;
int a_size;
BC_WORD *n,*args;
n=(BC_WORD*)asp[((BC_WORD_S*)pc)[1]];
args=(BC_WORD*)n[2];
a_size=pc[2];
bits=pc[3];
if (bits&1) {
if (a_size==0)
n[1]=*bsp++;
else
n[1]=*asp--;
int a_size_minus_one=pc[2];
BC_WORD bits=pc[3];
int i=0;
for (; bits>0; bits>>=1) {
if (bits&1) {
if (i>=a_size_minus_one)
args[i]=*bsp++;
else
args[i]=*asp--;
}
i++;
}
pc+=4;
END_INSTRUCTION_BLOCK;
}
INSTRUCTION_BLOCK(fill2_r01):
{
BC_WORD *n,*args;
n=(BC_WORD*)asp[((BC_WORD_S*)pc)[1]];
args=(BC_WORD*)n[2];
int a_size=pc[2];
BC_WORD bits=pc[3];
if (a_size==0)
n[1]=*bsp++;
else
n[1]=*asp--;
a_size--;
bits>>=1;
int i=0;
for (; bits>0; bits>>=1) {
if (bits&1) {
......@@ -2830,23 +2846,40 @@ INSTRUCTION_BLOCK(fill2_r0):
pc+=4;
END_INSTRUCTION_BLOCK;
}
INSTRUCTION_BLOCK(fill2_r1):
INSTRUCTION_BLOCK(fill2_r10):
{
BC_WORD *n,*args,bits;
int a_size;
BC_WORD *n,*args;
n=(BC_WORD*)asp[((BC_WORD_S*)pc)[1]];
n[0]=pc[2];
args=(BC_WORD*)n[2];
a_size=pc[3];
bits=pc[4];
if (bits&1) {
if (a_size==0)
n[1]=*bsp++;
else
n[1]=*asp--;
int a_size_minus_one=pc[3];
BC_WORD bits=pc[4];
int i=0;
for (; bits>0; bits>>=1) {
if (bits&1) {
if (i>=a_size_minus_one)
args[i]=*bsp++;
else
args[i]=*asp--;
}
i++;
}
pc+=5;
END_INSTRUCTION_BLOCK;
}
INSTRUCTION_BLOCK(fill2_r11):
{
BC_WORD *n,*args;
n=(BC_WORD*)asp[((BC_WORD_S*)pc)[1]];
n[0]=pc[2];
args=(BC_WORD*)n[2];
int a_size=pc[3];
BC_WORD bits=pc[4];
if (a_size==0)
n[1]=*bsp++;
else
n[1]=*asp--;
a_size--;
bits>>=1;
int i=0;
for (; bits>0; bits>>=1) {
if (bits&1) {
......
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