This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: [MIPS] Test case dspr2-MULT is failed
- From: "Fu, Chao-Ying" <fu at mips dot com>
- To: Mingjie Xing <mingjie dot xing at gmail dot com>
- Cc: Chung-Lin Tang <cltang at codesourcery dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Richard Sandiford <rdsandiford at googlemail dot com>, "Fuhler, Rich" <rich at mips dot com>
- Date: Fri, 18 Feb 2011 01:37:45 +0000
- Subject: RE: [MIPS] Test case dspr2-MULT is failed
- References: <AANLkTimhP_2mewXieOCg0ppKNrx2084V1Okes69_5q6v@mail.gmail.com> <87ipyacba8.fsf@firetop.home> <4D260AC3.8080105@codesourcery.com> <7C6479EB2BF52547AC332FD6034646DA8495BF8A@exchdb01.mips.com> <AANLkTik=Jc5SumXpuy9GxKxO4ycChxY73ybXjdaF3DZi@mail.gmail.com>
Mingjie Xing wrote:
> 2011/2/18 Fu, Chao-Ying <fu@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