Browse Source

fix problem with destroying the end register of a long pair;

make new register allocator the default.
cache-refactoring
Aleksey Demakov 19 years ago
parent
commit
dee4d52fad
  1. 7
      ChangeLog
  2. 2
      configure.in
  3. 38
      jit/jit-reg-alloc.c

7
ChangeLog

@ -1,3 +1,10 @@
2006-07-05 Aleksey Demakov <ademakov@gmail.com>
* configure.in: make new register allocator the default.
* jit/jit-reg-alloc.c (is_register_alive, compute_spill_cost): fix
problem with destroying the end register of a long pair.
2006-07-03 Aleksey Demakov <ademakov@gmail.com>
* jit/jit-rules-x86.ins: add JIT_OP_LOW_WORD, JIT_OP_EXPAND_INT,

2
configure.in

@ -70,7 +70,7 @@ AC_ARG_ENABLE(new-reg-alloc,
yes) new_reg_alloc=true ;;
no) new_reg_alloc=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-new-reg-alloc) ;;
esac],[new_reg_alloc=false])
esac],[new_reg_alloc=true])
if test x$new_reg_alloc = xtrue; then
AC_DEFINE(USE_NEW_REG_ALLOC, 1, [Define if you want to use new register allocator])
fi

38
jit/jit-reg-alloc.c

@ -1713,6 +1713,23 @@ get_stack_top(jit_gencode_t gen, int stack_start)
return (gen->stack_map[stack_start]);
}
/*
* Find the start register of a long pair given the end register.
*/
static int
get_long_pair_start(int other_reg)
{
int reg;
for(reg = 0; reg < JIT_NUM_REGS; reg++)
{
if(other_reg == OTHER_REG(reg))
{
return reg;
}
}
return -1;
}
/*
* Determine the type of register that we need.
*/
@ -1889,6 +1906,10 @@ is_register_alive(jit_gencode_t gen, _jit_regs_t *regs, int reg)
{
return 1;
}
if(gen->contents[reg].is_long_end)
{
reg = get_long_pair_start(reg);
}
for(index = 0; index < gen->contents[reg].num_values; index++)
{
usage = value_usage(regs, gen->contents[reg].values[index]);
@ -2359,7 +2380,7 @@ set_regdesc_flags(jit_gencode_t gen, _jit_regs_t *regs, int index)
}
/*
* Check to see if loading one input value into the given register
* Check to see if an input value loaded into the given register
* clobbers any other input values.
*/
static int
@ -2493,6 +2514,11 @@ compute_spill_cost(jit_gencode_t gen, _jit_regs_t *regs, int reg, int other_reg)
int cost, index, usage;
jit_value_t value;
if(gen->contents[reg].is_long_end)
{
reg = get_long_pair_start(reg);
}
cost = 0;
for(index = 0; index < gen->contents[reg].num_values; index++)
{
@ -3469,7 +3495,7 @@ save_value(jit_gencode_t gen, jit_value_t value, int reg, int other_reg, int fre
}
/*
* Spill regualar (non-stack) register.
* Spill regular (non-stack) register.
*/
static void
spill_reg(jit_gencode_t gen, _jit_regs_t *regs, int reg)
@ -3489,13 +3515,7 @@ spill_reg(jit_gencode_t gen, _jit_regs_t *regs, int reg)
else if(gen->contents[reg].is_long_end)
{
other_reg = reg;
for(reg = 0; reg < JIT_NUM_REGS; ++reg)
{
if(other_reg == OTHER_REG(reg))
{
break;
}
}
reg = get_long_pair_start(reg);
}
else
{

Loading…
Cancel
Save