+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>
* hwint.h (least_bit_hwi, pow2_or_zerop, pow2p_hwi, ctz_or_zero):
handling. */
if (GET_CODE (XEXP (op, 0)) == CONST_INT)
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)))
/* This catches V2DF and V2DI splat, at a minimum. */
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)
/* If the duplicated item is from a select, defer to the select
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>
PR c++/77482
--- /dev/null
+/* { 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];
+}