zaddr(Biobuf *b, Addr *a, int s)
{
int32 l;
- Ieee e;
+// Ieee e;
int i;
char *n;
break;
case D_FCONST:
- ieeedtod(&e, a->dval);
- l = e.l;
- Bputc(b, l);
- Bputc(b, l>>8);
- Bputc(b, l>>16);
- Bputc(b, l>>24);
- l = e.h;
- Bputc(b, l);
- Bputc(b, l>>8);
- Bputc(b, l>>16);
- Bputc(b, l>>24);
- break;
+ fatal("zaddr D_FCONST not implemented");
+ //ieeedtod(&e, a->dval);
+ //l = e.l;
+ //Bputc(b, l);
+ //Bputc(b, l>>8);
+ //Bputc(b, l>>16);
+ //Bputc(b, l>>24);
+ //l = e.h;
+ //Bputc(b, l);
+ //Bputc(b, l>>8);
+ //Bputc(b, l>>16);
+ //Bputc(b, l>>24);
+ //break;
}
}
{
int a, ft, tt;
Type *cvt;
- Node r1, r2, t1, t2, flo, fhi, tlo, thi, con, f0, f1, ax, dx, cx;
- Prog *p1, *p2, *p3;
+ Node r1, con;
+// Node r1, r2, t1, t2, flo, fhi, tlo, thi, con, f0, f1, ax, dx, cx;
+// Prog *p1, *p2, *p3;
if(debug['M'])
print("gmove %N -> %N\n", f, t);
gins(a, f, t);
return;
-rdst:
+//rdst:
// requires register destination
regalloc(&r1, t->type, t);
gins(a, f, &r1);
regfree(&r1);
return;
-hardmem:
+//hardmem:
// requires memory intermediate
tempalloc(&r1, cvt);
gmove(f, &r1);
Prog*
gins(int as, Node *f, Node *t)
{
- Node nod;
- int32 v;
+// Node nod;
+// int32 v;
Prog *p;
if(f != N && f->op == OINDEX) {
// break;
// }
-// cleani += 2;
-// reg = &clean[cleani-1];
-// reg1 = &clean[cleani-2];
-// reg->op = OEMPTY;
-// reg1->op = OEMPTY;
-// naddr(n, a);
-// goto yes;
+ cleani += 2;
+ reg = &clean[cleani-1];
+ reg1 = &clean[cleani-2];
+ reg->op = OEMPTY;
+ reg1->op = OEMPTY;
+ naddr(n, a);
+ goto yes;
odot:
o = dotoffset(n, oary, &nn);
char *a;
Binit(&bso, 1, OWRITE);
- srand(time(0));
cout = -1;
listinit();
outfile = 0;
break;
case D_SCONST:
- while(nhunk < NSNAME)
- gethunk();
- a->sval = (char*)hunk;
- nhunk -= NSNAME;
- hunk += NSNAME;
-
+ a->sval = mal(NSNAME);
Bread(f, a->sval, NSNAME);
c += NSNAME;
break;
case D_FCONST:
- while(nhunk < sizeof(Ieee))
- gethunk();
- a->ieee = (Ieee*)hunk;
- nhunk -= NSNAME;
- hunk += NSNAME;
-
+ a->ieee = mal(sizeof(Ieee));
a->ieee->l = Bget4(f);
a->ieee->h = Bget4(f);
break;
return;
}
- while(nhunk < sizeof(Auto))
- gethunk();
- u = (Auto*)hunk;
- nhunk -= sizeof(Auto);
- hunk += sizeof(Auto);
-
+ u = mal(sizeof(Auto));
u->link = curauto;
curauto = u;
u->asym = s;
goto loop;
}
- if(nhunk < sizeof(Prog))
- gethunk();
- p = (Prog*)hunk;
- nhunk -= sizeof(Prog);
- hunk += sizeof(Prog);
-
+ p = mal(sizeof(Prog));
p->as = o;
p->scond = Bgetc(f);
p->reg = Bgetc(f);
if(memcmp(s->name, symb, l) == 0)
return s;
- while(nhunk < sizeof(Sym))
- gethunk();
- s = (Sym*)hunk;
- nhunk -= sizeof(Sym);
- hunk += sizeof(Sym);
-
+ s = mal(sizeof(Sym));
s->name = malloc(l);
memmove(s->name, symb, l);
{
Prog *p;
- while(nhunk < sizeof(Prog))
- gethunk();
- p = (Prog*)hunk;
- nhunk -= sizeof(Prog);
- hunk += sizeof(Prog);
-
+ p = mal(sizeof(Prog));
*p = zprg;
return p;
}
-void
-gethunk(void)
-{
- char *h;
- int32 nh;
-
- nh = NHUNK;
- if(thunk >= 5L*NHUNK) {
- nh = 5L*NHUNK;
- if(thunk >= 25L*NHUNK)
- nh = 25L*NHUNK;
- }
- h = mysbrk(nh);
- if(h == (char*)-1) {
- diag("out of memory");
- errorexit();
- }
- hunk = h;
- nhunk = nh;
- thunk += nh;
-}
-
void
doprof1(void)
{