This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[S390] Hookize PREFERRED_RELOAD_CLASS


  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.

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);

Anatoly.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]