]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
More bug fixes for the x86 back end.
authorRhys Weatherley <rweather@southern-storm.com.au>
Wed, 26 May 2004 00:31:51 +0000 (00:31 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Wed, 26 May 2004 00:31:51 +0000 (00:31 +0000)
ChangeLog
jit/jit-function.c
jit/jit-rules-x86.c
jit/jit-rules-x86.sel
tools/gen-sel-parser.y

index 3063841b4f8fa66bf7f04bbd74526cc46c54ebd5..c3a75fa360bbfb847a739539e54283f75169fe83 100644 (file)
--- 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  <rweather@southern-storm.com.au>
 
        * tools/.cvsignore, tools/Makefile.am, tools/gen-sel-parser.y,
index a8313264ada6edd0c6d8563db8af1e39756a93d3..cdb8a92c2b24669b29fd1b9d8ae9e132f40c26cd 100644 (file)
@@ -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 */
index c1c93d9af79a4b41774be8252159b51546a27b4d..8a337906ae5a98c4b56c69e016e2bcf3fcab495f 100644 (file)
@@ -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;
        }
index 7cc9982946a534c23ba5dfe8cf839f3bca77968a..bf62140e029bcde61acdf2828f056a58c864069a 100644 (file)
@@ -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 */
+       }
index ed4444c58c7bb692d2c772faf466ca51db13d508..a8e30d461df2aff205007b4a9ac48fadf94dcb4c 100644 (file)
@@ -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;