]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Minor register assignment bugs.
authorRhys Weatherley <rweather@southern-storm.com.au>
Tue, 8 Jun 2004 06:40:53 +0000 (06:40 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Tue, 8 Jun 2004 06:40:53 +0000 (06:40 +0000)
ChangeLog
jit/jit-reg-alloc.c
jit/jit-rules-arm.c
jit/jit-rules-arm.sel
jit/jit-rules-x86.sel

index 8eabc2f873403d911e3453e65673fac271b59108..5915afdd5ac4bca424a6bcc854a1592e9fd6d700 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,9 @@
        * jit/jit-rules-arm.c (_jit_gen_spill_reg): spill properly to
        global registers for ARM.
 
+       * jit/jit-reg-alloc.c, jit/jit-rules-arm.c, jit/jit-rules-arm.sel,
+       jit/jit-rules-x86.sel: minor register assignment bugs.
+
 2004-06-08  Miroslaw Dobrzanski-Neumann  <mne@mosaic-ag.com>
 
        * jit/jit-alloc.c: fix ROUND_END_PTR so that it adds the size
index 629bc11a1d10ca698e9452de4d087900d19f9c0d..465cf556bb415d6493829f2ba95d644b0b9e7656 100644 (file)
@@ -1499,6 +1499,7 @@ void _jit_regs_alloc_global(jit_gencode_t gen, jit_function_t func)
                candidates[index]->global_reg = (short)reg;
                jit_reg_set_used(gen->touched, reg);
                jit_reg_set_used(gen->permanent, reg);
+               --reg;
        }
 
 #endif
index c64c0c5239cceee54c7eb32055270dcc49effb03..4138df3eee57cfd87a82fa0e24cbcce3f1e516ce 100644 (file)
@@ -357,7 +357,7 @@ int _jit_create_call_setup_insns
                size = jit_type_get_size(jit_value_get_type(args[num_args]));
                size = ROUND_STACK(size) / sizeof(void *);
                word_regs -= size;
-               if(!jit_insn_outgoing_reg(func, args[num_args], (int)size))
+               if(!jit_insn_outgoing_reg(func, args[num_args], (int)word_regs))
                {
                        return 0;
                }
@@ -529,7 +529,7 @@ void *_jit_gen_prolog(jit_gencode_t gen, jit_function_t func, void *buf)
        /* Allocate space for the local variable frame.  Subtract off
           the space for the registers that we just saved.  The pc, lr,
           and fp registers are always saved, so account for them too */
-       frame_size = func->builder->frame_size - (saved + 3);
+       frame_size = func->builder->frame_size - (saved + 3 * sizeof(void *));
        if(frame_size > 0)
        {
                arm_alu_reg_imm(inst, ARM_SUB, ARM_SP, ARM_SP, frame_size);
index 810cf08dcb2b7ad2a54bb5661927bf42586b787b..4de15a54f0330fdb4aede226935e7577ac0d1af7 100644 (file)
@@ -582,7 +582,7 @@ JIT_OP_RETURN:
                inst = jump_to_epilog(gen, inst, block);
        }
 
-JIT_OP_RETURN_INT: unary_note
+JIT_OP_RETURN_INT: unary_branch
        [reg] -> {
                int cpu_reg = $1;
                if(cpu_reg != ARM_R0)
index 9ec1d8d4d8d8c4a0472e8159b673c2ad0c8892d5..253e913e9b074081b05e206fdd525c67cab6dc3f 100644 (file)
@@ -1462,7 +1462,7 @@ JIT_OP_RETURN:
                inst = jump_to_epilog(gen, inst, block);
        }
 
-JIT_OP_RETURN_INT: unary_note
+JIT_OP_RETURN_INT: unary_branch
        [reg] -> {
                int cpu_reg = $1;
                if(cpu_reg != X86_EAX)
@@ -1492,17 +1492,17 @@ JIT_OP_RETURN_LONG: spill_before
                inst = jump_to_epilog(gen, inst, block);
        }
 
-JIT_OP_RETURN_FLOAT32: unary_note, stack, only
+JIT_OP_RETURN_FLOAT32: unary_branch, stack, only
        [freg] -> {
                inst = jump_to_epilog(gen, inst, block);
        }
 
-JIT_OP_RETURN_FLOAT64: unary_note, stack, only
+JIT_OP_RETURN_FLOAT64: unary_branch, stack, only
        [freg] -> {
                inst = jump_to_epilog(gen, inst, block);
        }
 
-JIT_OP_RETURN_NFLOAT: unary_note, stack, only
+JIT_OP_RETURN_NFLOAT: unary_branch, stack, only
        [freg] -> {
                inst = jump_to_epilog(gen, inst, block);
        }