This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Handle MIPS DSP control registers
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Catherine Moore <clm at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 Oct 2008 22:57:54 +0100
- Subject: Re: [patch] Handle MIPS DSP control registers
- References: <48FF8A80.8070502@codesourcery.com>
Catherine Moore <clm@codesourcery.com> writes:
> This patch adds definitons for the DSP control registers and then handles them in registers in
> mips_conditional_register_usage. Okay to install? Thanks, Catherine
>
>
> 2008-10-22 Catherine Moore <clm@codesourcery.com>
>
> * config/mips.h (DSP_CTRL_REG_FIRST): Define.
> (DSP_CTRL_REG_LAST): Define.
> * config/mips.c (mips_conditional_register_usage): Handle the
> DSP control registers.
>
> *** mips.c (revision 225707)
> --- mips.c (local)
> *************** mips_swap_registers (unsigned int i)
> *** 13939,13950 ****
> --- 13939,13959 ----
> void
> mips_conditional_register_usage (void)
> {
> +
> + /* These DSP control register fields are global. */
> + if (ISA_HAS_DSP)
> + {
> + global_regs[CCDSP_PO_REGNUM] = 1;
> + global_regs[CCDSP_SC_REGNUM] = 1;
> + }
> if (!ISA_HAS_DSP)
> {
> int regno;
>
> for (regno = DSP_ACC_REG_FIRST; regno <= DSP_ACC_REG_LAST; regno++)
> fixed_regs[regno] = call_used_regs[regno] = 1;
> + for (regno = DSP_CTRL_REG_FIRST; regno <= DSP_CTRL_REG_LAST; regno++)
> + fixed_regs[regno] = call_used_regs[regno] = 1;
> }
> if (!TARGET_HARD_FLOAT)
> {
> *** mips.h (revision 225707)
> --- mips.h (local)
> *************** enum mips_code_readable_setting {
> *** 1637,1642 ****
> --- 1637,1645 ----
> #define DSP_ACC_REG_LAST 181
> #define DSP_ACC_REG_NUM (DSP_ACC_REG_LAST - DSP_ACC_REG_FIRST + 1)
>
> + #define DSP_CTRL_REG_FIRST 182
> + #define DSP_CTRL_REG_LAST 187
> +
> #define AT_REGNUM (GP_REG_FIRST + 1)
> #define HI_REGNUM (TARGET_BIG_ENDIAN ? MD_REG_FIRST : MD_REG_FIRST + 1)
> #define LO_REGNUM (TARGET_BIG_ENDIAN ? MD_REG_FIRST + 1 : MD_REG_FIRST)
I'm not saying the patch is wrong, but I'm not sure what the
motivation is. What goes wrong if we don't fix these registers?
And why do we want to make the SCOUNT and POS fields global?
Why aren't those two fields call-clobbered like the others?
This would be an ABI change from 4.3, so would need to be mentioned
somewhere. The DSP part of extend.texi should also mention which
fields are global.
Richard