* config/rs6000/rs6000-protos.h
authorAldy Hernandez <aldyh@redhat.com>
Sun, 9 May 2004 14:32:49 +0000 (14:32 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Sun, 9 May 2004 14:32:49 +0000 (14:32 +0000)
(rs6000_conditional_register_usage): Protoize.

* config/rs6000/rs6000.c (rs6000_conditional_register_usage): New.

* config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Call
function.

From-SVN: r81650

gcc/ChangeLog
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h

index 9b395e8d68daf011283130da3055e7d42dc325d9..72a0b130e026bab954175d8aae50d86738186dcf 100644 (file)
@@ -1,3 +1,13 @@
+2004-05-09  Aldy Hernandez  <aldyh@redhat.com>
+
+       * config/rs6000/rs6000-protos.h
+       (rs6000_conditional_register_usage): Protoize.
+
+       * config/rs6000/rs6000.c (rs6000_conditional_register_usage): New.
+
+       * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Call
+       function.
+
 2004-05-08  Roger Sayle  <roger@eyesopen.com>
 
        * fold-const.c (fold_div_compare): New function to optimize X/C1 op C2
index fa8a3829e726349a5763d637aec5f38ee1c265df..7078c16e084a832ed3f5779063f242c922bcc908 100644 (file)
@@ -202,6 +202,7 @@ extern bool rs6000_tls_referenced_p (rtx);
 extern int rs6000_tls_symbol_ref (rtx, enum machine_mode);
 extern void rs6000_output_dwarf_dtprel (FILE*, int, rtx);
 extern int rs6000_hard_regno_nregs (int, enum machine_mode);
+extern void rs6000_conditional_register_usage (void);
 
 /* Declare functions in rs6000-c.c */
 
index bf831eabdbd7a32822e5938d478437f188771e54..db8fdcce567ecf75426d25ed1629a25956a1c61b 100644 (file)
@@ -3430,6 +3430,71 @@ rs6000_hard_regno_nregs (int regno, enum machine_mode mode)
 
   return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 }
+
+/* Change register usage conditional on target flags.  */
+void
+rs6000_conditional_register_usage (void)
+{
+  int i;
+
+  /* Set MQ register fixed (already call_used) if not POWER
+     architecture (RIOS1, RIOS2, RSC, and PPC601) so that it will not
+     be allocated.  */
+  if (! TARGET_POWER)
+    fixed_regs[64] = 1;
+
+  /* 64-bit AIX reserves GPR13 for thread-private data.  */
+  if (TARGET_64BIT)
+    fixed_regs[13] = call_used_regs[13]
+      = call_really_used_regs[13] = 1;
+
+  /* Conditionally disable FPRs.  */
+  if (TARGET_SOFT_FLOAT || !TARGET_FPRS)
+    for (i = 32; i < 64; i++)
+      fixed_regs[i] = call_used_regs[i]
+        = call_really_used_regs[i] = 1;
+
+  if (DEFAULT_ABI == ABI_V4
+      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
+      && flag_pic == 2)
+    fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+
+  if (DEFAULT_ABI == ABI_V4
+      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
+      && flag_pic == 1)
+    fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
+      = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
+      = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+
+  if (DEFAULT_ABI == ABI_DARWIN
+      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
+    global_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
+      = fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
+      = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
+      = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+
+  if (TARGET_ALTIVEC)
+    global_regs[VSCR_REGNO] = 1;
+
+  if (TARGET_SPE)
+    {
+      global_regs[SPEFSCR_REGNO] = 1;
+      fixed_regs[FIXED_SCRATCH]
+        = call_used_regs[FIXED_SCRATCH]
+       = call_really_used_regs[FIXED_SCRATCH] = 1;
+    }
+
+  if (! TARGET_ALTIVEC)
+    {
+      for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i)
+       fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
+      call_really_used_regs[VRSAVE_REGNO] = 1;
+    }
+
+  if (TARGET_ALTIVEC_ABI)
+    for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i)
+      call_used_regs[i] = call_really_used_regs[i] = 1;
+}
 \f
 /* Try to output insns to set TARGET equal to the constant C if it can
    be done in less than N insns.  Do all computations in MODE.
index 8bd516d3f2b3c927125a75215c6c900a13d08d30..d08aca9b888c84171cac303ebb5162188c3f3f36 100644 (file)
@@ -1097,59 +1097,10 @@ extern const char *rs6000_warn_altivec_long_switch;
 
 #define FIXED_SCRATCH (TARGET_SPE ? 14 : 11)
 
-/* Define this macro to change register usage conditional on target flags.
-   Set MQ register fixed (already call_used) if not POWER architecture
-   (RIOS1, RIOS2, RSC, and PPC601) so that it will not be allocated.
-   64-bit AIX reserves GPR13 for thread-private data.
-   Conditionally disable FPRs.  */
+/* Define this macro to change register usage conditional on target
+   flags.  */
 
-#define CONDITIONAL_REGISTER_USAGE                                     \
-{                                                                      \
-  int i;                                                               \
-  if (! TARGET_POWER)                                                  \
-    fixed_regs[64] = 1;                                                        \
-  if (TARGET_64BIT)                                                    \
-    fixed_regs[13] = call_used_regs[13]                                        \
-      = call_really_used_regs[13] = 1;                                         \
-  if (TARGET_SOFT_FLOAT || !TARGET_FPRS)                               \
-    for (i = 32; i < 64; i++)                                          \
-      fixed_regs[i] = call_used_regs[i]                                        \
-        = call_really_used_regs[i] = 1;                                        \
-  if (DEFAULT_ABI == ABI_V4                                            \
-      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM                     \
-      && flag_pic == 2)                                                        \
-    fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;                    \
-  if (DEFAULT_ABI == ABI_V4                                            \
-      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM                     \
-      && flag_pic == 1)                                                        \
-    fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                         \
-      = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                 \
-      = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;     \
-  if (DEFAULT_ABI == ABI_DARWIN                                                \
-      && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)                    \
-    global_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                                \
-      = fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                     \
-      = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]                 \
-      = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;     \
-  if (TARGET_ALTIVEC)                                                   \
-    global_regs[VSCR_REGNO] = 1;                                        \
-  if (TARGET_SPE)                                                      \
-    {                                                                   \
-      global_regs[SPEFSCR_REGNO] = 1;                                  \
-      fixed_regs[FIXED_SCRATCH]                                                \
-        = call_used_regs[FIXED_SCRATCH]                                        \
-       = call_really_used_regs[FIXED_SCRATCH] = 1;                     \
-    }                                                                   \
-  if (! TARGET_ALTIVEC)                                                        \
-    {                                                                  \
-      for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i)      \
-       fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1; \
-      call_really_used_regs[VRSAVE_REGNO] = 1;                         \
-    }                                                                  \
-  if (TARGET_ALTIVEC_ABI)                                              \
-    for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i)   \
-      call_used_regs[i] = call_really_used_regs[i] = 1;                        \
-}
+#define CONDITIONAL_REGISTER_USAGE rs6000_conditional_register_usage ()
 
 /* Specify the registers used for certain standard purposes.
    The values of these macros are register numbers.  */