diff options
author | Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> | 2015-12-17 19:55:39 +0300 |
---|---|---|
committer | Denis Chertykov <denisc@gcc.gnu.org> | 2015-12-17 19:55:39 +0300 |
commit | 998f15f3b6a3ec8963e5c9864480d5c990099bc8 (patch) | |
tree | 48f5a33661807489ccc663e4534c63ea77d68b2d /gcc/config/avr/avr.c | |
parent | 62f9ab0d432554c33c8d9c449ebcae73b2789812 (diff) | |
download | gcc-998f15f3b6a3ec8963e5c9864480d5c990099bc8.zip gcc-998f15f3b6a3ec8963e5c9864480d5c990099bc8.tar.gz gcc-998f15f3b6a3ec8963e5c9864480d5c990099bc8.tar.bz2 |
avr.h (MOVE_MAX): Set value to 1.
* config/avr/avr.h (MOVE_MAX): Set value to 1.
(MOVE_MAX_PIECES): Define.
(MOVE_RATIO): Define.
* config/avr/avr.c (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P):
Provide target hook.
(avr_use_by_pieces_infrastructure_p): New function.
From-SVN: r231782
Diffstat (limited to 'gcc/config/avr/avr.c')
-rw-r--r-- | gcc/config/avr/avr.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 609a42b..9cc95db 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -2431,6 +2431,27 @@ avr_print_operand (FILE *file, rtx x, int code) } +/* Implement TARGET_USE_BY_PIECES_INFRASTRUCTURE_P. */ + +/* Prefer sequence of loads/stores for moves of size upto + two - two pairs of load/store instructions are always better + than the 5 instruction sequence for a loop (1 instruction + for loop counter setup, and 4 for the body of the loop). */ + +static bool +avr_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size, + unsigned int align ATTRIBUTE_UNUSED, + enum by_pieces_operation op, + bool speed_p) +{ + + if (op != MOVE_BY_PIECES || (speed_p && (size > (MOVE_MAX_PIECES)))) + return default_use_by_pieces_infrastructure_p (size, align, op, speed_p); + + return size <= (MOVE_MAX_PIECES); +} + + /* Worker function for `NOTICE_UPDATE_CC'. */ /* Update the condition code in the INSN. */ @@ -13763,6 +13784,10 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg, #undef TARGET_PRINT_OPERAND_PUNCT_VALID_P #define TARGET_PRINT_OPERAND_PUNCT_VALID_P avr_print_operand_punct_valid_p +#undef TARGET_USE_BY_PIECES_INFRASTRUCTURE_P +#define TARGET_USE_BY_PIECES_INFRASTRUCTURE_P \ + avr_use_by_pieces_infrastructure_p + struct gcc_target targetm = TARGET_INITIALIZER; |