Skip to content

Commit b086733

Browse files
committed
do not use duffzero in zerorange either
1 parent ef83d4e commit b086733

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/cmd/7g/ggen.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,35 +64,35 @@ static Prog*
6464
zerorange(Prog *p, vlong frame, vlong lo, vlong hi)
6565
{
6666
vlong cnt, i;
67-
Prog *p1;
68-
Node *f;
67+
/* Prog *p1; */
68+
/* Node *f; */
6969

7070
cnt = hi - lo;
7171
if(cnt == 0)
7272
return p;
73-
if(cnt < 4*widthptr) {
73+
/* if(cnt < 4*widthptr) { */
7474
for(i = 0; i < cnt; i += widthptr)
7575
p = appendpp(p, AMOV, D_REG, REGZERO, 0, D_OREG, REGSP, 8+frame+lo+i);
76-
} else if(cnt <= 128*widthptr) {
77-
p = appendpp(p, AADD, D_CONST, NREG, 8+frame+lo-8, D_REG, REGRT1, 0);
78-
p->reg = REGSP;
79-
p = appendpp(p, ADUFFZERO, D_NONE, NREG, 0, D_OREG, NREG, 0);
80-
f = sysfunc("duffzero");
81-
naddr(f, &p->to, 1);
82-
afunclit(&p->to, f);
83-
p->to.offset = 4*(128-cnt/widthptr);
84-
} else {
85-
p = appendpp(p, AMOV, D_CONST, NREG, 8+frame+lo-8, D_REG, REGTMP, 0);
86-
p = appendpp(p, AADD, D_REG, REGTMP, 0, D_REG, REGRT1, 0);
87-
p->reg = REGSP;
88-
p = appendpp(p, AMOV, D_CONST, NREG, cnt, D_REG, REGTMP, 0);
89-
p = appendpp(p, AADD, D_REG, REGTMP, 0, D_REG, REGRT2, 0);
90-
p->reg = REGRT1;
91-
p1 = p = appendpp(p, AMOV, D_REG, REGZERO, 0, D_OREG, REGRT1, widthptr);
92-
p = appendpp(p, ACMP, D_REG, REGRT1, 0, D_REG, REGRT2, 0);
93-
p = appendpp(p, ABNE, D_NONE, NREG, 0, D_BRANCH, NREG, 0);
94-
patch(p, p1);
95-
}
76+
/* } else if(cnt <= 128*widthptr) { */
77+
/* p = appendpp(p, AADD, D_CONST, NREG, 8+frame+lo-8, D_REG, REGRT1, 0); */
78+
/* p->reg = REGSP; */
79+
/* p = appendpp(p, ADUFFZERO, D_NONE, NREG, 0, D_OREG, NREG, 0); */
80+
/* f = sysfunc("duffzero"); */
81+
/* naddr(f, &p->to, 1); */
82+
/* afunclit(&p->to, f); */
83+
/* p->to.offset = 4*(128-cnt/widthptr); */
84+
/* } else { */
85+
/* p = appendpp(p, AMOV, D_CONST, NREG, 8+frame+lo-8, D_REG, REGTMP, 0); */
86+
/* p = appendpp(p, AADD, D_REG, REGTMP, 0, D_REG, REGRT1, 0); */
87+
/* p->reg = REGSP; */
88+
/* p = appendpp(p, AMOV, D_CONST, NREG, cnt, D_REG, REGTMP, 0); */
89+
/* p = appendpp(p, AADD, D_REG, REGTMP, 0, D_REG, REGRT2, 0); */
90+
/* p->reg = REGRT1; */
91+
/* p1 = p = appendpp(p, AMOV, D_REG, REGZERO, 0, D_OREG, REGRT1, widthptr); */
92+
/* p = appendpp(p, ACMP, D_REG, REGRT1, 0, D_REG, REGRT2, 0); */
93+
/* p = appendpp(p, ABNE, D_NONE, NREG, 0, D_BRANCH, NREG, 0); */
94+
/* patch(p, p1); */
95+
/* } */
9696
return p;
9797
}
9898

0 commit comments

Comments
 (0)