public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Handle MIPS DSP control registers
@ 2008-10-22 22:34 Catherine Moore
  2008-10-23 22:27 ` Richard Sandiford
  0 siblings, 1 reply; 6+ messages in thread
From: Catherine Moore @ 2008-10-22 22:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: Catherine Moore

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

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.


[-- Attachment #2: dsp2.patch --]
[-- Type: text/x-patch, Size: 1220 bytes --]

*** 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)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-01 17:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-22 22:34 [patch] Handle MIPS DSP control registers Catherine Moore
2008-10-23 22:27 ` Richard Sandiford
2008-10-25  2:01   ` Chao-ying Fu
2008-10-25 17:00     ` Richard Sandiford
2008-10-30 22:54       ` Catherine Moore
2008-11-01 17:53         ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).