Commit 107715f0 by Anatoly Sokolov Committed by Anatoly Sokolov

arm.h (PREFERRED_RELOAD_CLASS): Remove.

	* config/arm/arm.h (PREFERRED_RELOAD_CLASS): Remove.
	* config/arm/arm.c (TARGET_PREFERRED_RELOAD_CLASS): Define.
	(arm_preferred_reload_class): New function.

From-SVN: r186092
parent efe2a4b7
2012-04-02 Anatoly Sokolov <aesok@post.ru>
* config/arm/arm.h (PREFERRED_RELOAD_CLASS): Remove.
* config/arm/arm.c (TARGET_PREFERRED_RELOAD_CLASS): Define.
(arm_preferred_reload_class): New function.
2012-04-02 Richard Guenther <rguenther@suse.de> 2012-04-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52756 PR tree-optimization/52756
......
...@@ -82,6 +82,7 @@ static int arm_legitimate_index_p (enum machine_mode, rtx, RTX_CODE, int); ...@@ -82,6 +82,7 @@ static int arm_legitimate_index_p (enum machine_mode, rtx, RTX_CODE, int);
static int thumb2_legitimate_index_p (enum machine_mode, rtx, int); static int thumb2_legitimate_index_p (enum machine_mode, rtx, int);
static int thumb1_base_register_rtx_p (rtx, enum machine_mode, int); static int thumb1_base_register_rtx_p (rtx, enum machine_mode, int);
static rtx arm_legitimize_address (rtx, rtx, enum machine_mode); static rtx arm_legitimize_address (rtx, rtx, enum machine_mode);
static reg_class_t arm_preferred_reload_class (rtx, reg_class_t);
static rtx thumb_legitimize_address (rtx, rtx, enum machine_mode); static rtx thumb_legitimize_address (rtx, rtx, enum machine_mode);
inline static int thumb1_index_register_rtx_p (rtx, int); inline static int thumb1_index_register_rtx_p (rtx, int);
static bool arm_legitimate_address_p (enum machine_mode, rtx, bool); static bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
...@@ -576,6 +577,9 @@ static const struct attribute_spec arm_attribute_table[] = ...@@ -576,6 +577,9 @@ static const struct attribute_spec arm_attribute_table[] =
#undef TARGET_LEGITIMATE_ADDRESS_P #undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P arm_legitimate_address_p #define TARGET_LEGITIMATE_ADDRESS_P arm_legitimate_address_p
#undef TARGET_PREFERRED_RELOAD_CLASS
#define TARGET_PREFERRED_RELOAD_CLASS arm_preferred_reload_class
#undef TARGET_INVALID_PARAMETER_TYPE #undef TARGET_INVALID_PARAMETER_TYPE
#define TARGET_INVALID_PARAMETER_TYPE arm_invalid_parameter_type #define TARGET_INVALID_PARAMETER_TYPE arm_invalid_parameter_type
...@@ -6226,6 +6230,30 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, bool strict_p) ...@@ -6226,6 +6230,30 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, bool strict_p)
return thumb1_legitimate_address_p (mode, x, strict_p); return thumb1_legitimate_address_p (mode, x, strict_p);
} }
/* Worker function for TARGET_PREFERRED_RELOAD_CLASS.
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 for the Thumb core registers and
immediate constants we prefer a LO_REGS class or a subset. */
static reg_class_t
arm_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, reg_class_t rclass)
{
if (TARGET_32BIT)
return rclass;
else
{
if (rclass == GENERAL_REGS
|| rclass == HI_REGS
|| rclass == NO_REGS
|| rclass == STACK_REG)
return LO_REGS;
else
return rclass;
}
}
/* Build the SYMBOL_REF for __tls_get_addr. */ /* Build the SYMBOL_REF for __tls_get_addr. */
static GTY(()) rtx tls_get_addr_libfunc; static GTY(()) rtx tls_get_addr_libfunc;
......
...@@ -1151,16 +1151,6 @@ enum reg_class ...@@ -1151,16 +1151,6 @@ enum reg_class
#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P \ #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P \
arm_small_register_classes_for_mode_p arm_small_register_classes_for_mode_p
/* 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 for the Thumb core registers and
immediate constants we prefer a LO_REGS class or a subset. */
#define PREFERRED_RELOAD_CLASS(X, CLASS) \
(TARGET_32BIT ? (CLASS) : \
((CLASS) == GENERAL_REGS || (CLASS) == HI_REGS \
|| (CLASS) == NO_REGS || (CLASS) == STACK_REG \
? LO_REGS : (CLASS)))
/* Must leave BASE_REGS reloads alone */ /* Must leave BASE_REGS reloads alone */
#define THUMB_SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ #define THUMB_SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
((CLASS) != LO_REGS && (CLASS) != BASE_REGS \ ((CLASS) != LO_REGS && (CLASS) != BASE_REGS \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment