Patchwork [M32C] Hookize CLASS_LIKELY_SPILLED_P

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

Comments

Anatoly Sokolov - Sept. 2, 2010, 4:31 p.m.
Hi.

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

  Regression tested on m32c-unknown-elf.

  OK to install?

        * config/m32c/m32c.h (CLASS_LIKELY_SPILLED_P): Remove.
        * config/m32c/m32c-protos.h (m32c_class_likely_spilled_p): Remove.
        * config/m32c/m32c.c (TARGET_CLASS_LIKELY_SPILLED_P): Define.
        (m32c_class_likely_spilled_p): Make static. Change arguments type to
        reg_class_t.



Anatoly.
Richard Henderson - Sept. 2, 2010, 5:13 p.m.
On 09/02/2010 09:31 AM, Anatoly Sokolov wrote:
>         * config/m32c/m32c.h (CLASS_LIKELY_SPILLED_P): Remove.
>         * config/m32c/m32c-protos.h (m32c_class_likely_spilled_p): Remove.
>         * config/m32c/m32c.c (TARGET_CLASS_LIKELY_SPILLED_P): Define.
>         (m32c_class_likely_spilled_p): Make static. Change arguments type to
>         reg_class_t.

Ok.


r~

Patch

Index: gcc/config/m32c/m32c.c
===================================================================
--- gcc/config/m32c/m32c.c      (revision 163779)
+++ gcc/config/m32c/m32c.c      (working copy)
@@ -823,14 +823,19 @@ 
   return NO_REGS;
 }
 
-/* Implements CLASS_LIKELY_SPILLED_P.  A_REGS is needed for address
+/* Implements TARGET_CLASS_LIKELY_SPILLED_P.  A_REGS is needed for address
    reloads.  */
-int
-m32c_class_likely_spilled_p (int regclass)
+
+#undef TARGET_CLASS_LIKELY_SPILLED_P
+#define TARGET_CLASS_LIKELY_SPILLED_P m32c_class_likely_spilled_p
+
+static bool
+m32c_class_likely_spilled_p (reg_class_t regclass)
 {
   if (regclass == A_REGS)
-    return 1;
-  return reg_class_size[regclass] == 1;
+    return true;
+
+  return (reg_class_size[(int) regclass] == 1);
 }
 
 /* Implements CLASS_MAX_NREGS.  We calculate this according to its
Index: gcc/config/m32c/m32c.h
===================================================================
--- gcc/config/m32c/m32c.h      (revision 163779)
+++ gcc/config/m32c/m32c.h      (working copy)
@@ -421,8 +421,6 @@ 
 
 #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
 
-#define CLASS_LIKELY_SPILLED_P(C) m32c_class_likely_spilled_p (C)
-
 #define CLASS_MAX_NREGS(C,M) m32c_class_max_nregs (C, M)
 
 #define CANNOT_CHANGE_MODE_CLASS(F,T,C) m32c_cannot_change_mode_class(F,T,C)
Index: gcc/config/m32c/m32c-protos.h
===================================================================
--- gcc/config/m32c/m32c-protos.h       (revision 163779)
+++ gcc/config/m32c/m32c-protos.h       (working copy)
@@ -22,7 +22,6 @@ 
 #define MM enum machine_mode
 #define UINT unsigned int
 
-int  m32c_class_likely_spilled_p (int);
 void m32c_conditional_register_usage (void);
 int  m32c_const_ok_for_constraint_p (HOST_WIDE_INT, char, const char *);
 UINT m32c_dwarf_frame_regnum (int);