Commit 9a42726b by Bill Schmidt Committed by William Schmidt

re PR target/77613 (Powerpc64le: redundant swaps in autovectorised loop)

[gcc]

2016-09-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/77613
	* config/rs6000/rs6000.c (rtx_is_swappable_p): Add support for
	splat with truncate.

[gcc/testsuite]

2016-09-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/77613
	* gcc.target/powerpc/swaps-p8-25.c: New.

From-SVN: r240199
parent 8f03e02f
2016-09-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/77613
* config/rs6000/rs6000.c (rtx_is_swappable_p): Add support for
splat with truncate.
2016-09-16 Jason Merrill <jason@redhat.com> 2016-09-16 Jason Merrill <jason@redhat.com>
* hwint.h (least_bit_hwi, pow2_or_zerop, pow2p_hwi, ctz_or_zero): * hwint.h (least_bit_hwi, pow2_or_zerop, pow2p_hwi, ctz_or_zero):
......
...@@ -39101,10 +39101,15 @@ rtx_is_swappable_p (rtx op, unsigned int *special) ...@@ -39101,10 +39101,15 @@ rtx_is_swappable_p (rtx op, unsigned int *special)
handling. */ handling. */
if (GET_CODE (XEXP (op, 0)) == CONST_INT) if (GET_CODE (XEXP (op, 0)) == CONST_INT)
return 1; return 1;
else if (GET_CODE (XEXP (op, 0)) == REG else if (REG_P (XEXP (op, 0))
&& GET_MODE_INNER (GET_MODE (op)) == GET_MODE (XEXP (op, 0))) && GET_MODE_INNER (GET_MODE (op)) == GET_MODE (XEXP (op, 0)))
/* This catches V2DF and V2DI splat, at a minimum. */ /* This catches V2DF and V2DI splat, at a minimum. */
return 1; return 1;
else if (GET_CODE (XEXP (op, 0)) == TRUNCATE
&& REG_P (XEXP (XEXP (op, 0), 0))
&& GET_MODE_INNER (GET_MODE (op)) == GET_MODE (XEXP (op, 0)))
/* This catches splat of a truncated value. */
return 1;
else if (GET_CODE (XEXP (op, 0)) == VEC_SELECT) else if (GET_CODE (XEXP (op, 0)) == VEC_SELECT)
/* If the duplicated item is from a select, defer to the select /* If the duplicated item is from a select, defer to the select
processing to see if we can change the lane for the splat. */ processing to see if we can change the lane for the splat. */
2016-09-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/77613
* gcc.target/powerpc/swaps-p8-25.c: New.
2016-09-16 Jakub Jelinek <jakub@redhat.com> 2016-09-16 Jakub Jelinek <jakub@redhat.com>
PR c++/77482 PR c++/77482
......
/* { dg-do compile { target { powerpc64le-*-* } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
/* { dg-options "-mcpu=power8 -O3 " } */
/* { dg-final { scan-assembler "lxvd2x" } } */
/* { dg-final { scan-assembler "stxvd2x" } } */
/* { dg-final { scan-assembler-not "xxpermdi" } } */
/* Verify that swap optimization works correctly for a truncating splat. */
/* Test case to resolve PR77613. */
void pr77613 (signed short a, signed short *x, signed short *y)
{
unsigned long i;
for (i = 0; i < 1024; i++)
y[i] = a * x[i] + y[i];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment