summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-22 17:24:26 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-22 17:24:26 -0400
commitbbbc8994f9a4f6dba55002af48778327f37c3af6 (patch)
tree0728e0de0d23595227c3b7adfc12d8e5649ff1d3 /lisc
parente94592379fc167b574afd4a289aad69564ef5d34 (diff)
downloadroux-bbbc8994f9a4f6dba55002af48778327f37c3af6.tar.gz
compile retw and retl as a move in rax
Diffstat (limited to 'lisc')
-rw-r--r--lisc/isel.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/lisc/isel.c b/lisc/isel.c
index 8c428e7..d8a3ef9 100644
--- a/lisc/isel.c
+++ b/lisc/isel.c
@@ -277,11 +277,27 @@ static void
 seljmp(Blk *b, Fn *fn)
 {
 	Ref r;
-	int c;
+	int c, w;
 	Ins *fi;
 
-	if (b->jmp.type != JJnz)
+	switch (b->jmp.type) {
+	default:
 		return;
+	case JRetc:
+		assert(!"retc todo");
+	case JRetw:
+		w = 0;
+	if (0) {
+	case JRetl:
+		w = 1;
+	}
+		b->jmp.type = JRet0;
+		r = b->jmp.arg;
+		b->jmp.arg = R;
+		emit(OCopy, w, TMP(RAX), r, R);
+		return;
+	case JJnz:;
+	}
 	r = b->jmp.arg;
 	b->jmp.arg = R;
 	assert(!req(r, R));