+2014-11-01 James Greenhalgh <james.greenhalgh@arm.com>
+
+ * 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.
+
2014-11-01 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64.c
If you don't define this, a reasonable default is used.
@end defmac
-@defmac MOVE_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{move_by_pieces} will be used to
-copy a chunk of memory, or whether some other block move mechanism
-will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{MOVE_RATIO}.
-
-This macro is deprecated. New ports should implement
-@code{TARGET_USE_BY_PIECES_INFRASTRUCTURE_P} instead.
-@end defmac
-
@deftypefn {Target Hook} bool TARGET_USE_BY_PIECES_INFRASTRUCTURE_P (unsigned int @var{size}, unsigned int @var{alignment}, enum by_pieces_operation @var{op}, bool @var{speed_p})
GCC will attempt several strategies when asked to copy between
two areas of memory, or to set, clear or store to memory, for example
If you don't define this, a reasonable default is used.
@end defmac
-@defmac CLEAR_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{clear_by_pieces} will be used
-to clear a chunk of memory, or whether some other block clear mechanism
-will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{CLEAR_RATIO}.
-
-This macro is deprecated. New ports should implement
-@code{TARGET_USE_BY_PIECES_INFRASTRUCTURE_P} instead.
-@end defmac
-
@defmac SET_RATIO (@var{speed})
The threshold of number of scalar move insns, @emph{below} which a sequence
of insns should be generated to set memory to a constant value, instead of
If you don't define this, it defaults to the value of @code{MOVE_RATIO}.
@end defmac
-@defmac SET_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{store_by_pieces} will be
-used to set a chunk of memory to a constant value, or whether some
-other mechanism will be used. Used by @code{__builtin_memset} when
-storing values other than constant zero.
-Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{SET_RATIO}.
-
-This macro is deprecated. New ports should implement
-@code{TARGET_USE_BY_PIECES_INFRASTRUCTURE_P} instead.
-@end defmac
-
-@defmac STORE_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{store_by_pieces} will be
-used to set a chunk of memory to a constant string value, or whether some
-other mechanism will be used. Used by @code{__builtin_strcpy} when
-called with a constant source string.
-Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{MOVE_RATIO}.
-
-This macro is deprecated. New ports should implement
-@code{TARGET_USE_BY_PIECES_INFRASTRUCTURE_P} instead.
-@end defmac
-
@defmac USE_LOAD_POST_INCREMENT (@var{mode})
A C expression used to determine whether a load postincrement is a good
thing to use for a given mode. Defaults to the value of
If you don't define this, a reasonable default is used.
@end defmac
-@defmac MOVE_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{move_by_pieces} will be used to
-copy a chunk of memory, or whether some other block move mechanism
-will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{MOVE_RATIO}.
-
-This macro is deprecated. New ports should implement
-@code{TARGET_USE_BY_PIECES_INFRASTRUCTURE_P} instead.
-@end defmac
-
@hook TARGET_USE_BY_PIECES_INFRASTRUCTURE_P
@defmac MOVE_MAX_PIECES
If you don't define this, a reasonable default is used.
@end defmac
-@defmac CLEAR_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{clear_by_pieces} will be used
-to clear a chunk of memory, or whether some other block clear mechanism
-will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{CLEAR_RATIO}.
-
-This macro is deprecated. New ports should implement
-@code{TARGET_USE_BY_PIECES_INFRASTRUCTURE_P} instead.
-@end defmac
-
@defmac SET_RATIO (@var{speed})
The threshold of number of scalar move insns, @emph{below} which a sequence
of insns should be generated to set memory to a constant value, instead of
If you don't define this, it defaults to the value of @code{MOVE_RATIO}.
@end defmac
-@defmac SET_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{store_by_pieces} will be
-used to set a chunk of memory to a constant value, or whether some
-other mechanism will be used. Used by @code{__builtin_memset} when
-storing values other than constant zero.
-Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{SET_RATIO}.
-
-This macro is deprecated. New ports should implement
-@code{TARGET_USE_BY_PIECES_INFRASTRUCTURE_P} instead.
-@end defmac
-
-@defmac STORE_BY_PIECES_P (@var{size}, @var{alignment})
-A C expression used to determine whether @code{store_by_pieces} will be
-used to set a chunk of memory to a constant string value, or whether some
-other mechanism will be used. Used by @code{__builtin_strcpy} when
-called with a constant source string.
-Defaults to 1 if @code{move_by_pieces_ninsns} returns less
-than @code{MOVE_RATIO}.
-
-This macro is deprecated. New ports should implement
-@code{TARGET_USE_BY_PIECES_INFRASTRUCTURE_P} instead.
-@end defmac
-
@defmac USE_LOAD_POST_INCREMENT (@var{mode})
A C expression used to determine whether a load postincrement is a good
thing to use for a given mode. Defaults to the value of
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
\f
/* This is run to set up which modes can be used
directly in memory and to initialize the block move optab. It is run
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
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,
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);
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;
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,
&& 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. */
&& ! (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))))
HOT_TEXT_SECTION_NAME LEGITIMATE_CONSTANT_P ALWAYS_STRIP_DOTDOT \
OUTPUT_ADDR_CONST_EXTRA SMALL_REGISTER_CLASSES ASM_OUTPUT_IDENT \
ASM_BYTE_OP MEMBER_TYPE_FORCES_BLK LIBGCC2_HAS_SF_MODE \
- LIBGCC2_HAS_DF_MODE LIBGCC2_HAS_XF_MODE LIBGCC2_HAS_TF_MODE
+ LIBGCC2_HAS_DF_MODE LIBGCC2_HAS_XF_MODE LIBGCC2_HAS_TF_MODE \
+ CLEAR_BY_PIECES_P MOVE_BY_PIECES_P SET_BY_PIECES_P \
+ STORE_BY_PIECES_P
/* Target macros only used for code built for the target, that have
moved to libgcc-tm.h or have never been present elsewhere. */