From 6f09869ea139782fd97e80182a0645891bf548d5 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 18 Aug 2015 19:11:48 -0400 Subject: move spill and emit to the new slot system In emit, I worked a little to make sure that framesz works when we change the size of the svec array (if we need more alignments). --- lisc/isel.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lisc/isel.c') diff --git a/lisc/isel.c b/lisc/isel.c index 5fbe8d9..af21bcb 100644 --- a/lisc/isel.c +++ b/lisc/isel.c @@ -357,13 +357,11 @@ seljmp(Blk *b, Fn *fn) } int -slot_(int sz, int al /* log2 */, Fn *fn) +slota(int sz, int al /* log2 */, int *sa) { - enum { N = sizeof fn->slot / sizeof fn->slot[0] }; + enum { N = sizeof (Fn){0}.svec / sizeof (Fn){0}.svec[0] }; int j, k, s, l, a, ret; - int *sa; - sa = fn->slot; a = 1 << al; l = sz; @@ -429,7 +427,7 @@ isel(Fn *fn) /* assign slots to fast allocs */ for (n=Tmp0; nntmp; n++) fn->tmp[n].spill = 0; - memcpy(fn->slot, (int[3]){0, 0, 2}, 3 * sizeof(int)); + memcpy(fn->svec, (int[3]){0, 0, 2}, 3 * sizeof(int)); for (b=fn->start, i=b->ins; i-b->ins < b->nins; i++) if (OAlloc <= i->op && i->op <= OAlloc1) { @@ -440,7 +438,7 @@ isel(Fn *fn) diag("isel: invalid alloc size"); sz = (sz + 3) / 4; al = i->op - OAlloc; - s = slot_(sz, al, fn); + s = slota(sz, al, fn->svec); fn->tmp[i->to.val].spill = s; i->to = R; } -- cgit 1.4.1