From patchwork Tue Nov 5 00:33:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 288343 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2E7452C0092 for ; Tue, 5 Nov 2013 11:34:16 +1100 (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:in-reply-to:references :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=aZpnLpWZV38z7GPY/LcRoFpfRBmQkLZfyzW5xoSG3iaqybel1Xm4F hwW1tiEz8I9YXZ6wLH+J0R62YCDKXNL6N3Kn385wW5TGR8+Hc958QHpxGjqIZHSE /gEztZ0MVzI5wwA1qAmCnof5L8zLk9Q1K4RQXHHoDVrHM45TWMm7rc= 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:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s=default; bh=RHui7a51EF28Mn1aku2xaC+GCBE=; b=M/XejwS3v477zIEYxcDBgm2q+4Ct bj7/+pn79kImR1HARZBk/QGu3dE7DToi91qOUf6kzQfAeSZ9SqvxcDPJ03yOHO2y HCaQwV3APK/qNuM3zvM7qfZxPebxGzk8VkmeaejP5GyorkjPkrdywqDT94+74+Xa oFLQEOaC8lmIqFk= Received: (qmail 29364 invoked by alias); 5 Nov 2013 00:34:07 -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 29351 invoked by uid 89); 5 Nov 2013 00:34:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_50, RDNS_NONE, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: eggs.gnu.org Received: from Unknown (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 05 Nov 2013 00:34:04 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdUaY-0007pM-9r for gcc-patches@gcc.gnu.org; Mon, 04 Nov 2013 19:33:56 -0500 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:33601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdUaX-0007p4-I4 for gcc-patches@gcc.gnu.org; Mon, 04 Nov 2013 19:33:46 -0500 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Nov 2013 10:33:23 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp04.au.ibm.com (202.81.31.210) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 5 Nov 2013 10:33:22 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id F26612CE8051 for ; Tue, 5 Nov 2013 11:33:21 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rA50Fq5T61276172 for ; Tue, 5 Nov 2013 11:15:53 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rA50XL0i007247 for ; Tue, 5 Nov 2013 11:33:21 +1100 Received: from [9.65.200.189] (sig-9-65-200-189.mts.ibm.com [9.65.200.189]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rA50XIXQ007188; Tue, 5 Nov 2013 11:33:19 +1100 Message-ID: <1383611631.6275.335.camel@gnopaine> Subject: Re: [PATCH, rs6000] (3/3) Fix mulv4si3 and mulv8hi3 patterns for little endian From: Bill Schmidt To: Richard Sandiford Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Date: Mon, 04 Nov 2013 18:33:51 -0600 In-Reply-To: <1383582573.6275.322.camel@gnopaine> References: <1383543684.6275.312.camel@gnopaine> <874n7sjhh5.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com> <1383582573.6275.322.camel@gnopaine> Mime-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13110500-9264-0000-0000-000004DE8A10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.146 X-IsSubscribed: yes Hi, Here's a revised version of this patch according to Richard's suggestions. It differs from the previous version only in the method used to ensure vmulouh is generated; we now call the new gen_altivec_vmulouh to accomplish this. Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no regressions. Is this ok for trunk? Thanks, Bill 2013-11-04 Bill Schmidt * config/rs6000/altivec.md (mulv4si3): Ensure we generate vmulouh for both big and little endian. (mulv8hi3): Swap input operands for merge high and merge low instructions for little endian. Index: gcc/config/rs6000/altivec.md =================================================================== --- gcc/config/rs6000/altivec.md (revision 204350) +++ gcc/config/rs6000/altivec.md (working copy) @@ -651,7 +651,7 @@ convert_move (small_swap, swap, 0); low_product = gen_reg_rtx (V4SImode); - emit_insn (gen_vec_widen_umult_odd_v8hi (low_product, one, two)); + emit_insn (gen_altivec_vmulouh (low_product, one, two)); high_product = gen_reg_rtx (V4SImode); emit_insn (gen_altivec_vmsumuhm (high_product, one, small_swap, zero)); @@ -678,13 +678,18 @@ emit_insn (gen_vec_widen_smult_even_v8hi (even, operands[1], operands[2])); emit_insn (gen_vec_widen_smult_odd_v8hi (odd, operands[1], operands[2])); - emit_insn (gen_altivec_vmrghw (high, even, odd)); - emit_insn (gen_altivec_vmrglw (low, even, odd)); - if (BYTES_BIG_ENDIAN) - emit_insn (gen_altivec_vpkuwum (operands[0], high, low)); + { + emit_insn (gen_altivec_vmrghw (high, even, odd)); + emit_insn (gen_altivec_vmrglw (low, even, odd)); + emit_insn (gen_altivec_vpkuwum (operands[0], high, low)); + } else - emit_insn (gen_altivec_vpkuwum (operands[0], low, high)); + { + emit_insn (gen_altivec_vmrghw (high, odd, even)); + emit_insn (gen_altivec_vmrglw (low, odd, even)); + emit_insn (gen_altivec_vpkuwum (operands[0], low, high)); + } DONE; }")