aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>2015-12-17 19:55:39 +0300
committerDenis Chertykov <denisc@gcc.gnu.org>2015-12-17 19:55:39 +0300
commit998f15f3b6a3ec8963e5c9864480d5c990099bc8 (patch)
tree48f5a33661807489ccc663e4534c63ea77d68b2d /gcc
parent62f9ab0d432554c33c8d9c449ebcae73b2789812 (diff)
downloadgcc-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')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/avr/avr.c25
-rw-r--r--gcc/config/avr/avr.h17
3 files changed, 51 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3a6aa88..4e5c967 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2015-12-17 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ * 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.
+
2015-12-17 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* config.gcc: mark *-interix* as obsolete.
@@ -349,7 +358,7 @@
* configure.ac: Remove checks for functions that exist in isl 0.13
or later.
* graphite-isl-ast-to-gimple.c: Remove #ifdefs and code for isl 0.12.
- * graphite-optimize-isl.c: Same.
+ * graphite-optimize-isl.c: Same.
* graphite-poly.c: Same.
* graphite-sese-to-poly.c: Same.
* graphite.h: Add comment for isl 0.14.
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;
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 7439964..9872884 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -453,7 +453,22 @@ typedef struct avr_args
#undef WORD_REGISTER_OPERATIONS
-#define MOVE_MAX 4
+/* Can move only a single byte from memory to reg in a
+ single instruction. */
+
+#define MOVE_MAX 1
+
+/* Allow upto two bytes moves to occur using by_pieces
+ infrastructure */
+
+#define MOVE_MAX_PIECES 2
+
+/* Set MOVE_RATIO to 3 to allow memory moves upto 4 bytes to happen
+ by pieces when optimizing for speed, like it did when MOVE_MAX_PIECES
+ was 4. When optimizing for size, allow memory moves upto 2 bytes.
+ Also see avr_use_by_pieces_infrastructure_p. */
+
+#define MOVE_RATIO(speed) ((speed) ? 3 : 2)
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1