Patchwork [BFIN] Hookize CLASS_LIKELY_SPILLED_P macro

login
register
mail settings
Submitter Anatoly Sokolov
Date Sept. 18, 2010, 2:58 p.m.
Message ID <1331450171.20100918185859@post.ru>
Download mbox | patch
Permalink /patch/65128/
State New
Headers show

Comments

Anatoly Sokolov - Sept. 18, 2010, 2:58 p.m.
Hi.

  This patch removes obsolete CLASS_LIKELY_SPILLED_P macro from the
Blackfin back end in the GCC and introduces equivalent
TARGET_CLASS_LIKELY_SPILLED_P target hook.


  Untested.

  OK to install?

        * config/bfin/bfin.h (CLASS_LIKELY_SPILLED_P): Remove.
        * config/bfin/bfin.c (TARGET_CLASS_LIKELY_SPILLED_P): Define.
        (bfin_class_likely_spilled_p): New function.




Anatoly.
Jie Zhang - Sept. 18, 2010, 10:48 p.m.
On 09/18/2010 10:58 PM, Anatoly Sokolov wrote:
> Hi.
>
>    This patch removes obsolete CLASS_LIKELY_SPILLED_P macro from the
> Blackfin back end in the GCC and introduces equivalent
> TARGET_CLASS_LIKELY_SPILLED_P target hook.
>
>
>    Untested.
>
>    OK to install?
>
>          * config/bfin/bfin.h (CLASS_LIKELY_SPILLED_P): Remove.
>          * config/bfin/bfin.c (TARGET_CLASS_LIKELY_SPILLED_P): Define.
>          (bfin_class_likely_spilled_p): New function.
>

OK. Thanks.

But please take a look at

http://gcc.gnu.org/cgi-bin/get-raw-msg?listname=gcc-patches&date=2010-09&msgid=1331450171.20100918185859%40post.ru

Your email contains many `=3D' and `=20'. So it cannot be saved as a 
file to be used as a patch. It's not convenient to try the patch.

Patch

Index: gcc/config/bfin/bfin.c
===================================================================
--- gcc/config/bfin/bfin.c      (revision 164010)
+++ gcc/config/bfin/bfin.c      (working copy)
@@ -2543,6 +2543,29 @@ 
 
   return NO_REGS;
 }
+
+/* Implement TARGET_CLASS_LIKELY_SPILLED_P.  */
+
+static bool
+bfin_class_likely_spilled_p (reg_class_t rclass)
+{
+  switch (rclass)
+    {
+      case PREGS_CLOBBERED:
+      case PROLOGUE_REGS:
+      case P0REGS:
+      case D0REGS:
+      case D1REGS:
+      case D2REGS:
+      case CCREGS:
+        return true;
+
+      default:
+        break;
+    }
+
+  return false;
+}
 
 /* Implement TARGET_HANDLE_OPTION.  */
 
@@ -6632,6 +6655,9 @@ 
 #undef TARGET_SECONDARY_RELOAD
 #define TARGET_SECONDARY_RELOAD bfin_secondary_reload
 
+#undef TARGET_CLASS_LIKELY_SPILLED_P
+#define TARGET_CLASS_LIKELY_SPILLED_P bfin_class_likely_spilled_p
+
 #undef TARGET_DELEGITIMIZE_ADDRESS
 #define TARGET_DELEGITIMIZE_ADDRESS bfin_delegitimize_address
 
Index: gcc/config/bfin/bfin.h
===================================================================
--- gcc/config/bfin/bfin.h      (revision 164010)
+++ gcc/config/bfin/bfin.h      (working copy)
@@ -761,15 +761,6 @@ 
    registers.  */
 #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
 
-#define CLASS_LIKELY_SPILLED_P(CLASS) \
-    ((CLASS) == PREGS_CLOBBERED \
-     || (CLASS) == PROLOGUE_REGS \
-     || (CLASS) == P0REGS \
-     || (CLASS) == D0REGS \
-     || (CLASS) == D1REGS \
-     || (CLASS) == D2REGS \
-     || (CLASS) == CCREGS)
-
 /* Do not allow to store a value in REG_CC for any mode */
 /* Do not allow to store value in pregs if mode is not SI*/
 #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok((REGNO), (MODE))