mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-15 16:24:09 +08:00
[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
This commit is contained in:
parent
d3006da6f1
commit
a5474c4cb0
@ -1,3 +1,25 @@
|
|||||||
|
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>
|
2014-11-01 James Greenhalgh <james.greenhalgh@arm.com>
|
||||||
|
|
||||||
* config/aarch64/aarch64.c
|
* config/aarch64/aarch64.c
|
||||||
|
@ -6123,16 +6123,6 @@ optimized for speed rather than size.
|
|||||||
If you don't define this, a reasonable default is used.
|
If you don't define this, a reasonable default is used.
|
||||||
@end defmac
|
@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})
|
@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
|
GCC will attempt several strategies when asked to copy between
|
||||||
two areas of memory, or to set, clear or store to memory, for example
|
two areas of memory, or to set, clear or store to memory, for example
|
||||||
@ -6184,16 +6174,6 @@ optimized for speed rather than size.
|
|||||||
If you don't define this, a reasonable default is used.
|
If you don't define this, a reasonable default is used.
|
||||||
@end defmac
|
@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})
|
@defmac SET_RATIO (@var{speed})
|
||||||
The threshold of number of scalar move insns, @emph{below} which a sequence
|
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
|
of insns should be generated to set memory to a constant value, instead of
|
||||||
@ -6207,30 +6187,6 @@ optimized for speed rather than size.
|
|||||||
If you don't define this, it defaults to the value of @code{MOVE_RATIO}.
|
If you don't define this, it defaults to the value of @code{MOVE_RATIO}.
|
||||||
@end defmac
|
@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})
|
@defmac USE_LOAD_POST_INCREMENT (@var{mode})
|
||||||
A C expression used to determine whether a load postincrement is a good
|
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
|
thing to use for a given mode. Defaults to the value of
|
||||||
|
@ -4600,16 +4600,6 @@ optimized for speed rather than size.
|
|||||||
If you don't define this, a reasonable default is used.
|
If you don't define this, a reasonable default is used.
|
||||||
@end defmac
|
@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
|
@hook TARGET_USE_BY_PIECES_INFRASTRUCTURE_P
|
||||||
|
|
||||||
@defmac MOVE_MAX_PIECES
|
@defmac MOVE_MAX_PIECES
|
||||||
@ -4629,16 +4619,6 @@ optimized for speed rather than size.
|
|||||||
If you don't define this, a reasonable default is used.
|
If you don't define this, a reasonable default is used.
|
||||||
@end defmac
|
@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})
|
@defmac SET_RATIO (@var{speed})
|
||||||
The threshold of number of scalar move insns, @emph{below} which a sequence
|
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
|
of insns should be generated to set memory to a constant value, instead of
|
||||||
@ -4652,30 +4632,6 @@ optimized for speed rather than size.
|
|||||||
If you don't define this, it defaults to the value of @code{MOVE_RATIO}.
|
If you don't define this, it defaults to the value of @code{MOVE_RATIO}.
|
||||||
@end defmac
|
@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})
|
@defmac USE_LOAD_POST_INCREMENT (@var{mode})
|
||||||
A C expression used to determine whether a load postincrement is a good
|
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
|
thing to use for a given mode. Defaults to the value of
|
||||||
|
66
gcc/expr.c
66
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 rtx const_vector_from_tree (tree);
|
||||||
static void write_complex_part (rtx, rtx, bool);
|
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
|
/* This is run to set up which modes can be used
|
||||||
directly in memory and to initialize the block move optab. It is run
|
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. */
|
succeed. */
|
||||||
|
|
||||||
int
|
int
|
||||||
can_move_by_pieces (unsigned HOST_WIDE_INT len ATTRIBUTE_UNUSED,
|
can_move_by_pieces (unsigned HOST_WIDE_INT len,
|
||||||
unsigned int align ATTRIBUTE_UNUSED)
|
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
|
/* 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));
|
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);
|
move_by_pieces (x, y, INTVAL (size), align, 0);
|
||||||
else if (emit_block_move_via_movmem (x, y, size, align,
|
else if (emit_block_move_via_movmem (x, y, size, align,
|
||||||
expected_align, expected_size,
|
expected_align, expected_size,
|
||||||
@ -2489,9 +2459,11 @@ can_store_by_pieces (unsigned HOST_WIDE_INT len,
|
|||||||
if (len == 0)
|
if (len == 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (! (memsetp
|
if (!targetm.use_by_pieces_infrastructure_p (len, align,
|
||||||
? SET_BY_PIECES_P (len, align)
|
memsetp
|
||||||
: STORE_BY_PIECES_P (len, align)))
|
? SET_BY_PIECES
|
||||||
|
: STORE_BY_PIECES,
|
||||||
|
optimize_insn_for_speed_p ()))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
align = alignment_for_piecewise_move (STORE_MAX_PIECES, align);
|
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;
|
return to;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_assert (memsetp
|
gcc_assert (targetm.use_by_pieces_infrastructure_p
|
||||||
? SET_BY_PIECES_P (len, align)
|
(len, align,
|
||||||
: STORE_BY_PIECES_P (len, align));
|
memsetp
|
||||||
|
? SET_BY_PIECES
|
||||||
|
: STORE_BY_PIECES,
|
||||||
|
optimize_insn_for_speed_p ()));
|
||||||
|
|
||||||
data.constfun = constfun;
|
data.constfun = constfun;
|
||||||
data.constfundata = constfundata;
|
data.constfundata = constfundata;
|
||||||
data.len = len;
|
data.len = len;
|
||||||
@ -2806,7 +2782,9 @@ clear_storage_hints (rtx object, rtx size, enum block_op_methods method,
|
|||||||
align = MEM_ALIGN (object);
|
align = MEM_ALIGN (object);
|
||||||
|
|
||||||
if (CONST_INT_P (size)
|
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);
|
clear_by_pieces (object, INTVAL (size), align);
|
||||||
else if (set_storage_via_setmem (object, size, const0_rtx, align,
|
else if (set_storage_via_setmem (object, size, const0_rtx, align,
|
||||||
expected_align, expected_size,
|
expected_align, expected_size,
|
||||||
@ -4215,7 +4193,7 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
|
|||||||
&& CONST_INT_P (size)
|
&& CONST_INT_P (size)
|
||||||
&& skip == 0
|
&& skip == 0
|
||||||
&& MEM_ALIGN (xinner) >= align
|
&& 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
|
/* Here we avoid the case of a structure whose weak alignment
|
||||||
forces many pushes of a small amount of data,
|
forces many pushes of a small amount of data,
|
||||||
and such small pushes do rounding that causes trouble. */
|
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)))
|
&& ! (target != 0 && safe_from_p (target, exp, 1)))
|
||||||
|| TREE_ADDRESSABLE (exp)
|
|| TREE_ADDRESSABLE (exp)
|
||||||
|| (tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
|
|| (tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
|
||||||
&& (! MOVE_BY_PIECES_P
|
&& (! can_move_by_pieces
|
||||||
(tree_to_uhwi (TYPE_SIZE_UNIT (type)),
|
(tree_to_uhwi (TYPE_SIZE_UNIT (type)),
|
||||||
TYPE_ALIGN (type)))
|
TYPE_ALIGN (type)))
|
||||||
&& ! mostly_zeros_p (exp))))
|
&& ! mostly_zeros_p (exp))))
|
||||||
|
@ -847,7 +847,9 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
|
|||||||
HOT_TEXT_SECTION_NAME LEGITIMATE_CONSTANT_P ALWAYS_STRIP_DOTDOT \
|
HOT_TEXT_SECTION_NAME LEGITIMATE_CONSTANT_P ALWAYS_STRIP_DOTDOT \
|
||||||
OUTPUT_ADDR_CONST_EXTRA SMALL_REGISTER_CLASSES ASM_OUTPUT_IDENT \
|
OUTPUT_ADDR_CONST_EXTRA SMALL_REGISTER_CLASSES ASM_OUTPUT_IDENT \
|
||||||
ASM_BYTE_OP MEMBER_TYPE_FORCES_BLK LIBGCC2_HAS_SF_MODE \
|
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
|
/* Target macros only used for code built for the target, that have
|
||||||
moved to libgcc-tm.h or have never been present elsewhere. */
|
moved to libgcc-tm.h or have never been present elsewhere. */
|
||||||
|
Loading…
Reference in New Issue
Block a user