This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Handle MIPS DSP control registers
- From: Catherine Moore <clm at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Catherine Moore <clm at codesourcery dot com>
- Date: Wed, 22 Oct 2008 16:18:08 -0400
- Subject: [patch] Handle MIPS DSP control registers
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)