summary refs log tree commit diff
path: root/lisc/spill.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-11 16:26:12 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:31 -0400
commit1583f4bd329440a78f6d261cfad1043095439bbd (patch)
treeec42503fb37a34bfad87605fc6eda4308a638263 /lisc/spill.c
parentf6df9e55c53cbab88f8222e4c13390c7adf03e6f (diff)
downloadroux-1583f4bd329440a78f6d261cfad1043095439bbd.tar.gz
split store into store{w,l}
Diffstat (limited to 'lisc/spill.c')
-rw-r--r--lisc/spill.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisc/spill.c b/lisc/spill.c
index 14b33c5..6554316 100644
--- a/lisc/spill.c
+++ b/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);
 		}