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

Verified Commit 2bb43de6 authored by Camil Staps's avatar Camil Staps 🚀

Fix fill2_r series

parent 53458933
Pipeline #16728 canceled with stages
in 2 minutes and 28 seconds
......@@ -220,7 +220,7 @@ const char *instruction_type (BC_WORD i) {
case Cfill2b011: return "nn";
case Cfill2b012: return "nn";
case Cfill2_r0: return "nnnn";
case Cfill2_r1: return "nlnnn";
case Cfill2_r1: return "nlnn";
case Cfill3_r: return "nlnnn";
case Cfill3_r01a: return "nln";
case Cfill3_r01b: return "nln";
......
......@@ -1879,13 +1879,13 @@ void code_fill2_r(char descriptor_name[],int a_size,int b_size,int root_offset,c
}
uint32_t bitvec=0;
for (i=1; i<=ab_size; i++)
for (i=ab_size; i>0; i--)
bitvec=(bitvec<<1)|(bits[i]=='1' ? 1 : 0);
if (bits[0]=='0')
add_instruction_w_w_w_w(Cfill2_r0,-root_offset,a_size,b_size,bitvec);
add_instruction_w_w_w(Cfill2_r0,-root_offset,a_size,bitvec);
else
add_instruction_w_label_offset_w_w_w(Cfill2_r1,-root_offset,descriptor_name,2,a_size,b_size,bitvec);
add_instruction_w_label_offset_w_w(Cfill2_r1,-root_offset,descriptor_name,2,a_size,bitvec);
}
void code_fill3(char descriptor_name[],int arity,int a_offset,char bits[]) {
......
......@@ -2803,62 +2803,61 @@ INSTRUCTION_BLOCK(fill2ab013):
}
INSTRUCTION_BLOCK(fill2_r0):
{
BC_WORD *n,*args_min_1,bits;
int a_size,b_size;
BC_WORD *n,*args,bits;
int a_size;
n=(BC_WORD*)asp[((BC_WORD_S*)pc)[1]];
args_min_1=(BC_WORD*)n[2]-1;
args=(BC_WORD*)n[2];
a_size=pc[2];
b_size=pc[3];
bits=pc[4];
int i=a_size+b_size-1;
bits=pc[3];
if (bits&1) {
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) {
if (i>0) {
if (i>=a_size)
args_min_1[i]=*bsp++;
else
args_min_1[i]=*asp--;
} else {
if (a_size==0)
n[1]=*bsp++;
else
n[1]=*asp--;
}
if (i>=a_size)
args[i]=*bsp++;
else
args[i]=*asp--;
}
i--;
i++;
}
pc+=5;
pc+=4;
END_INSTRUCTION_BLOCK;
}
INSTRUCTION_BLOCK(fill2_r1):
{
BC_WORD *n,*args_min_1,bits;
int a_size,b_size;
BC_WORD *n,*args,bits;
int a_size;
n=(BC_WORD*)asp[((BC_WORD_S*)pc)[1]];
n[0]=pc[2];
args_min_1=(BC_WORD*)n[2]-1;
args=(BC_WORD*)n[2];
a_size=pc[3];
b_size=pc[4];
bits=pc[5];
int i=a_size+b_size-1;
EPRINTF("\t%d %d %lx\n",a_size,b_size,bits);
bits=pc[4];
if (bits&1) {
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) {
if (i>0) {
if (i>=a_size)
args_min_1[i]=*bsp++;
else
args_min_1[i]=*asp--;
} else {
if (a_size==0)
n[1]=*bsp++;
else
n[1]=*asp--;
}
if (i>=a_size)
args[i]=*bsp++;
else
args[i]=*asp--;
}
i--;
i++;
}
pc+=6;
pc+=5;
END_INSTRUCTION_BLOCK;
}
INSTRUCTION_BLOCK(fill3a10):
......
[(True,(UT11 1)),(False,(UT10 1)),(True,(UT10 1)),(True,(UT11 1)),(True,(UT211 2 1)),(False,(UT201 1 1)),(False,(UT201 2 1)),(True,(UT211 2 2))]
[(True,(UT11 1)),(False,(UT10 1)),(True,(UT10 1)),(True,(UT11 1)),(True,(UT211 2 1)),(False,(UT201 1 1)),(False,(UT201 2 1)),(True,(UT211 2 2)),(True,(UT3011 1 2 2)),(True,(UT3001 1 3 2)),(True,(UT3111 3 2 3)),(True,(UT3011 3 2 1)),(True,(UT3001 1 3 2)),(True,(UT3111 3 1 2))]
halt at 4
112 524176 524288
222 524066 524288
[(True,(UT11 1)),(False,(UT10 1)),(True,(UT10 1)),(True,(UT11 1)),(True,(UT211 2 1)),(False,(UT201 1 1)),(False,(UT201 2 1)),(True,(UT211 2 2))]
[(True,(UT11 1)),(False,(UT10 1)),(True,(UT10 1)),(True,(UT11 1)),(True,(UT211 2 1)),(False,(UT201 1 1)),(False,(UT201 2 1)),(True,(UT211 2 2)),(True,(UT3011 1 2 2)),(True,(UT3001 1 3 2)),(True,(UT3111 3 2 3)),(True,(UT3011 3 2 1)),(True,(UT3001 1 3 2)),(True,(UT3111 3 1 2))]
halt at 4
112 262032 262144
222 261922 262144
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