diff --git a/ChangeLog b/ChangeLog index 13568d4..1c02f3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-05-20 avd + + * 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 * jit-reg-alloc.h, jit/jit-reg-alloc.c: determine if input values diff --git a/jit/jit-reg-alloc.c b/jit/jit-reg-alloc.c index f3d218f..cea4fe5 100644 --- a/jit/jit-reg-alloc.c +++ b/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. */ diff --git a/jit/jit-reg-alloc.h b/jit/jit-reg-alloc.h index 10c3bbe..4a8f3a9 100644 --- a/jit/jit-reg-alloc.h +++ b/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(). */ diff --git a/jit/jit-rules-x86.c b/jit/jit-rules-x86.c index ae6e96c..5cc9631 100644 --- a/jit/jit-rules-x86.c +++ b/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(); }