rs6000.c (expand_block_clear): Add TARGET_SPE cases to set eight bytes at a time.

gcc/
	* config/rs6000/rs6000.c (expand_block_clear): Add TARGET_SPE
	cases to set eight bytes at a time.
	(expand_block_move): Likewise.

gcc/testsuite/
	* gcc.target/powerpc/spe-vector-memset.c: New testcase.
	* gcc.target/powerpc/spe-vector-memcpy.c: New testcase.

From-SVN: r127670
This commit is contained in:
Nathan Froyd 2007-08-21 17:22:46 +00:00 committed by Nathan Froyd
parent d6b3c79757
commit 21d818ff36
5 changed files with 50 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2007-08-21 Nathan Froyd <froydnj@codesourcery.com>
* config/rs6000/rs6000.c (expand_block_clear): Add TARGET_SPE
cases to set eight bytes at a time.
(expand_block_move): Likewise.
2007-08-21 Jakub Jelinek <jakub@redhat.com>
PR debug/32610

View file

@ -9852,6 +9852,8 @@ expand_block_clear (rtx operands[])
clear_step = 16;
else if (TARGET_POWERPC64 && align >= 32)
clear_step = 8;
else if (TARGET_SPE && align >= 64)
clear_step = 8;
else
clear_step = 4;
@ -9870,10 +9872,15 @@ expand_block_clear (rtx operands[])
clear_bytes = 16;
mode = V4SImode;
}
else if (bytes >= 8 && TARGET_SPE && align >= 64)
{
clear_bytes = 8;
mode = V2SImode;
}
else if (bytes >= 8 && TARGET_POWERPC64
/* 64-bit loads and stores require word-aligned
displacements. */
&& (align >= 64 || (!STRICT_ALIGNMENT && align >= 32)))
/* 64-bit loads and stores require word-aligned
displacements. */
&& (align >= 64 || (!STRICT_ALIGNMENT && align >= 32)))
{
clear_bytes = 8;
mode = DImode;
@ -9963,6 +9970,12 @@ expand_block_move (rtx operands[])
mode = V4SImode;
gen_func.mov = gen_movv4si;
}
else if (TARGET_SPE && bytes >= 8 && align >= 64)
{
move_bytes = 8;
mode = V2SImode;
gen_func.mov = gen_movv2si;
}
else if (TARGET_STRING
&& bytes > 24 /* move up to 32 bytes at a time */
&& ! fixed_regs[5]

View file

@ -1,3 +1,8 @@
2007-08-21 Nathan Froyd <froydnj@codesourcery.com>
* gcc.target/powerpc/spe-vector-memset.c: New testcase.
* gcc.target/powerpc/spe-vector-memcpy.c: New testcase.
2007-08-21 Jakub Jelinek <jakub@redhat.com>
PR debug/32610

View file

@ -0,0 +1,10 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_spe } */
/* { dg-options "-O -mspe=yes" } */
/* { dg-final { scan-assembler "evstdd" } } */
void foo(void)
{
int x[8] __attribute__((aligned(64))) = { 1, 1, 1, 1, 1, 1, 1, 1 };
bar (x);
}

View file

@ -0,0 +1,13 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_spe } */
/* { dg-options "-O -mspe=yes" } */
/* { dg-final { scan-assembler "evstdd" } } */
#include <string.h>
void foo(void)
{
int x[8] __attribute__((aligned(64)));
memset (x, 0, sizeof (x));
bar (x);
}