This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
S/390: Fix string-opt-17.c testsuite failure
- From: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 10 Sep 2002 20:54:04 +0200
- Subject: S/390: Fix string-opt-17.c testsuite failure
- Sensitivity:
Hello,
this patch fixes an incorrect definition of MOVE_MAX in s390.h, and also
defines MOVE_BY_PIECES_P and CLEAR_BY_PIECES_P to only use move_by_pieces
for 1-, 2-, 4-, and (on 64-bit) 8-byte moves. In all other cases, it is
more efficient to use our block move/clear insns.
Incidentally, this fixes the string-opt-17.c test case, which failed
on 64-bit because it tried to build a constant using a TImode
multiplication. Not only do we not support that, but even if we
would, I wouldn't consider replacing a 16-byte memset with a
__multi3 call to be an optimization ...
ChangeLog:
* config/s390/s390.h (MOVE_MAX): Define to correct value.
(MAX_MOVE_MAX): Define.
(MOVE_BY_PIECES_P): Define.
(CLEAR_BY_PIECES_P): Define.
Index: gcc/config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.41
diff -c -p -r1.41 s390.h
*** gcc/config/s390/s390.h 26 Aug 2002 18:18:19 -0000 1.41
--- gcc/config/s390/s390.h 10 Sep 2002 18:43:04 -0000
*************** CUMULATIVE_ARGS;
*** 1035,1044 ****
#define DEFAULT_SIGNED_CHAR 0
! /* Max number of bytes we can move from memory to memory in one
reasonably
! fast instruction. */
! #define MOVE_MAX 256
/* Nonzero if access to memory by bytes is slow and undesirable. */
--- 1035,1057 ----
#define DEFAULT_SIGNED_CHAR 0
! /* The maximum number of bytes that a single instruction can move quickly
! between memory and registers or between two memory locations. */
! #define MOVE_MAX (TARGET_64BIT ? 16 : 8)
! #define MAX_MOVE_MAX 16
!
! /* Determine whether to use move_by_pieces or block move insn. */
!
! #define MOVE_BY_PIECES_P(SIZE, ALIGN) \
! ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \
! || (TARGET_64BIT && (SIZE) == 8) )
!
! /* Determine whether to use clear_by_pieces or block clear insn. */
!
! #define CLEAR_BY_PIECES_P(SIZE, ALIGN) \
! ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \
! || (TARGET_64BIT && (SIZE) == 8) )
/* Nonzero if access to memory by bytes is slow and undesirable. */
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com