diff options
| author | Ken Thompson <ken@golang.org> | 2009-11-05 12:47:22 -0800 |
|---|---|---|
| committer | Ken Thompson <ken@golang.org> | 2009-11-05 12:47:22 -0800 |
| commit | 505fd760a20d27753def021bd5c2eecbf670e87d (patch) | |
| tree | 28f0c07526f5664be944119612517e1943c1dae8 /src/cmd/8l/span.c | |
| parent | 51c1bd229b74d93bde9a388ad757dc9035ca3b92 (diff) | |
| download | go-505fd760a20d27753def021bd5c2eecbf670e87d.tar.xz | |
same speedup as 6l
R=rsc
http://go/go-review/1016050
Diffstat (limited to 'src/cmd/8l/span.c')
| -rw-r--r-- | src/cmd/8l/span.c | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/src/cmd/8l/span.c b/src/cmd/8l/span.c index 0204caa1e8..370ae67d33 100644 --- a/src/cmd/8l/span.c +++ b/src/cmd/8l/span.c @@ -882,21 +882,33 @@ subreg(Prog *p, int from, int to) if(debug['Q']) print("\n%P s/%R/%R/\n", p, from, to); - if(p->from.type == from) + if(p->from.type == from) { p->from.type = to; - if(p->to.type == from) + p->ft = 0; + } + if(p->to.type == from) { p->to.type = to; + p->tt = 0; + } - if(p->from.index == from) + if(p->from.index == from) { p->from.index = to; - if(p->to.index == from) + p->ft = 0; + } + if(p->to.index == from) { p->to.index = to; + p->tt = 0; + } from += D_INDIR; - if(p->from.type == from) + if(p->from.type == from) { p->from.type = to+D_INDIR; - if(p->to.type == from) + p->ft = 0; + } + if(p->to.type == from) { p->to.type = to+D_INDIR; + p->tt = 0; + } if(debug['Q']) print("%P\n", p); @@ -934,9 +946,30 @@ doasm(Prog *p) if(pre) *andptr++ = pre; + +if(p->ft != 0) { + ft = oclass(&p->from); + if(ft != p->ft) { + print("***** %d %d %D\n", p->ft, ft, &p->from); + p->ft = ft; + } +} +if(p->tt != 0) { + tt = oclass(&p->to); + if(tt != p->tt) { + print("***** %d %d %D\n", p->tt, tt, &p->to); + p->tt = tt; + } +} + +// if(p->ft == 0) + p->ft = oclass(&p->from); +// if(p->tt == 0) + p->tt = oclass(&p->to); + + ft = p->ft * Ymax; + tt = p->tt * Ymax; o = &optab[p->as]; - ft = oclass(&p->from) * Ymax; - tt = oclass(&p->to) * Ymax; t = o->ytab; if(t == 0) { diag("asmins: noproto %P", p); @@ -998,9 +1031,11 @@ found: diag("asmins: Zaut sb type ADDR"); p->from.type = p->from.index; p->from.index = D_NONE; + p->ft = 0; asmand(&p->from, reg[p->to.type]); p->from.index = p->from.type; p->from.type = D_ADDR; + p->ft = 0; break; case Zm_o: |
