This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PowerPC string instructions for -Os
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 02 Nov 2002 17:03:25 -0500
- Subject: [PATCH] PowerPC string instructions for -Os
This patch enables string instructions when optimizing for size on
big-endian targets. String instructions always are more compact. This
also provides better testing coverage for string instructions to avoid the
type of failure on the GCC 3.2 branch. This patch does expose two new
regressions, but those were hiding before:
/gcc/dje/src/gcc/testsuite/gcc.c-torture/compile/simd-4.c: In function `tempf':
/gcc/dje/src/gcc/testsuite/gcc.c-torture/compile/simd-4.c:15: error: unrecognizable insn:
(insn:HI 31 27 32 0 30038b00 (set (reg:TI 131)
(subreg:TI (reg/v:V4SF 120) 0)) -1 (insn_list 17 (nil))
(expr_list:REG_DEAD (reg/v:V4SF 120)
(nil)))
/gcc/dje/src/gcc/testsuite/gcc.c-torture/execute/simd-2.c: In function `main':
/gcc/dje/src/gcc/testsuite/gcc.c-torture/execute/simd-2.c:72: error: unrecognizable insn:
(insn:HI 32 30 33 0 0 (set (reg:TI 133)
(subreg:TI (reg:V8HI 122) 0)) -1 (insn_list 21 (nil))
(nil))
David
* config/rs6000/rs6000.c (rs6000_override_options): Use string
instructions when optimizing for size.
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.396
diff -c -p -r1.396 rs6000.c
*** rs6000.c 23 Oct 2002 15:20:37 -0000 1.396
--- rs6000.c 2 Nov 2002 21:53:37 -0000
*************** rs6000_override_options (default_cpu)
*** 561,567 ****
/* If we are optimizing big endian systems for space, use the store
multiple instructions. */
if (BYTES_BIG_ENDIAN && optimize_size)
! target_flags |= MASK_MULTIPLE;
/* If -mmultiple or -mno-multiple was explicitly used, don't
override with the processor default */
--- 561,567 ----
/* If we are optimizing big endian systems for space, use the store
multiple instructions. */
if (BYTES_BIG_ENDIAN && optimize_size)
! target_flags |= MASK_MULTIPLE | MASK_STRING;
/* If -mmultiple or -mno-multiple was explicitly used, don't
override with the processor default */