Browse Source

fix computation of stack register index

cache-refactoring
Aleksey Demakov 19 years ago
parent
commit
450b0ae1c3
  1. 8
      ChangeLog
  2. 20
      jit/jit-reg-alloc.c
  3. 5
      jit/jit-reg-alloc.h
  4. 4
      jit/jit-rules-x86.c

8
ChangeLog

@ -1,3 +1,11 @@
2006-05-20 avd <avd@buzz.wiraqocha.local>
* jit/jit-rules-x86.c (_jit_gen_exch_top): fix computation of stack
register index.
* jit/jit-reg-alloc.c (_jit_regs_assign): micro optimization by
changing nesting order of for and if statements.
2006-05-19 Aleksey Demakov <ademakov@gmail.com>
* jit-reg-alloc.h, jit/jit-reg-alloc.c: determine if input values

20
jit/jit-reg-alloc.c

@ -3740,23 +3740,17 @@ _jit_regs_assign(jit_gencode_t gen, _jit_regs_t *regs)
#endif
/* Set clobber flags. */
for(index = 0; index < JIT_NUM_REGS; index++)
if(regs->clobber_all)
{
if((_jit_reg_info[index].flags & JIT_REG_FIXED)
|| jit_reg_is_used(gen->permanent, index))
{
continue;
}
if(regs->clobber_all)
for(index = 0; index < JIT_NUM_REGS; index++)
{
if((_jit_reg_info[index].flags & JIT_REG_FIXED)
|| jit_reg_is_used(gen->permanent, index))
{
continue;
}
jit_reg_set_used(regs->clobber, index);
}
#if 0
if(jit_reg_is_used(regs->clobber, index))
{
jit_reg_set_used(gen->touched, index);
}
#endif
}
/* Spill all clobbered registers. */

5
jit/jit-reg-alloc.h

@ -74,11 +74,6 @@ void _jit_regs_get_reg_pair(jit_gencode_t gen, int not_this1, int not_this2,
*/
#define _JIT_REGS_SCRATCH_MAX 6
/*
* The maximum number of stack register exchanges.
*/
#define _JIT_REGS_MAX_EXCHANGES 16
/*
* Flags for _jit_regs_init().
*/

4
jit/jit-rules-x86.c

@ -775,11 +775,11 @@ _jit_gen_exch_top(jit_gencode_t gen, int reg, int pop)
jit_cache_setup_output(2);
if(pop)
{
x86_fstp(inst, reg - X86_REG_ST0);
x86_fstp(inst, fp_stack_index(gen, reg));
}
else
{
x86_fxch(inst, reg - X86_REG_ST0);
x86_fxch(inst, fp_stack_index(gen, reg));
}
jit_cache_end_output();
}

Loading…
Cancel
Save