From: Rhys Weatherley Date: Wed, 26 May 2004 00:31:51 +0000 (+0000) Subject: More bug fixes for the x86 back end. X-Git-Tag: r.0.0.4~82 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=23e7561ff68130e448274b208308c8b3a1723099;p=francis%2Flibjit.git More bug fixes for the x86 back end. --- diff --git a/ChangeLog b/ChangeLog index 3063841..c3a75fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ jit/jit-rules.h, tools/gen-sel-parser.y: fix some compile issues in the x86 native back end. + * jit/jit-function.c, jit/jit-rules-x86.c, jit/jit-rules-x86.sel, + tools/gen-sel-parser.y: more bug fixes for the x86 back end. + 2004-05-25 Rhys Weatherley * tools/.cvsignore, tools/Makefile.am, tools/gen-sel-parser.y, diff --git a/jit/jit-function.c b/jit/jit-function.c index a831326..cdb8a92 100644 --- a/jit/jit-function.c +++ b/jit/jit-function.c @@ -1190,7 +1190,7 @@ int jit_function_apply_vararg /* Restore the backtrace and "setjmp" contexts and exit */ _jit_unwind_pop_setjmp(); - return 0; + return 1; } #endif /* !JIT_BACKEND_INTERP */ diff --git a/jit/jit-rules-x86.c b/jit/jit-rules-x86.c index c1c93d9..8a33790 100644 --- a/jit/jit-rules-x86.c +++ b/jit/jit-rules-x86.c @@ -1302,7 +1302,12 @@ static unsigned char *jump_to_epilog { /* If the epilog is the next thing that we will output, then fall through to the epilog directly */ - if(!(block->next)) + block = block->next; + while(block != 0 && block->first_insn > block->last_insn) + { + block = block->next; + } + if(!block) { return inst; } diff --git a/jit/jit-rules-x86.sel b/jit/jit-rules-x86.sel index 7cc9982..bf62140 100644 --- a/jit/jit-rules-x86.sel +++ b/jit/jit-rules-x86.sel @@ -603,3 +603,53 @@ JIT_OP_IMPORT: [] -> { /* TODO */ } + +/* + * Stack pushes and pops. + */ + +JIT_OP_PUSH_INT: unary_branch + [imm] -> { + x86_push_imm(inst, $1); + } + [local] -> { + x86_push_membase(inst, X86_EBP, $1); + } + [reg] -> { + x86_push_reg(inst, $1); + } + +JIT_OP_PUSH_LONG: + [] -> { + /* TODO */ + } + +JIT_OP_PUSH_FLOAT32: + [] -> { + /* TODO */ + } + +JIT_OP_PUSH_FLOAT64: + [] -> { + /* TODO */ + } + +JIT_OP_PUSH_NFLOAT: + [] -> { + /* TODO */ + } + +JIT_OP_PUSH_STRUCT: + [] -> { + /* TODO */ + } + +JIT_OP_POP_STACK: + [] -> { + x86_alu_reg_imm(inst, X86_ADD, X86_ESP, insn->value1->address); + } + +JIT_OP_FLUSH_SMALL_STRUCT: + [] -> { + /* TODO */ + } diff --git a/tools/gen-sel-parser.y b/tools/gen-sel-parser.y index ed4444c..a8e30d4 100644 --- a/tools/gen-sel-parser.y +++ b/tools/gen-sel-parser.y @@ -498,7 +498,7 @@ static void gensel_output_clauses(gensel_clause_t clauses, int options) case GENSEL_PATT_IMMS16: case GENSEL_PATT_IMMU16: { - printf("\t\timm_value = %s->is_nint_constant;\n", arg); + printf("\t\timm_value = %s->address;\n", arg); } break;