+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,
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
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.
*/
{
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]);
}
/*
- * 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
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++)
{
}
/*
- * Spill regualar (non-stack) register.
+ * Spill regular (non-stack) register.
*/
static void
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
{