split store into store{w,l}
This commit is contained in:
parent
f6df9e55c5
commit
1583f4bd32
5 changed files with 64 additions and 76 deletions
13
lisc/spill.c
13
lisc/spill.c
|
@ -184,6 +184,15 @@ emit(short op, Ref to, Ref arg0, Ref arg1)
|
|||
*--curi = (Ins){op, to, {arg0, arg1}};
|
||||
}
|
||||
|
||||
static void
|
||||
store(Ref r, int s)
|
||||
{
|
||||
if (tmp[r.val].type == TLong)
|
||||
emit(OStorel, R, r, SLOT(s));
|
||||
else
|
||||
emit(OStorew, R, r, SLOT(s));
|
||||
}
|
||||
|
||||
static int
|
||||
limit(Bits *b, int k, Bits *fst)
|
||||
{
|
||||
|
@ -372,7 +381,7 @@ spill(Fn *fn)
|
|||
BSET(w, i->arg[1].val);
|
||||
j -= setloc(&i->arg[1], &v, &w);
|
||||
if (s)
|
||||
emit(OStore, R, i->to, SLOT(s));
|
||||
store(i->to, s);
|
||||
emit(i->op, i->to, i->arg[0], i->arg[1]);
|
||||
}
|
||||
|
||||
|
@ -383,7 +392,7 @@ spill(Fn *fn)
|
|||
BCLR(v, t);
|
||||
s = tmp[t].spill;
|
||||
if (s)
|
||||
emit(OStore, R, p->to, SLOT(s));
|
||||
store(p->to, s);
|
||||
} else
|
||||
p->to = slot(p->to.val);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue