From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4327 invoked by alias); 4 Nov 2013 17:55:43 -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 4318 invoked by uid 89); 4 Nov 2013 17:55:42 -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: e23smtp08.au.ibm.com Received: from Unknown (HELO e23smtp08.au.ibm.com) (202.81.31.141) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 04 Nov 2013 17:55:41 +0000 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Nov 2013 03:55:28 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 5 Nov 2013 03:55:26 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id CDFA63578040 for ; Tue, 5 Nov 2013 04:55:25 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rA4Ht7LM8782234 for ; Tue, 5 Nov 2013 04:55:14 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rA4HtJ5q010367 for ; Tue, 5 Nov 2013 04:55:19 +1100 Received: from [9.65.200.189] (sig-9-65-200-189.mts.ibm.com [9.65.200.189]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rA4HtGKw010316; Tue, 5 Nov 2013 04:55:18 +1100 Message-ID: <1383587749.6275.323.camel@gnopaine> Subject: Re: [PATCH, rs6000] (2/3) Fix widening multiply high/low operations for little endian From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com Date: Mon, 04 Nov 2013 18:05:00 -0000 In-Reply-To: <1383543252.6275.305.camel@gnopaine> References: <1383543252.6275.305.camel@gnopaine> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13110417-5140-0000-0000-0000041B5F19 X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00258.txt.bz2 Per Richard S's suggestion, I'm reworking parts 1 and 3 of the patch set, but this one will remain unchanged and is ready for review. Thanks, Bill On Sun, 2013-11-03 at 23:34 -0600, Bill Schmidt wrote: > Hi, > > This patch fixes the widening multiply high/low operations to work > correctly in the presence of the first patch of this series, which > reverses the meanings of multiply even/odd instructions. Here we > reorder the input operands to the vector merge low/high instructions. > > The general rule is that vmrghh(x,y) [BE] = vmrglh(y,x) [LE], and so on; > that is, we need to reverse the usage of merge high and merge low, and > also swap their inputs, to obtain the same semantics. In this case we > are only swapping the inputs, because the reversed usage of high and low > has already been done for us in the generic handling code for > VEC_WIDEN_MULT_LO_EXPR. > > Bootstrapped and tested with the rest of the patch set on > powerpc64{,le}-unknown-linux-gnu, with no regressions. Is this ok for > trunk? > > Thanks, > Bill > > > 2013-11-03 Bill Schmidt > > * config/rs6000/altivec.md (vec_widen_umult_hi_v16qi): Swap > arguments to merge instruction for little endian. > (vec_widen_umult_lo_v16qi): Likewise. > (vec_widen_smult_hi_v16qi): Likewise. > (vec_widen_smult_lo_v16qi): Likewise. > (vec_widen_umult_hi_v8hi): Likewise. > (vec_widen_umult_lo_v8hi): Likewise. > (vec_widen_smult_hi_v8hi): Likewise. > (vec_widen_smult_lo_v8hi): Likewise. > > > Index: gcc/config/rs6000/altivec.md > =================================================================== > --- gcc/config/rs6000/altivec.md (revision 204192) > +++ gcc/config/rs6000/altivec.md (working copy) > @@ -2185,7 +2235,10 @@ > > emit_insn (gen_vec_widen_umult_even_v16qi (ve, operands[1], operands[2])); > emit_insn (gen_vec_widen_umult_odd_v16qi (vo, operands[1], operands[2])); > - emit_insn (gen_altivec_vmrghh (operands[0], ve, vo)); > + if (BYTES_BIG_ENDIAN) > + emit_insn (gen_altivec_vmrghh (operands[0], ve, vo)); > + else > + emit_insn (gen_altivec_vmrghh (operands[0], vo, ve)); > DONE; > }") > > @@ -2202,7 +2255,10 @@ > > emit_insn (gen_vec_widen_umult_even_v16qi (ve, operands[1], operands[2])); > emit_insn (gen_vec_widen_umult_odd_v16qi (vo, operands[1], operands[2])); > - emit_insn (gen_altivec_vmrglh (operands[0], ve, vo)); > + if (BYTES_BIG_ENDIAN) > + emit_insn (gen_altivec_vmrglh (operands[0], ve, vo)); > + else > + emit_insn (gen_altivec_vmrglh (operands[0], vo, ve)); > DONE; > }") > > @@ -2219,7 +2275,10 @@ > > emit_insn (gen_vec_widen_smult_even_v16qi (ve, operands[1], operands[2])); > emit_insn (gen_vec_widen_smult_odd_v16qi (vo, operands[1], operands[2])); > - emit_insn (gen_altivec_vmrghh (operands[0], ve, vo)); > + if (BYTES_BIG_ENDIAN) > + emit_insn (gen_altivec_vmrghh (operands[0], ve, vo)); > + else > + emit_insn (gen_altivec_vmrghh (operands[0], vo, ve)); > DONE; > }") > > @@ -2236,7 +2295,10 @@ > > emit_insn (gen_vec_widen_smult_even_v16qi (ve, operands[1], operands[2])); > emit_insn (gen_vec_widen_smult_odd_v16qi (vo, operands[1], operands[2])); > - emit_insn (gen_altivec_vmrglh (operands[0], ve, vo)); > + if (BYTES_BIG_ENDIAN) > + emit_insn (gen_altivec_vmrglh (operands[0], ve, vo)); > + else > + emit_insn (gen_altivec_vmrglh (operands[0], vo, ve)); > DONE; > }") > > @@ -2253,7 +2315,10 @@ > > emit_insn (gen_vec_widen_umult_even_v8hi (ve, operands[1], operands[2])); > emit_insn (gen_vec_widen_umult_odd_v8hi (vo, operands[1], operands[2])); > - emit_insn (gen_altivec_vmrghw (operands[0], ve, vo)); > + if (BYTES_BIG_ENDIAN) > + emit_insn (gen_altivec_vmrghw (operands[0], ve, vo)); > + else > + emit_insn (gen_altivec_vmrghw (operands[0], vo, ve)); > DONE; > }") > > @@ -2270,7 +2335,10 @@ > > emit_insn (gen_vec_widen_umult_even_v8hi (ve, operands[1], operands[2])); > emit_insn (gen_vec_widen_umult_odd_v8hi (vo, operands[1], operands[2])); > - emit_insn (gen_altivec_vmrglw (operands[0], ve, vo)); > + if (BYTES_BIG_ENDIAN) > + emit_insn (gen_altivec_vmrglw (operands[0], ve, vo)); > + else > + emit_insn (gen_altivec_vmrglw (operands[0], vo, ve)); > DONE; > }") > > @@ -2287,7 +2355,10 @@ > > emit_insn (gen_vec_widen_smult_even_v8hi (ve, operands[1], operands[2])); > emit_insn (gen_vec_widen_smult_odd_v8hi (vo, operands[1], operands[2])); > - emit_insn (gen_altivec_vmrghw (operands[0], ve, vo)); > + if (BYTES_BIG_ENDIAN) > + emit_insn (gen_altivec_vmrghw (operands[0], ve, vo)); > + else > + emit_insn (gen_altivec_vmrghw (operands[0], vo, ve)); > DONE; > }") > > @@ -2304,7 +2375,10 @@ > > emit_insn (gen_vec_widen_smult_even_v8hi (ve, operands[1], operands[2])); > emit_insn (gen_vec_widen_smult_odd_v8hi (vo, operands[1], operands[2])); > - emit_insn (gen_altivec_vmrglw (operands[0], ve, vo)); > + if (BYTES_BIG_ENDIAN) > + emit_insn (gen_altivec_vmrglw (operands[0], ve, vo)); > + else > + emit_insn (gen_altivec_vmrglw (operands[0], vo, ve)); > DONE; > }") > > >