From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53825 invoked by alias); 3 Sep 2015 15:52:06 -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 53732 invoked by uid 89); 3 Sep 2015 15:52:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e34.co.us.ibm.com Received: from e34.co.us.ibm.com (HELO e34.co.us.ibm.com) (32.97.110.152) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 03 Sep 2015 15:52:03 +0000 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Sep 2015 09:52:01 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 3 Sep 2015 09:51:58 -0600 X-MailFrom: wschmidt@linux.vnet.ibm.com X-RcptTo: gcc-patches@gcc.gnu.org Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 93C7219D803F for ; Thu, 3 Sep 2015 09:42:52 -0600 (MDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t83FpBJP46661692 for ; Thu, 3 Sep 2015 08:51:11 -0700 Received: from d03av03.boulder.ibm.com (localhost [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t83Fpvfp016401 for ; Thu, 3 Sep 2015 09:51:57 -0600 Received: from [9.65.82.154] (sig-9-65-82-154.ibm.com [9.65.82.154]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t83FptFG016168; Thu, 3 Sep 2015 09:51:56 -0600 Message-ID: <1441295514.2744.15.camel@gnopaine> Subject: Re: [PATCH, rs6000] Use hardware support for vector character multiply From: Bill Schmidt To: David Edelsohn Cc: GCC Patches Date: Thu, 03 Sep 2015 15:53:00 -0000 In-Reply-To: References: <1441293644.2744.10.camel@gnopaine> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15090315-0017-0000-0000-00000D92E77D X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00280.txt.bz2 On Thu, 2015-09-03 at 11:36 -0400, David Edelsohn wrote: > On Thu, Sep 3, 2015 at 11:20 AM, Bill Schmidt > wrote: > > Hi, > > > > It was pointed out to me recently that multiplying two vector chars is > > performed using scalarization, even though we have hardware support for > > byte multiplies in vectors. This patch adds an expansion for mulv16qi3 > > to correct this. > > > > The expansion is pretty simple. We do a multiply-even and multiply-odd > > to create halfword results, and then use a permute to extract the > > low-order bytes of each result. This particular form of a permute uses > > a different set of input/output vector modes than have been used before, > > so I added the altivec_vperm_v8hiv16qi insn to represent this. (The two > > source operands are vector halfword types, while the target operand is a > > vector char type.) > > > > I've added two test variants, one to test the code generation, and one > > executable test to check correctness. One other test failed with this > > change. This turned out to be because PowerPC was excluded from the > > check_effective_target_vect_char_mult target support test. I resolved > > this by adding check_effective_target_powerpc_altivec to that test. > > > > Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no > > regressions. Is this ok for trunk? > > > > Thanks, > > Bill > > > > > > [gcc] > > > > 2015-09-03 Bill Schmidt > > > > * config/rs6000/altivec.md (altivec_vperm_v8hiv16qi): New > > define_insn. > > (mulv16qi3): New define_expand. > > > > [gcc/testsuite] > > > > 2015-09-03 Bill Schmidt > > > > * gcc.target/powerpc/vec-mult-char-1.c: New test. > > * gcc.target/powerpc/vec-mult-char-2.c: New test. > > This is okay. > > The "bool be = BYTES_BIG_ENDIAN" and use of "be" is not a common style in GCC. OK. I thought that helped with readability, but I will revise this to use BYTES_BIG_ENDIAN directly in the expressions. Thanks, Bill > > Thanks, David >