aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/5l/obj.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2013-08-30 15:46:12 +0400
committerDmitriy Vyukov <dvyukov@google.com>2013-08-30 15:46:12 +0400
commit79dca0327ed8a7f65f3680e72cb1dcf4caaed457 (patch)
tree450091598b2acded10db1c416e9190de5949ebec /src/cmd/5l/obj.c
parent2df3d800378fda123395609189fabdd403634d80 (diff)
downloadgo-79dca0327ed8a7f65f3680e72cb1dcf4caaed457.tar.xz
libbio, all cmd: consistently use BGETC/BPUTC instead of Bgetc/Bputc
Also introduce BGET2/4, BPUT2/4 as they are widely used. Slightly improve BGETC/BPUTC implementation. This gives ~5% CPU time improvement on go install -a -p1 std. Before: real user sys 0m23.561s 0m16.625s 0m5.848s 0m23.766s 0m16.624s 0m5.846s 0m23.742s 0m16.621s 0m5.868s after: 0m22.999s 0m15.841s 0m5.889s 0m22.845s 0m15.808s 0m5.850s 0m22.889s 0m15.832s 0m5.848s R=golang-dev, r CC=golang-dev https://golang.org/cl/12745047
Diffstat (limited to 'src/cmd/5l/obj.c')
-rw-r--r--src/cmd/5l/obj.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cmd/5l/obj.c b/src/cmd/5l/obj.c
index 824a05fd8d..0b687a2ee8 100644
--- a/src/cmd/5l/obj.c
+++ b/src/cmd/5l/obj.c
@@ -334,7 +334,7 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
c = BGETC(f);
if(c < 0 || c > NSYM){
print("sym out of range: %d\n", c);
- Bputc(f, ALAST+1);
+ BPUTC(f, ALAST+1);
return;
}
a->sym = h[c];
@@ -343,7 +343,7 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
if((schar)a->reg < 0 || a->reg > NREG) {
print("register out of range %d\n", a->reg);
- Bputc(f, ALAST+1);
+ BPUTC(f, ALAST+1);
return; /* force real diagnostic */
}
@@ -361,7 +361,7 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
switch(a->type) {
default:
print("unknown type %d\n", a->type);
- Bputc(f, ALAST+1);
+ BPUTC(f, ALAST+1);
return; /* force real diagnostic */
case D_NONE:
@@ -377,13 +377,13 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
break;
case D_CONST2:
- a->offset2 = Bget4(f); // fall through
+ a->offset2 = BGETLE4(f); // fall through
case D_BRANCH:
case D_OREG:
case D_CONST:
case D_OCONST:
case D_SHIFT:
- a->offset = Bget4(f);
+ a->offset = BGETLE4(f);
break;
case D_SCONST:
@@ -392,8 +392,8 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
break;
case D_FCONST:
- a->ieee.l = Bget4(f);
- a->ieee.h = Bget4(f);
+ a->ieee.l = BGETLE4(f);
+ a->ieee.h = BGETLE4(f);
break;
}
s = a->sym;
@@ -476,7 +476,7 @@ loop:
if(o == ANAME || o == ASIGNAME) {
sig = 0;
if(o == ASIGNAME)
- sig = Bget4(f);
+ sig = BGETLE4(f);
v = BGETC(f); /* type */
o = BGETC(f); /* sym */
r = 0;
@@ -531,7 +531,7 @@ loop:
p->as = o;
p->scond = BGETC(f);
p->reg = BGETC(f);
- p->line = Bget4(f);
+ p->line = BGETLE4(f);
zaddr(pn, f, &p->from, h);
fromgotype = adrgotype;