aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Greenhalgh <james.greenhalgh@arm.com>2014-11-01 10:12:24 +0000
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>2014-11-01 10:12:24 +0000
commitae59bd31fe8c3fb7933d7b87aa69d755ae02cc29 (patch)
tree98a16409825cc41f5ed43354d08e13f2c7bfb39d
parentad23f5d41174ce13f2b3d912a3f6633d1d6bc0f5 (diff)
downloadgcc-ae59bd31fe8c3fb7933d7b87aa69d755ae02cc29.zip
gcc-ae59bd31fe8c3fb7933d7b87aa69d755ae02cc29.tar.gz
gcc-ae59bd31fe8c3fb7933d7b87aa69d755ae02cc29.tar.bz2
[Patch 4/7 sh] Deprecate *_BY_PIECES_P, move to hookized version
gcc/ * config/sh/sh.c (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): New. (sh_use_by_pieces_infrastructure_p): Likewise. * config/sh/sh.h (MOVE_BY_PIECES_P): Remove. (STORE_BY_PIECES_P): Likewise. (SET_BY_PIECES_P): Likewise. From-SVN: r217001
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/sh/sh.c31
-rw-r--r--gcc/config/sh/sh.h10
3 files changed, 39 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index daebba9..f193459 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2014-11-01 James Greenhalgh <james.greenhalgh@arm.com>
+ * config/sh/sh.c (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): New.
+ (sh_use_by_pieces_infrastructure_p): Likewise.
+ * config/sh/sh.h (MOVE_BY_PIECES_P): Remove.
+ (STORE_BY_PIECES_P): Likewise.
+ (SET_BY_PIECES_P): Likewise.
+
+2014-11-01 James Greenhalgh <james.greenhalgh@arm.com>
+
* config/arc/arc.c (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): New.
(arc_use_by_pieces_infrastructure_p): Likewise.
* confir/arc/arc.h (MOVE_BY_PIECES_P): Delete.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 1dc1bf4..3bbbd23 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -338,6 +338,10 @@ static void sh_conditional_register_usage (void);
static bool sh_legitimate_constant_p (machine_mode, rtx);
static int mov_insn_size (machine_mode, bool);
static int mov_insn_alignment_mask (machine_mode, bool);
+static bool sh_use_by_pieces_infrastructure_p (unsigned int,
+ unsigned int,
+ enum by_pieces_operation,
+ bool);
static bool sequence_insn_p (rtx_insn *);
static void sh_canonicalize_comparison (int *, rtx *, rtx *, bool);
static void sh_canonicalize_comparison (enum rtx_code&, rtx&, rtx&,
@@ -640,6 +644,10 @@ static const struct attribute_spec sh_attribute_table[] =
#undef TARGET_FIXED_CONDITION_CODE_REGS
#define TARGET_FIXED_CONDITION_CODE_REGS sh_fixed_condition_code_regs
+#undef TARGET_USE_BY_PIECES_INFRASTRUCTURE_P
+#define TARGET_USE_BY_PIECES_INFRASTRUCTURE_P \
+ sh_use_by_pieces_infrastructure_p
+
/* Machine-specific symbol_ref flags. */
#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
@@ -13674,4 +13682,27 @@ sh_mode_priority (int entity ATTRIBUTE_UNUSED, int n)
return ((TARGET_FPU_SINGLE != 0) ^ (n) ? FP_MODE_SINGLE : FP_MODE_DOUBLE);
}
+/* Implement TARGET_USE_BY_PIECES_INFRASTRUCTURE_P. */
+
+static bool
+sh_use_by_pieces_infrastructure_p (unsigned int size,
+ unsigned int align,
+ enum by_pieces_operation op,
+ bool speed_p)
+{
+ switch (op)
+ {
+ case MOVE_BY_PIECES:
+ return move_by_pieces_ninsns (size, align, MOVE_MAX_PIECES + 1)
+ < (!speed_p ? 2 : (align >= 32) ? 16 : 2);
+ case STORE_BY_PIECES:
+ case SET_BY_PIECES:
+ return move_by_pieces_ninsns (size, align, STORE_MAX_PIECES + 1)
+ < (!speed_p ? 2 : (align >= 32) ? 16 : 2);
+ default:
+ return default_use_by_pieces_infrastructure_p (size, align,
+ op, speed_p);
+ }
+}
+
#include "gt-sh.h"
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 5b8b4a1..92835d7 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1591,16 +1591,6 @@ struct sh_args {
#define USE_STORE_PRE_DECREMENT(mode) ((mode == SImode || mode == DImode) \
? 0 : TARGET_SH1)
-#define MOVE_BY_PIECES_P(SIZE, ALIGN) \
- (move_by_pieces_ninsns (SIZE, ALIGN, MOVE_MAX_PIECES + 1) \
- < (optimize_size ? 2 : ((ALIGN >= 32) ? 16 : 2)))
-
-#define STORE_BY_PIECES_P(SIZE, ALIGN) \
- (move_by_pieces_ninsns (SIZE, ALIGN, STORE_MAX_PIECES + 1) \
- < (optimize_size ? 2 : ((ALIGN >= 32) ? 16 : 2)))
-
-#define SET_BY_PIECES_P(SIZE, ALIGN) STORE_BY_PIECES_P(SIZE, ALIGN)
-
/* If a memory clear move would take CLEAR_RATIO or more simple
move-instruction pairs, we will do a setmem instead. */