This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, rs6000] Disable analyze_swaps for UNSPEC_VSX_CVDPSPN
- From: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dje dot gcc at gmail dot com
- Date: Tue, 09 Sep 2014 11:21:21 -0500
- Subject: [PATCH, rs6000] Disable analyze_swaps for UNSPEC_VSX_CVDPSPN
- Authentication-results: sourceware.org; auth=none
Hi,
When collecting my list of invalid UNSPECs for the analyze_swaps pass, I
missed UNSPEC_VSX_CVDPSPN (which looked too much like
UNSPEC_VSX_CVSPDPN). This patch adds it to the list. I have an idea
for allowing it to be used, but won't have time to work on it now, so I
added some commentary to document it.
This causes the swaps-p8-15.c test to no longer be optimized, so I've
removed the optimization check there for now, with a comment on
reinstating it later. (I also removed an unused typedef that I happened
to notice while I was in there.)
Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no
regressions. Ok for trunk?
Thanks,
Bill
[gcc]
2014-09-09 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000.c (rtx_is_swappable_p): Add
UNSPEC_VSX_CVDPSPN as an unswappable operand, and add commentary
on how to make it legal in future.
[gcc/testsuite]
2014-09-09 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/swaps-p8-15.c: Remove scan-assembler-not for
xxpermdi and add commentary about adding it back later; remove
unused typedef.
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 215076)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -33761,8 +33761,6 @@ rtx_is_swappable_p (rtx op, unsigned int *special)
case UNSPEC_VSUMSWS:
case UNSPEC_VSUMSWS_DIRECT:
case UNSPEC_VSX_CONCAT:
- case UNSPEC_VSX_CVSPDP:
- case UNSPEC_VSX_CVSPDPN:
case UNSPEC_VSX_SET:
case UNSPEC_VSX_SLDWI:
case UNSPEC_VUNPACK_HI_SIGN:
@@ -33775,6 +33773,15 @@ rtx_is_swappable_p (rtx op, unsigned int *special)
case UNSPEC_VUPKLPX:
case UNSPEC_VUPKLS_V4SF:
case UNSPEC_VUPKLU_V4SF:
+ /* The following could be handled as an idiom with XXSPLTW.
+ These place a scalar in BE element zero, but the XXSPLTW
+ will currently expect it in BE element 2 in a swapped
+ region. When one of these feeds an XXSPLTW with no other
+ defs/uses either way, we can avoid the lane change for
+ XXSPLTW and things will be correct. TBD. */
+ case UNSPEC_VSX_CVDPSPN:
+ case UNSPEC_VSX_CVSPDP:
+ case UNSPEC_VSX_CVSPDPN:
return 0;
case UNSPEC_VSPLT_DIRECT:
*special = SH_SPLAT;
Index: gcc/testsuite/gcc.target/powerpc/swaps-p8-15.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/swaps-p8-15.c (revision 215076)
+++ gcc/testsuite/gcc.target/powerpc/swaps-p8-15.c (working copy)
@@ -3,13 +3,14 @@
/* { dg-final { scan-assembler "lxvd2x" } } */
/* { dg-final { scan-assembler "stxvd2x" } } */
/* { dg-final { scan-assembler "xxspltw" } } */
-/* { dg-final { scan-assembler-not "xxpermdi" } } */
+/* Currently the analyze_swaps phase cannot optimize this loop because
+ of the presence of an UNSPEC_VSX_CVDPSPN. At such time as this is
+ handled, we need to add a 'scan-assembler-not "xxpermdi"' directive to
+ this test. */
#include <altivec.h>
void abort();
-typedef struct xx {vector double l; vector double h;} xx;
-
#define N 4096
#define M 10000000
vector float ca[N][4] = {0};