Patchwork [S390] Hookize PREFERRED_RELOAD_CLASS

login
register
mail settings
Submitter Anatoly Sokolov
Date Jan. 25, 2011, 10:05 p.m.
Message ID <1518741991.20110126010534@post.ru>
Download mbox | patch
Permalink /patch/80409/
State New
Headers show

Comments

Anatoly Sokolov - Jan. 25, 2011, 10:05 p.m.
Hi.

  This patch removes obsolete PREFERRED_RELOAD_CLASS macro from the S390 back 
end in the GCC and introduces equivalent TARGET_PREFERRED_RELOAD_CLASS target 
hook.

  Not tested.

  OK to install?

        * config/s390/s390.h (PREFERRED_RELOAD_CLASS): Remove.
        * config/s390/s390-protos.h (s390_preferred_reload_class): Remove.
        * config/s390/s390.c (TARGET_PREFERRED_RELOAD_CLASS): Define.
        (s390_preferred_reload_class): Make static. Change return and
        'rclass' argument type to reg_class_t.


Anatoly.
Andreas Krebbel - Jan. 26, 2011, 1:32 p.m.
>   Not tested.
> 
>   OK to install?
> 
>         * config/s390/s390.h (PREFERRED_RELOAD_CLASS): Remove.
>         * config/s390/s390-protos.h (s390_preferred_reload_class): Remove.
>         * config/s390/s390.c (TARGET_PREFERRED_RELOAD_CLASS): Define.
>         (s390_preferred_reload_class): Make static. Change return and
>         'rclass' argument type to reg_class_t.

Ok. Regtested on s390x.

Bye,

-Andreas-

Patch

Index: gcc/config/s390/s390.c
===================================================================
--- gcc/config/s390/s390.c      (revision 169182)
+++ gcc/config/s390/s390.c      (working copy)
@@ -2951,8 +2951,8 @@ 
 /* Given an rtx OP being reloaded into a reg required to be in class RCLASS,
    return the class of reg to actually use.  */
 
-enum reg_class
-s390_preferred_reload_class (rtx op, enum reg_class rclass)
+static reg_class_t
+s390_preferred_reload_class (rtx op, reg_class_t rclass)
 {
   switch (GET_CODE (op))
     {
@@ -10717,6 +10717,9 @@ 
 #undef TARGET_SCALAR_MODE_SUPPORTED_P
 #define TARGET_SCALAR_MODE_SUPPORTED_P s390_scalar_mode_supported_p
 
+#undef  TARGET_PREFERRED_RELOAD_CLASS
+#define TARGET_PREFERRED_RELOAD_CLASS s390_preferred_reload_class
+
 #undef TARGET_SECONDARY_RELOAD
 #define TARGET_SECONDARY_RELOAD s390_secondary_reload
 
Index: gcc/config/s390/s390.h
===================================================================
--- gcc/config/s390/s390.h      (revision 169182)
+++ gcc/config/s390/s390.h      (working copy)
@@ -531,11 +531,6 @@ 
 #define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO)
 
 
-/* Given an rtx X being reloaded into a reg required to be in class CLASS,
-   return the class of reg to actually use.  */
-#define PREFERRED_RELOAD_CLASS(X, CLASS)       \
-  s390_preferred_reload_class ((X), (CLASS))
-
 /* We need secondary memory to move data between GPRs and FPRs.  With
    DFP the ldgr lgdr instructions are available.  But these
    instructions do not handle GPR pairs so it is not possible for 31
Index: gcc/config/s390/s390-protos.h
===================================================================
--- gcc/config/s390/s390-protos.h       (revision 169182)
+++ gcc/config/s390/s390-protos.h       (working copy)
@@ -70,7 +70,6 @@ 
 extern bool legitimate_reload_constant_p (rtx);
 extern rtx legitimize_pic_address (rtx, rtx);
 extern rtx legitimize_reload_address (rtx, enum machine_mode, int, int);
-extern enum reg_class s390_preferred_reload_class (rtx, enum reg_class);
 extern enum reg_class s390_secondary_input_reload_class (enum reg_class,
                                                         enum machine_mode,
                                                         rtx);