qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit bbbc8994f9a4f6dba55002af48778327f37c3af6
parent e94592379fc167b574afd4a289aad69564ef5d34
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Tue, 22 Sep 2015 17:24:26 -0400

compile retw and retl as a move in rax

Diffstat:
Mlisc/isel.c | 20++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)

diff --git 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));