summary refs log tree commit diff
path: root/lisc/isel.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-18 19:11:48 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:32 -0400
commit6f09869ea139782fd97e80182a0645891bf548d5 (patch)
tree1de16ac33bbcbefaf64f572ead798cd5e4e3f023 /lisc/isel.c
parent627e45e330d44c55a8dcd8dfe8ebe1b3b091ef9e (diff)
downloadroux-6f09869ea139782fd97e80182a0645891bf548d5.tar.gz
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).
Diffstat (limited to 'lisc/isel.c')
-rw-r--r--lisc/isel.c10
1 files changed, 4 insertions, 6 deletions
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; n<fn->ntmp; 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;
 		}