Commit f47346c5 authored by Jan Ziak's avatar Jan Ziak Committed by Russ Cox

8l,5l: 2% faster

R=golang-dev, for.go.yong
CC=golang-dev
https://golang.org/cl/6197080
parent fcc1f2ac
...@@ -296,16 +296,16 @@ zaddr(Biobuf *f, Adr *a, Sym *h[]) ...@@ -296,16 +296,16 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
Sym *s; Sym *s;
Auto *u; Auto *u;
a->type = Bgetc(f); a->type = BGETC(f);
a->reg = Bgetc(f); a->reg = BGETC(f);
c = Bgetc(f); c = BGETC(f);
if(c < 0 || c > NSYM){ if(c < 0 || c > NSYM){
print("sym out of range: %d\n", c); print("sym out of range: %d\n", c);
Bputc(f, ALAST+1); Bputc(f, ALAST+1);
return; return;
} }
a->sym = h[c]; a->sym = h[c];
a->name = Bgetc(f); a->name = BGETC(f);
if((schar)a->reg < 0 || a->reg > NREG) { if((schar)a->reg < 0 || a->reg > NREG) {
print("register out of range %d\n", a->reg); print("register out of range %d\n", a->reg);
...@@ -338,7 +338,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[]) ...@@ -338,7 +338,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
break; break;
case D_REGREG: case D_REGREG:
a->offset = Bgetc(f); a->offset = BGETC(f);
break; break;
case D_CONST2: case D_CONST2:
...@@ -422,7 +422,7 @@ newloop: ...@@ -422,7 +422,7 @@ newloop:
loop: loop:
if(f->state == Bracteof || Boffset(f) >= eof) if(f->state == Bracteof || Boffset(f) >= eof)
goto eof; goto eof;
o = Bgetc(f); o = BGETC(f);
if(o == Beof) if(o == Beof)
goto eof; goto eof;
...@@ -435,8 +435,8 @@ loop: ...@@ -435,8 +435,8 @@ loop:
sig = 0; sig = 0;
if(o == ASIGNAME) if(o == ASIGNAME)
sig = Bget4(f); sig = Bget4(f);
v = Bgetc(f); /* type */ v = BGETC(f); /* type */
o = Bgetc(f); /* sym */ o = BGETC(f); /* sym */
r = 0; r = 0;
if(v == D_STATIC) if(v == D_STATIC)
r = version; r = version;
...@@ -486,8 +486,8 @@ loop: ...@@ -486,8 +486,8 @@ loop:
p = mal(sizeof(Prog)); p = mal(sizeof(Prog));
p->as = o; p->as = o;
p->scond = Bgetc(f); p->scond = BGETC(f);
p->reg = Bgetc(f); p->reg = BGETC(f);
p->line = Bget4(f); p->line = Bget4(f);
zaddr(f, &p->from, h); zaddr(f, &p->from, h);
......
...@@ -333,7 +333,7 @@ zsym(char *pn, Biobuf *f, Sym *h[]) ...@@ -333,7 +333,7 @@ zsym(char *pn, Biobuf *f, Sym *h[])
{ {
int o; int o;
o = Bgetc(f); o = BGETC(f);
if(o < 0 || o >= NSYM || h[o] == nil) if(o < 0 || o >= NSYM || h[o] == nil)
mangle(pn); mangle(pn);
return h[o]; return h[o];
...@@ -347,12 +347,12 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[]) ...@@ -347,12 +347,12 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
Sym *s; Sym *s;
Auto *u; Auto *u;
t = Bgetc(f); t = BGETC(f);
a->index = D_NONE; a->index = D_NONE;
a->scale = 0; a->scale = 0;
if(t & T_INDEX) { if(t & T_INDEX) {
a->index = Bgetc(f); a->index = BGETC(f);
a->scale = Bgetc(f); a->scale = BGETC(f);
} }
a->type = D_NONE; a->type = D_NONE;
a->offset = 0; a->offset = 0;
...@@ -376,7 +376,7 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[]) ...@@ -376,7 +376,7 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
a->type = D_SCONST; a->type = D_SCONST;
} }
if(t & T_TYPE) if(t & T_TYPE)
a->type = Bgetc(f); a->type = BGETC(f);
adrgotype = S; adrgotype = S;
if(t & T_GOTYPE) if(t & T_GOTYPE)
adrgotype = zsym(pn, f, h); adrgotype = zsym(pn, f, h);
...@@ -452,10 +452,10 @@ newloop: ...@@ -452,10 +452,10 @@ newloop:
loop: loop:
if(f->state == Bracteof || Boffset(f) >= eof) if(f->state == Bracteof || Boffset(f) >= eof)
goto eof; goto eof;
o = Bgetc(f); o = BGETC(f);
if(o == Beof) if(o == Beof)
goto eof; goto eof;
o |= Bgetc(f) << 8; o |= BGETC(f) << 8;
if(o <= AXXX || o >= ALAST) { if(o <= AXXX || o >= ALAST) {
if(o < 0) if(o < 0)
goto eof; goto eof;
...@@ -468,8 +468,8 @@ loop: ...@@ -468,8 +468,8 @@ loop:
sig = 0; sig = 0;
if(o == ASIGNAME) if(o == ASIGNAME)
sig = Bget4(f); sig = Bget4(f);
v = Bgetc(f); /* type */ v = BGETC(f); /* type */
o = Bgetc(f); /* sym */ o = BGETC(f); /* sym */
r = 0; r = 0;
if(v == D_STATIC) if(v == D_STATIC)
r = version; r = version;
......
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