Browse Source

Minor register assignment bugs.

cache-refactoring
Rhys Weatherley 21 years ago
parent
commit
003ff11377
  1. 3
      ChangeLog
  2. 1
      jit/jit-reg-alloc.c
  3. 4
      jit/jit-rules-arm.c
  4. 2
      jit/jit-rules-arm.sel
  5. 8
      jit/jit-rules-x86.sel

3
ChangeLog

@ -24,6 +24,9 @@
* jit/jit-rules-arm.c (_jit_gen_spill_reg): spill properly to * jit/jit-rules-arm.c (_jit_gen_spill_reg): spill properly to
global registers for ARM. 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> 2004-06-08 Miroslaw Dobrzanski-Neumann <mne@mosaic-ag.com>
* jit/jit-alloc.c: fix ROUND_END_PTR so that it adds the size * jit/jit-alloc.c: fix ROUND_END_PTR so that it adds the size

1
jit/jit-reg-alloc.c

@ -1499,6 +1499,7 @@ void _jit_regs_alloc_global(jit_gencode_t gen, jit_function_t func)
candidates[index]->global_reg = (short)reg; candidates[index]->global_reg = (short)reg;
jit_reg_set_used(gen->touched, reg); jit_reg_set_used(gen->touched, reg);
jit_reg_set_used(gen->permanent, reg); jit_reg_set_used(gen->permanent, reg);
--reg;
} }
#endif #endif

4
jit/jit-rules-arm.c

@ -357,7 +357,7 @@ int _jit_create_call_setup_insns
size = jit_type_get_size(jit_value_get_type(args[num_args])); size = jit_type_get_size(jit_value_get_type(args[num_args]));
size = ROUND_STACK(size) / sizeof(void *); size = ROUND_STACK(size) / sizeof(void *);
word_regs -= size; 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; 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 /* Allocate space for the local variable frame. Subtract off
the space for the registers that we just saved. The pc, lr, the space for the registers that we just saved. The pc, lr,
and fp registers are always saved, so account for them too */ 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) if(frame_size > 0)
{ {
arm_alu_reg_imm(inst, ARM_SUB, ARM_SP, ARM_SP, frame_size); arm_alu_reg_imm(inst, ARM_SUB, ARM_SP, ARM_SP, frame_size);

2
jit/jit-rules-arm.sel

@ -582,7 +582,7 @@ JIT_OP_RETURN:
inst = jump_to_epilog(gen, inst, block); inst = jump_to_epilog(gen, inst, block);
} }
JIT_OP_RETURN_INT: unary_note JIT_OP_RETURN_INT: unary_branch
[reg] -> { [reg] -> {
int cpu_reg = $1; int cpu_reg = $1;
if(cpu_reg != ARM_R0) if(cpu_reg != ARM_R0)

8
jit/jit-rules-x86.sel

@ -1462,7 +1462,7 @@ JIT_OP_RETURN:
inst = jump_to_epilog(gen, inst, block); inst = jump_to_epilog(gen, inst, block);
} }
JIT_OP_RETURN_INT: unary_note JIT_OP_RETURN_INT: unary_branch
[reg] -> { [reg] -> {
int cpu_reg = $1; int cpu_reg = $1;
if(cpu_reg != X86_EAX) if(cpu_reg != X86_EAX)
@ -1492,17 +1492,17 @@ JIT_OP_RETURN_LONG: spill_before
inst = jump_to_epilog(gen, inst, block); inst = jump_to_epilog(gen, inst, block);
} }
JIT_OP_RETURN_FLOAT32: unary_note, stack, only JIT_OP_RETURN_FLOAT32: unary_branch, stack, only
[freg] -> { [freg] -> {
inst = jump_to_epilog(gen, inst, block); inst = jump_to_epilog(gen, inst, block);
} }
JIT_OP_RETURN_FLOAT64: unary_note, stack, only JIT_OP_RETURN_FLOAT64: unary_branch, stack, only
[freg] -> { [freg] -> {
inst = jump_to_epilog(gen, inst, block); inst = jump_to_epilog(gen, inst, block);
} }
JIT_OP_RETURN_NFLOAT: unary_note, stack, only JIT_OP_RETURN_NFLOAT: unary_branch, stack, only
[freg] -> { [freg] -> {
inst = jump_to_epilog(gen, inst, block); inst = jump_to_epilog(gen, inst, block);
} }

Loading…
Cancel
Save