From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97827 invoked by alias); 31 Aug 2015 00:08:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 97811 invoked by uid 89); 31 Aug 2015 00:08:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f175.google.com Received: from mail-io0-f175.google.com (HELO mail-io0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 31 Aug 2015 00:08:11 +0000 Received: by iofe124 with SMTP id e124so76445856iof.1 for ; Sun, 30 Aug 2015 17:08:09 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.134.146 with SMTP id q18mr21703902ioi.31.1440979689106; Sun, 30 Aug 2015 17:08:09 -0700 (PDT) Received: by 10.36.133.5 with HTTP; Sun, 30 Aug 2015 17:08:09 -0700 (PDT) In-Reply-To: <1440976788.4682.15.camel@gnopaine> References: <1440976788.4682.15.camel@gnopaine> Date: Mon, 31 Aug 2015 00:23:00 -0000 Message-ID: Subject: Re: [PATCH, rs6000] Improve swap optimization to modify general xxpermdi patterns From: David Edelsohn To: Bill Schmidt Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-08/txt/msg01847.txt.bz2 On Sun, Aug 30, 2015 at 7:19 PM, Bill Schmidt wrote: > Hi, > > The VSX swap optimization currently misses opportunities to optimize > loops when expressions corresponding to xxpermdi instructions are > present (other than xxswapd instructions associated with loads and > stores). These occur commonly when interleaving vector double or vector > unsigned long operands, or when concatenating two doubles or unsigned > longs to make a V2DI or V2DF result. This patch adds logic to recognize > these insns and adjust them to account for swapped doublewords in the > computation. > > Both opportunities arise in a simple test case that performs a reduction > on complex multiplications, which I've added here. > > Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no > regressions. Is this ok for trunk? > > Thanks, > Bill > > > [gcc] > > 2015-08-30 Bill Schmidt > > * config/rs6000/rs6000.c (swap_web_entry): Enlarge > special_handling bitfield. > (special_handling_values): Add SH_XXPERMDI and SH_CONCAT. > (rtx_is_swappable_p): Add handling for vec_select/vec_concat > form > that represents a general xxpermdi. > (insn_is_swappable_p): Add handling for vec_concat of two > doublewords, which maps to a specific xxpermdi. > (adjust_xxpermdi): New function. > (adjust_concat): Likewise. > (handle_special_swappables): Call adjust_xxpermdi and > adjust_concat. > (dump_swap_insn_table): Handle SH_XXPERMDI and SH_CONCAT. > > [gcc/testsuite] > > 2015-08-30 Bill Schmidt > > * gcc.target/powerpc/swaps-p8-19.c: New test. Okay. Thanks, David