1
0
mirror of https://github.com/golang/go synced 2024-11-22 05:34:39 -07:00

cmd/5g, cmd/6g, cmd/8g: update frame zeroing for new bitmap format

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12740046
This commit is contained in:
Carl Shapiro 2013-08-16 01:15:04 -04:00 committed by Russ Cox
parent 4c855f3830
commit d3b04f46b5
3 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@ static Prog* appendp(Prog*, int, int, int, int32, int, int, int32);
void void
defframe(Prog *ptxt, Bvec *bv) defframe(Prog *ptxt, Bvec *bv)
{ {
int i, first; int i, j, first;
uint32 frame; uint32 frame;
Prog *p, *p1; Prog *p, *p1;
@ -49,8 +49,8 @@ defframe(Prog *ptxt, Bvec *bv)
patch(p, p1); patch(p, p1);
} else { } else {
first = 1; first = 1;
for(i=0; i<stkptrsize; i+=widthptr) { for(i=0, j=0; i<stkptrsize; i+=widthptr, j+=2) {
if(bvget(bv, i/widthptr)) { if(bvget(bv, j) || bvget(bv, j+1)) {
if(first) { if(first) {
p = appendp(p, AMOVW, D_CONST, NREG, 0, D_REG, 0, 0); p = appendp(p, AMOVW, D_CONST, NREG, 0, D_REG, 0, 0);
first = 0; first = 0;

View File

@ -14,7 +14,7 @@ static Prog* appendp(Prog*, int, int, vlong, int, vlong);
void void
defframe(Prog *ptxt, Bvec *bv) defframe(Prog *ptxt, Bvec *bv)
{ {
int i; int i, j;
uint32 frame; uint32 frame;
Prog *p; Prog *p;
@ -37,8 +37,8 @@ defframe(Prog *ptxt, Bvec *bv)
p = appendp(p, AREP, D_NONE, 0, D_NONE, 0); p = appendp(p, AREP, D_NONE, 0, D_NONE, 0);
appendp(p, ASTOSQ, D_NONE, 0, D_NONE, 0); appendp(p, ASTOSQ, D_NONE, 0, D_NONE, 0);
} else { } else {
for(i=0; i<stkptrsize; i+=widthptr) for(i=0, j=0; i<stkptrsize; i+=widthptr, j+=2)
if(bvget(bv, i/widthptr)) if(bvget(bv, j) || bvget(bv, j+1))
p = appendp(p, AMOVQ, D_CONST, 0, D_SP+D_INDIR, frame-stkptrsize+i); p = appendp(p, AMOVQ, D_CONST, 0, D_SP+D_INDIR, frame-stkptrsize+i);
} }
} }

View File

@ -16,7 +16,7 @@ defframe(Prog *ptxt, Bvec *bv)
{ {
uint32 frame; uint32 frame;
Prog *p; Prog *p;
int i; int i, j;
// fill in argument size // fill in argument size
ptxt->to.offset2 = rnd(curfn->type->argwid, widthptr); ptxt->to.offset2 = rnd(curfn->type->argwid, widthptr);
@ -39,8 +39,8 @@ defframe(Prog *ptxt, Bvec *bv)
p = appendp(p, AREP, D_NONE, 0, D_NONE, 0); p = appendp(p, AREP, D_NONE, 0, D_NONE, 0);
appendp(p, ASTOSL, D_NONE, 0, D_NONE, 0); appendp(p, ASTOSL, D_NONE, 0, D_NONE, 0);
} else { } else {
for(i=0; i<stkptrsize; i+=widthptr) for(i=0, j=0; i<stkptrsize; i+=widthptr, j+=2)
if(bvget(bv, i/widthptr)) if(bvget(bv, j) || bvget(bv, j+1))
p = appendp(p, AMOVL, D_CONST, 0, D_SP+D_INDIR, frame-stkptrsize+i); p = appendp(p, AMOVL, D_CONST, 0, D_SP+D_INDIR, frame-stkptrsize+i);
} }
} }