Mingjie Xing wrote: > 2011/2/18 Fu, Chao-Ying <f...@mips.com>: > > I think your analysis is correct. We should just delete > mips_order_regs_for_local_alloc() > > in mips.c and delete ADJUST_REG_ALLOC_ORDER in mips.h. > > Then, 3 accumulators can be used in dspr2-MULT.c and > dspr2-MULTU.c now. Thanks! > > /* ADJUST_REG_ALLOC_ORDER is a macro which permits reg_alloc_order > to be rearranged based on a particular function. On the mips16, we > want to allocate $24 (T_REG) before other registers for > instructions for which it is possible. */ > > #define ADJUST_REG_ALLOC_ORDER mips_order_regs_for_local_alloc () > > I'm just wondering if it Is appropriate to simply remove > ADJUST_REG_ALLOC_ORDER considering its comment.
Ok. Need to test if allocating $24 first is still better in MIPS16 under IRA. If yes, we should update mips_order_regs_for_local_alloc() for MIPS16 only (eg: exchange $24 and $1), as the default register order is as follows. Ex: /* We generally want to put call-clobbered registers ahead of call-saved ones. (IRA expects this.) */ #define REG_ALLOC_ORDER \ { /* Accumulator registers. When GPRs and accumulators have equal \ cost, we generally prefer to use accumulators. For example, \ a division of multiplication result is better allocated to LO, \ so that we put the MFLO at the point of use instead of at the \ point of definition. It's also needed if we're to take advantage \ of the extra accumulators available with -mdspr2. In some cases, \ it can also help to reduce register pressure. */ \ 64, 65,176,177,178,179,180,181, \ /* Call-clobbered GPRs. */ \ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \ 24, 25, 31, \ ... Regards, Chao-ying