From 0ec3791cc4bd4c2a78dc7a4fb4de992797ec095e Mon Sep 17 00:00:00 2001 From: jgreenhalgh Date: Sat, 1 Nov 2014 08:13:09 +0000 Subject: [Patch 1/7] Hookize *_BY_PIECES_P gcc/ * target.def (use_by_pieces_infrastructure_p): New. * doc/tm.texi.in (MOVE_BY_PIECES_P): Describe that this macro is deprecated. (STORE_BY_PIECES_P): Likewise. (CLEAR_BY_PIECES_P): Likewise. (SET_BY_PIECES_P): Likewise. (TARGET_MOVE_BY_PIECES_PROFITABLE_P): Add hook. * doc/tm.texi: Regenerate. * expr.c (MOVE_BY_PIECES_P): Rewrite in terms of TARGET_USE_BY_PIECES_INFRASTRUCTURE_P. (STORE_BY_PIECES_P): Likewise. (CLEAR_BY_PIECES_P): Likewise. (SET_BY_PIECES_P): Likewise. (STORE_MAX_PIECES): Move to... * defaults.h (STORE_MAX_PIECES): ...here. * targhooks.c (get_move_ratio): New. (default_use_by_pieces_infrastructure_p): Likewise. * targhooks.h (default_use_by_pieces_infrastructure_p): New. * target.h (by_pieces_operation): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216996 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/expr.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'gcc/expr.c') diff --git a/gcc/expr.c b/gcc/expr.c index 9b81e628cb0..ef851777c47 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -171,32 +171,32 @@ static void write_complex_part (rtx, rtx, bool); to perform a structure copy. */ #ifndef MOVE_BY_PIECES_P #define MOVE_BY_PIECES_P(SIZE, ALIGN) \ - (move_by_pieces_ninsns (SIZE, ALIGN, MOVE_MAX_PIECES + 1) \ - < (unsigned int) MOVE_RATIO (optimize_insn_for_speed_p ())) + (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) \ - (move_by_pieces_ninsns (SIZE, ALIGN, STORE_MAX_PIECES + 1) \ - < (unsigned int) CLEAR_RATIO (optimize_insn_for_speed_p ())) + (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) \ - (move_by_pieces_ninsns (SIZE, ALIGN, STORE_MAX_PIECES + 1) \ - < (unsigned int) SET_RATIO (optimize_insn_for_speed_p ())) + (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) \ - (move_by_pieces_ninsns (SIZE, ALIGN, STORE_MAX_PIECES + 1) \ - < (unsigned int) MOVE_RATIO (optimize_insn_for_speed_p ())) + (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 @@ -827,13 +827,6 @@ widest_int_mode_for_size (unsigned int size) return mode; } -/* STORE_MAX_PIECES is the number of bytes at a time that we can - store efficiently. Due to internal GCC limitations, this is - MOVE_MAX_PIECES limited by the number of bytes GCC can represent - for an immediate constant. */ - -#define STORE_MAX_PIECES MIN (MOVE_MAX_PIECES, 2 * sizeof (HOST_WIDE_INT)) - /* Determine whether the LEN bytes can be moved by using several move instructions. Return nonzero if a call to move_by_pieces should succeed. */ -- cgit v1.2.1