aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJames Greenhalgh <james.greenhalgh@arm.com>2014-11-01 10:38:42 +0000
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>2014-11-01 10:38:42 +0000
commita5474c4cb0cd4499437eeffd7223bb7533100d48 (patch)
tree0edf81860981caef03874539ae606f3bd23b2997 /gcc/expr.c
parentd3006da6f1f3b24d4274597c30f460e2241fb9e4 (diff)
downloadgcc-a5474c4cb0cd4499437eeffd7223bb7533100d48.zip
gcc-a5474c4cb0cd4499437eeffd7223bb7533100d48.tar.gz
gcc-a5474c4cb0cd4499437eeffd7223bb7533100d48.tar.bz2
[Patch 7/7] Remove *_BY_PIECES_P
gcc/ * doc/tm.texi.in (MOVE_BY_PIECES_P): Remove. (CLEAR_BY_PIECES_P): Likewise. (SET_BY_PIECES_P): Likewise. (STORE_BY_PIECES_P): Likewise. * doc/tm.texi: Regenerate. * system.h: Poison MOVE_BY_PIECES_P, CLEAR_BY_PIECES_P, SET_BY_PIECES_P, STORE_BY_PIECES_P. * expr.c (MOVE_BY_PIECES_P): Remove. (CLEAR_BY_PIECES_P): Likewise. (SET_BY_PIECES_P): Likewise. (STORE_BY_PIECES_P): Likewise. (can_move_by_pieces): Rewrite in terms of targetm.use_by_pieces_infrastructure_p. (emit_block_move_hints): Likewise. (can_store_by_pieces): Likewise. (store_by_pieces): Likewise. (clear_storage_hints): Likewise. (emit_push_insn): Likewise. (expand_constructor): Likewise. From-SVN: r217004
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c66
1 files changed, 22 insertions, 44 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index ef85177..af42b61 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -167,37 +167,6 @@ static void do_tablejump (rtx, machine_mode, rtx, rtx, rtx, int);
static rtx const_vector_from_tree (tree);
static void write_complex_part (rtx, rtx, bool);
-/* This macro is used to determine whether move_by_pieces should be called
- to perform a structure copy. */
-#ifndef MOVE_BY_PIECES_P
-#define MOVE_BY_PIECES_P(SIZE, ALIGN) \
- (targetm.use_by_pieces_infrastructure_p (SIZE, ALIGN, MOVE_BY_PIECES, \
- optimize_insn_for_speed_p ()))
-#endif
-
-/* This macro is used to determine whether clear_by_pieces should be
- called to clear storage. */
-#ifndef CLEAR_BY_PIECES_P
-#define CLEAR_BY_PIECES_P(SIZE, ALIGN) \
- (targetm.use_by_pieces_infrastructure_p (SIZE, ALIGN, CLEAR_BY_PIECES, \
- optimize_insn_for_speed_p ()))
-#endif
-
-/* This macro is used to determine whether store_by_pieces should be
- called to "memset" storage with byte values other than zero. */
-#ifndef SET_BY_PIECES_P
-#define SET_BY_PIECES_P(SIZE, ALIGN) \
- (targetm.use_by_pieces_infrastructure_p (SIZE, ALIGN, SET_BY_PIECES, \
- optimize_insn_for_speed_p ()))
-#endif
-
-/* This macro is used to determine whether store_by_pieces should be
- called to "memcpy" storage when the source is a constant string. */
-#ifndef STORE_BY_PIECES_P
-#define STORE_BY_PIECES_P(SIZE, ALIGN) \
- (targetm.use_by_pieces_infrastructure_p (SIZE, ALIGN, STORE_BY_PIECES, \
- optimize_insn_for_speed_p ()))
-#endif
/* This is run to set up which modes can be used
directly in memory and to initialize the block move optab. It is run
@@ -832,10 +801,11 @@ widest_int_mode_for_size (unsigned int size)
succeed. */
int
-can_move_by_pieces (unsigned HOST_WIDE_INT len ATTRIBUTE_UNUSED,
- unsigned int align ATTRIBUTE_UNUSED)
+can_move_by_pieces (unsigned HOST_WIDE_INT len,
+ unsigned int align)
{
- return MOVE_BY_PIECES_P (len, align);
+ return targetm.use_by_pieces_infrastructure_p (len, align, MOVE_BY_PIECES,
+ optimize_insn_for_speed_p ());
}
/* Generate several move instructions to copy LEN bytes from block FROM to
@@ -1172,7 +1142,7 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
set_mem_size (y, INTVAL (size));
}
- if (CONST_INT_P (size) && MOVE_BY_PIECES_P (INTVAL (size), align))
+ if (CONST_INT_P (size) && can_move_by_pieces (INTVAL (size), align))
move_by_pieces (x, y, INTVAL (size), align, 0);
else if (emit_block_move_via_movmem (x, y, size, align,
expected_align, expected_size,
@@ -2489,9 +2459,11 @@ can_store_by_pieces (unsigned HOST_WIDE_INT len,
if (len == 0)
return 1;
- if (! (memsetp
- ? SET_BY_PIECES_P (len, align)
- : STORE_BY_PIECES_P (len, align)))
+ if (!targetm.use_by_pieces_infrastructure_p (len, align,
+ memsetp
+ ? SET_BY_PIECES
+ : STORE_BY_PIECES,
+ optimize_insn_for_speed_p ()))
return 0;
align = alignment_for_piecewise_move (STORE_MAX_PIECES, align);
@@ -2567,9 +2539,13 @@ store_by_pieces (rtx to, unsigned HOST_WIDE_INT len,
return to;
}
- gcc_assert (memsetp
- ? SET_BY_PIECES_P (len, align)
- : STORE_BY_PIECES_P (len, align));
+ gcc_assert (targetm.use_by_pieces_infrastructure_p
+ (len, align,
+ memsetp
+ ? SET_BY_PIECES
+ : STORE_BY_PIECES,
+ optimize_insn_for_speed_p ()));
+
data.constfun = constfun;
data.constfundata = constfundata;
data.len = len;
@@ -2806,7 +2782,9 @@ clear_storage_hints (rtx object, rtx size, enum block_op_methods method,
align = MEM_ALIGN (object);
if (CONST_INT_P (size)
- && CLEAR_BY_PIECES_P (INTVAL (size), align))
+ && targetm.use_by_pieces_infrastructure_p (INTVAL (size), align,
+ CLEAR_BY_PIECES,
+ optimize_insn_for_speed_p ()))
clear_by_pieces (object, INTVAL (size), align);
else if (set_storage_via_setmem (object, size, const0_rtx, align,
expected_align, expected_size,
@@ -4215,7 +4193,7 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
&& CONST_INT_P (size)
&& skip == 0
&& MEM_ALIGN (xinner) >= align
- && (MOVE_BY_PIECES_P ((unsigned) INTVAL (size) - used, align))
+ && can_move_by_pieces ((unsigned) INTVAL (size) - used, align)
/* Here we avoid the case of a structure whose weak alignment
forces many pushes of a small amount of data,
and such small pushes do rounding that causes trouble. */
@@ -7836,7 +7814,7 @@ expand_constructor (tree exp, rtx target, enum expand_modifier modifier,
&& ! (target != 0 && safe_from_p (target, exp, 1)))
|| TREE_ADDRESSABLE (exp)
|| (tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
- && (! MOVE_BY_PIECES_P
+ && (! can_move_by_pieces
(tree_to_uhwi (TYPE_SIZE_UNIT (type)),
TYPE_ALIGN (type)))
&& ! mostly_zeros_p (exp))))