From bbbc8994f9a4f6dba55002af48778327f37c3af6 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 22 Sep 2015 17:24:26 -0400 Subject: compile retw and retl as a move in rax --- lisc/isel.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'lisc/isel.c') 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)); -- cgit 1.4.1