Patchwork [STORMY16] Hookize PREFERRED_RELOAD_CLASS and PREFERRED_OUTPUT_RELOAD_CLASS

login
register
mail settings
Submitter Anatoly Sokolov
Date Feb. 21, 2011, 9:01 p.m.
Message ID <416143196.20110222000144@post.ru>
Download mbox | patch
Permalink /patch/83874/
State New
Headers show

Comments

Anatoly Sokolov - Feb. 21, 2011, 9:01 p.m.
Hello.

  This patch removes obsolete PREFERRED_RELOAD_CLASS and 
PREFERRED_OUTPUT_RELOAD_CLASS macros from STORMY16 back end in the GCC and
introduces equivalent TARGET_PREFERRED_RELOAD_CLASS and 
TARGET_PREFERRED_OUTPUT_RELOAD_CLASS target hooks.


  Regression tested on xstormy16-unknown-elf.

  OK to install?

        * config/stormy16/stormy16.h (PREFERRED_RELOAD_CLASS,
        PREFERRED_OUTPUT_RELOAD_CLASS): Remove.
        * config/stormy16/stormy16-protos.h
        (xstormy16_preferred_reload_class): Remove.
        * config/stormy16/stormy16.c (xstormy16_preferred_reload_class): Make
        static. Change 'rclass' argument and return type to reg_class_t.
        (TARGET_PREFERRED_RELOAD_CLASS,
        TARGET_PREFERRED_OUTPUT_RELOAD_CLASS): Define.





Anatoly.
Nick Clifton - Feb. 22, 2011, 9:43 a.m.
Hi Anatoly,

>    OK to install?
>
>          * config/stormy16/stormy16.h (PREFERRED_RELOAD_CLASS,
>          PREFERRED_OUTPUT_RELOAD_CLASS): Remove.
>          * config/stormy16/stormy16-protos.h
>          (xstormy16_preferred_reload_class): Remove.
>          * config/stormy16/stormy16.c (xstormy16_preferred_reload_class): Make
>          static. Change 'rclass' argument and return type to reg_class_t.
>          (TARGET_PREFERRED_RELOAD_CLASS,
>          TARGET_PREFERRED_OUTPUT_RELOAD_CLASS): Define.

Approved - please apply.

Cheers
   Nick

Patch

Index: gcc/config/stormy16/stormy16.c
===================================================================
--- gcc/config/stormy16/stormy16.c      (revision 170367)
+++ gcc/config/stormy16/stormy16.c      (working copy)
@@ -469,8 +469,11 @@ 
   return NO_REGS;
 }
 
-enum reg_class
-xstormy16_preferred_reload_class (rtx x, enum reg_class rclass)
+/* Worker function for TARGET_PREFERRED_RELOAD_CLASS
+   and TARGET_PREFERRED_OUTPUT_RELOAD_CLASS.  */
+
+static reg_class_t
+xstormy16_preferred_reload_class (rtx x, reg_class_t rclass)
 {
   if (rclass == GENERAL_REGS && MEM_P (x))
     return EIGHT_REGS;
@@ -2604,6 +2607,11 @@ 
 #undef  TARGET_MACHINE_DEPENDENT_REORG
 #define TARGET_MACHINE_DEPENDENT_REORG xstormy16_reorg
 
+#undef  TARGET_PREFERRED_RELOAD_CLASS
+#define TARGET_PREFERRED_RELOAD_CLASS xstormy16_preferred_reload_class
+#undef  TARGET_PREFERRED_OUTPUT_RELOAD_CLASS
+#define TARGET_PREFERRED_OUTPUT_RELOAD_CLASS xstormy16_preferred_reload_class
+
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P    xstormy16_legitimate_address_p
 #undef TARGET_MODE_DEPENDENT_ADDRESS_P
Index: gcc/config/stormy16/stormy16.h
===================================================================
--- gcc/config/stormy16/stormy16.h      (revision 170367)
+++ gcc/config/stormy16/stormy16.h      (working copy)
@@ -229,12 +229,6 @@ 
 
 #define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM)
 
-#define PREFERRED_RELOAD_CLASS(X, CLASS) \
-  xstormy16_preferred_reload_class (X, CLASS)
-
-#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \
-  xstormy16_preferred_reload_class (X, CLASS)
-
 /* This chip has the interesting property that only the first eight
    registers can be moved to/from memory.  */
 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X)                 \
Index: gcc/config/stormy16/stormy16-protos.h
===================================================================
--- gcc/config/stormy16/stormy16-protos.h       (revision 170367)
+++ gcc/config/stormy16/stormy16-protos.h       (working copy)
@@ -61,7 +61,6 @@ 
 extern int  nonimmediate_nonstack_operand (rtx, enum machine_mode);
 extern enum reg_class xstormy16_secondary_reload_class 
  (enum reg_class, enum machine_mode, rtx);
-extern enum reg_class xstormy16_preferred_reload_class (rtx, enum reg_class);
 extern void xstormy16_split_move (enum machine_mode, rtx, rtx);
 extern void xstormy16_expand_move (enum machine_mode, rtx, rtx);
 extern void xstormy16_expand_arith (enum machine_mode, enum rtx_code,