diff options
author | Anatoly Sokolov <aesok@post.ru> | 2011-02-03 23:14:10 +0300 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2011-02-03 23:14:10 +0300 |
commit | a6e508f91d95bdf154a19307d5e1277a98dfb19e (patch) | |
tree | 4988599a3de10823ab67c0cd7a406d562c0383e6 /gcc | |
parent | 82dc0de3f7c06c38d5c30aadc3e99e041ae889bc (diff) | |
download | gcc-a6e508f91d95bdf154a19307d5e1277a98dfb19e.zip gcc-a6e508f91d95bdf154a19307d5e1277a98dfb19e.tar.gz gcc-a6e508f91d95bdf154a19307d5e1277a98dfb19e.tar.bz2 |
xtensa.h (PREFERRED_RELOAD_CLASS, [...]): Remove.
* config/xtensa/xtensa.h (PREFERRED_RELOAD_CLASS,
PREFERRED_OUTPUT_RELOAD_CLASS): Remove.
* config/xtensa/xtensa-protos.h (xtensa_preferred_reload_class,
secondary_reload_info, xtensa_secondary_reload): Remove.
* config/xtensa/xtensa.c (TARGET_PREFERRED_RELOAD_CLASS,
TARGET_PREFERRED_OUTPUT_RELOAD_CLASS): Define.
(xtensa_preferred_reload_class): Make static. Change return and
'rclass' argument type to reg_class_t. Remove 'isoutput' argument.
Use CONST_DOUBLE_P predicate.
(xtensa_preferred_output_reload_class): New function.
(xtensa_secondary_reload): Make static.
From-SVN: r169810
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa-protos.h | 7 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.c | 39 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.h | 6 |
4 files changed, 50 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2ee198c..548aa31 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2011-02-03 Anatoly Sokolov <aesok@post.ru> + + * config/xtensa/xtensa.h (PREFERRED_RELOAD_CLASS, + PREFERRED_OUTPUT_RELOAD_CLASS): Remove. + * config/xtensa/xtensa-protos.h (xtensa_preferred_reload_class, + secondary_reload_info, xtensa_secondary_reload): Remove. + * config/xtensa/xtensa.c (TARGET_PREFERRED_RELOAD_CLASS, + TARGET_PREFERRED_OUTPUT_RELOAD_CLASS): Define. + (xtensa_preferred_reload_class): Make static. Change return and + 'rclass' argument type to reg_class_t. Remove 'isoutput' argument. + Use CONST_DOUBLE_P predicate. + (xtensa_preferred_output_reload_class): New function. + (xtensa_secondary_reload): Make static. + 2011-02-03 Joseph Myers <joseph@codesourcery.com> * config/microblaze/microblaze.opt (Zxl-mode-bootstrap, diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h index 5db4e4e..0d1738f 100644 --- a/gcc/config/xtensa/xtensa-protos.h +++ b/gcc/config/xtensa/xtensa-protos.h @@ -1,5 +1,5 @@ /* Prototypes of target machine for GNU compiler for Xtensa. - Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 + Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica. @@ -63,11 +63,6 @@ extern void print_operand (FILE *, rtx, int); extern void print_operand_address (FILE *, rtx); extern void xtensa_output_literal (FILE *, rtx, enum machine_mode, int); extern rtx xtensa_return_addr (int, rtx); -extern enum reg_class xtensa_preferred_reload_class (rtx, enum reg_class, int); -struct secondary_reload_info; -extern reg_class_t xtensa_secondary_reload (bool, rtx, reg_class_t, - enum machine_mode, - struct secondary_reload_info *); #endif /* RTX_CODE */ extern void xtensa_setup_frame_addresses (void); diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 85dac15..b1ea5bd 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -162,6 +162,12 @@ static void xtensa_asm_trampoline_template (FILE *); static void xtensa_trampoline_init (rtx, tree, rtx); static bool xtensa_output_addr_const_extra (FILE *, rtx); +static reg_class_t xtensa_preferred_reload_class (rtx, reg_class_t); +static reg_class_t xtensa_preferred_output_reload_class (rtx, reg_class_t); +static reg_class_t xtensa_secondary_reload (bool, rtx, reg_class_t, + enum machine_mode, + struct secondary_reload_info *); + static bool constantpool_address_p (const_rtx addr); static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = @@ -260,6 +266,11 @@ static const struct default_options xtensa_option_optimization_table[] = #undef TARGET_EXPAND_BUILTIN #define TARGET_EXPAND_BUILTIN xtensa_expand_builtin +#undef TARGET_PREFERRED_RELOAD_CLASS +#define TARGET_PREFERRED_RELOAD_CLASS xtensa_preferred_reload_class +#undef TARGET_PREFERRED_OUTPUT_RELOAD_CLASS +#define TARGET_PREFERRED_OUTPUT_RELOAD_CLASS xtensa_preferred_output_reload_class + #undef TARGET_SECONDARY_RELOAD #define TARGET_SECONDARY_RELOAD xtensa_secondary_reload @@ -3153,11 +3164,12 @@ xtensa_expand_builtin (tree exp, rtx target, return NULL_RTX; } +/* Worker function for TARGET_PREFERRED_RELOAD_CLASS. */ -enum reg_class -xtensa_preferred_reload_class (rtx x, enum reg_class rclass, int isoutput) +static reg_class_t +xtensa_preferred_reload_class (rtx x, reg_class_t rclass) { - if (!isoutput && CONSTANT_P (x) && GET_CODE (x) == CONST_DOUBLE) + if (CONSTANT_P (x) && CONST_DOUBLE_P (x)) return NO_REGS; /* Don't use the stack pointer or hard frame pointer for reloads! @@ -3172,8 +3184,27 @@ xtensa_preferred_reload_class (rtx x, enum reg_class rclass, int isoutput) return rclass; } +/* Worker function for TARGET_PREFERRED_OUTPUT_RELOAD_CLASS. */ + +static reg_class_t +xtensa_preferred_output_reload_class (rtx x ATTRIBUTE_UNUSED, + reg_class_t rclass) +{ + /* Don't use the stack pointer or hard frame pointer for reloads! + The hard frame pointer would normally be OK except that it may + briefly hold an incoming argument in the prologue, and reload + won't know that it is live because the hard frame pointer is + treated specially. */ + + if (rclass == AR_REGS || rclass == GR_REGS) + return RL_REGS; + + return rclass; +} + +/* Worker function for TARGET_SECONDARY_RELOAD. */ -reg_class_t +static reg_class_t xtensa_secondary_reload (bool in_p, rtx x, reg_class_t rclass, enum machine_mode mode, secondary_reload_info *sri) { diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 3d498e1..098855b 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -455,12 +455,6 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER]; the RTL, as either incoming or outgoing arguments. */ #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true -#define PREFERRED_RELOAD_CLASS(X, CLASS) \ - xtensa_preferred_reload_class (X, CLASS, 0) - -#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \ - xtensa_preferred_reload_class (X, CLASS, 1) - /* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */ #define CLASS_UNITS(mode, size) \ |