From patchwork Tue Sep 9 16:21:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 387395 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1196C1400E6 for ; Wed, 10 Sep 2014 02:21:33 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; q=dns; s=default; b=P/9HDk92LgV1KO6b roUqAfzFQdgh3E9nHeIiaAj+BlTaotM60GnvWMGrF3A6H/A9oLiT0h8BJy+9IyAd tR1jmEbm/sUa3WzmiTzhF8eaRJwR0M56aWUN3TlxDU7tB4QIr7jnpiEK+HkQmNn5 AAdLkXXdiuzz9n0hePVuKYScZ7M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; s=default; bh=+oHy1IdflQ3SyoqDUhV+nj PA39I=; b=R4dbHjza6mNycarV+CcM+j1VvJEn6l5qqCDD/dXUF9u5qsfmWx56Ah NIsFQUjhdtrHFvKSMSn7VsnKR2C13YzR5ne9tU7tuIOMjuXW93Y36595vJHwYoo8 HnB6RDEDgE4DKk7b1vLpgKx3oyhUDsSTOM7k+qW/LlefJqvoIVzqs= Received: (qmail 29355 invoked by alias); 9 Sep 2014 16:21:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29341 invoked by uid 89); 9 Sep 2014 16:21:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e39.co.us.ibm.com Received: from e39.co.us.ibm.com (HELO e39.co.us.ibm.com) (32.97.110.160) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 09 Sep 2014 16:21:24 +0000 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Sep 2014 10:21:21 -0600 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 9 Sep 2014 10:21:17 -0600 Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 30BC338C8051 for ; Tue, 9 Sep 2014 12:21:17 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s89GLGQG55640140 for ; Tue, 9 Sep 2014 16:21:16 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s89GLGGm001210 for ; Tue, 9 Sep 2014 12:21:16 -0400 Received: from [9.50.20.53] ([9.50.20.53]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s89GLFUU001053; Tue, 9 Sep 2014 12:21:15 -0400 Message-ID: <1410279681.3163.122.camel@gnopaine> Subject: [PATCH, rs6000] Disable analyze_swaps for UNSPEC_VSX_CVDPSPN From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com Date: Tue, 09 Sep 2014 11:21:21 -0500 Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14090916-9332-0000-0000-000001F35A7F X-IsSubscribed: yes 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 * 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 * 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 void abort(); -typedef struct xx {vector double l; vector double h;} xx; - #define N 4096 #define M 10000000 vector float ca[N][4] = {0};