* config/sh/sh-protos.h (secondary_reload_info, sh_secondary_reload):
Remove forward declaration.
* config/sh/sh.c (sh_preferred_reload_class): New function.
(sh_secondary_reload): Make static.
(TARGET_PREFERRED_RELOAD_CLASS): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168104
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-12-21 Anatoly Sokolov <aesok@post.ru>
+
+ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Remove.
+ * config/sh/sh-protos.h (secondary_reload_info, sh_secondary_reload):
+ Remove forward declaration.
+ * config/sh/sh.c (sh_preferred_reload_class): New function.
+ (sh_secondary_reload): Make static.
+ (TARGET_PREFERRED_RELOAD_CLASS): Define.
+
2010-12-20 Joseph Myers <joseph@codesourcery.com>
* config/alpha/linux.h (OPTION_GLIBC): Define differently if
extern int sh_contains_memref_p (rtx);
extern int sh_loads_bankedreg_p (rtx);
extern rtx shmedia_prepare_call_address (rtx fnaddr, int is_sibcall);
-struct secondary_reload_info;
-extern reg_class_t sh_secondary_reload (bool, rtx, reg_class_t,
- enum machine_mode,
- struct secondary_reload_info *);
extern int sh2a_get_function_vector_number (rtx);
extern int sh2a_is_function_vector_call (rtx);
extern void sh_fix_range (const char *);
static int sh_address_cost (rtx, bool);
static int sh_pr_n_sets (void);
static rtx sh_allocate_initial_value (rtx);
+static reg_class_t sh_preferred_reload_class (rtx, reg_class_t);
+static reg_class_t sh_secondary_reload (bool, rtx, reg_class_t,
+ enum machine_mode,
+ struct secondary_reload_info *);
static bool sh_legitimate_address_p (enum machine_mode, rtx, bool);
static rtx sh_legitimize_address (rtx, rtx, enum machine_mode);
static rtx sh_delegitimize_address (rtx);
#undef TARGET_SECONDARY_RELOAD
#define TARGET_SECONDARY_RELOAD sh_secondary_reload
+#undef TARGET_PREFERRED_RELOAD_CLASS
+#define TARGET_PREFERRED_RELOAD_CLASS sh_preferred_reload_class
+
#undef TARGET_CONDITIONAL_REGISTER_USAGE
#define TARGET_CONDITIONAL_REGISTER_USAGE sh_conditional_register_usage
return fnaddr;
}
-reg_class_t
+/* Implement TARGET_PREFERRED_RELOAD_CLASS. */
+
+static reg_class_t
+sh_preferred_reload_class (rtx x, reg_class_t rclass)
+{
+ if (rclass == NO_REGS
+ && TARGET_SHMEDIA
+ && (CONST_DOUBLE_P (x)
+ || GET_CODE (x) == SYMBOL_REF
+ || PIC_ADDR_P (x)))
+ return GENERAL_REGS;
+
+ return rclass;
+}
+
+/* Implement TARGET_SECONDARY_RELOAD. */
+
+static reg_class_t
sh_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
enum machine_mode mode, secondary_reload_info *sri)
{
#define CONST_OK_FOR_K08(VALUE) (((HOST_WIDE_INT)(VALUE))>= 0 \
&& ((HOST_WIDE_INT)(VALUE)) <= 255)
-/* Given an rtx X being reloaded into a reg required to be
- in class CLASS, return the class of reg to actually use.
- In general this is just CLASS; but on some machines
- in some cases it is preferable to use a more restrictive class. */
-
-#define PREFERRED_RELOAD_CLASS(X, CLASS) \
- ((CLASS) == NO_REGS && TARGET_SHMEDIA \
- && (GET_CODE (X) == CONST_DOUBLE \
- || GET_CODE (X) == SYMBOL_REF \
- || PIC_ADDR_P (X)) \
- ? GENERAL_REGS \
- : (CLASS)) \
-
#if 0
#define SECONDARY_INOUT_RELOAD_CLASS(CLASS,MODE,X,ELSE) \
((((REGCLASS_HAS_FP_REG (CLASS) \