summaryrefslogtreecommitdiff
path: root/utils/8c/reg.c
diff options
context:
space:
mode:
authorforsyth <forsyth@lavoro.terzarima.net>2013-06-03 21:01:14 +0000
committerforsyth <forsyth@lavoro.terzarima.net>2013-06-03 21:01:14 +0000
commit45a20ab721a513710138340faff3d59a31c3e01e (patch)
treeeea29d2684c51cc73725b8992a2125bede48e118 /utils/8c/reg.c
parentcd8e99851af33e52bcdf8faf34f9d4e62fa0cbaf (diff)
sync compilers with Plan 9
remove 1[acl] 2[acl]
Diffstat (limited to 'utils/8c/reg.c')
-rw-r--r--utils/8c/reg.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/utils/8c/reg.c b/utils/8c/reg.c
index fe84f573..9677cd24 100644
--- a/utils/8c/reg.c
+++ b/utils/8c/reg.c
@@ -16,7 +16,7 @@ rega(void)
}
int
-rcmp(const void *a1, const void *a2)
+rcmp(void *a1, void *a2)
{
Rgn *p1, *p2;
int c1, c2;
@@ -119,7 +119,7 @@ regopt(Prog *p)
r1->s1 = R;
}
- bit = mkvar(r, &p->from);
+ bit = mkvar(r, &p->from, p->as==AMOVL);
if(bany(&bit))
switch(p->as) {
/*
@@ -139,7 +139,7 @@ regopt(Prog *p)
break;
}
- bit = mkvar(r, &p->to);
+ bit = mkvar(r, &p->to, 0);
if(bany(&bit))
switch(p->as) {
default:
@@ -639,7 +639,7 @@ doregbits(int r)
}
Bits
-mkvar(Reg *r, Adr *a)
+mkvar(Reg *r, Adr *a, int isro)
{
Var *v;
int i, t, n, et, z;
@@ -653,13 +653,21 @@ mkvar(Reg *r, Adr *a)
t = a->type;
r->regu |= doregbits(t);
r->regu |= doregbits(a->index);
+ et = a->etype;
switch(t) {
default:
goto none;
+ case D_INDIR+D_GS:
+ if(!isro || 1)
+ goto none;
+ n = t;
+ {static Sym er; a->sym = &er;}
+ a->sym->name = "$extreg";
+ break;
case D_ADDR:
a->type = a->index;
- bit = mkvar(r, a);
+ bit = mkvar(r, a, 0);
for(z=0; z<BITS; z++)
addrs.b[z] |= bit.b[z];
a->type = t;
@@ -676,7 +684,6 @@ mkvar(Reg *r, Adr *a)
goto none;
if(s->name[0] == '.')
goto none;
- et = a->etype;
o = a->offset;
v = var;
for(i=0; i<nvar; i++) {
@@ -1010,7 +1017,7 @@ paint1(Reg *r, int bn)
if(r->use1.b[z] & bb) {
change += CREF * r->loop;
- if(p->as == AFMOVL)
+ if(p->as == AFMOVL || p->as == AFMOVW)
if(BtoR(bb) != D_F0)
change = -CINF;
if(debug['R'] && debug['v'])
@@ -1020,7 +1027,7 @@ paint1(Reg *r, int bn)
if((r->use2.b[z]|r->set.b[z]) & bb) {
change += CREF * r->loop;
- if(p->as == AFMOVL)
+ if(p->as == AFMOVL || p->as == AFMOVW)
if(BtoR(bb) != D_F0)
change = -CINF;
if(debug['R'] && debug['v'])
@@ -1030,7 +1037,7 @@ paint1(Reg *r, int bn)
if(STORE(r) & r->regdiff.b[z] & bb) {
change -= CLOAD * r->loop;
- if(p->as == AFMOVL)
+ if(p->as == AFMOVL || p->as == AFMOVW)
if(BtoR(bb) != D_F0)
change = -CINF;
if(debug['R'] && debug['v'])