diff options
author | denisc <denisc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-17 16:55:39 +0000 |
---|---|---|
committer | denisc <denisc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-17 16:55:39 +0000 |
commit | a24f50c512734d8f4c7d585ab8e93fb6a7172dcf (patch) | |
tree | 48f5a33661807489ccc663e4534c63ea77d68b2d /gcc/config/avr/avr.c | |
parent | 02df6497f638f375402643092f183d9c07ac0bfb (diff) | |
download | gcc-a24f50c512734d8f4c7d585ab8e93fb6a7172dcf.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231782 138bc75d-0d04-0410-961f-82ee72b054a4
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 609a42b00e4..9cc95dbc782 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; |