From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23573 invoked by alias); 16 Feb 2014 17:19:54 -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 23559 invoked by uid 89); 16 Feb 2014 17:19:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e23smtp05.au.ibm.com Received: from e23smtp05.au.ibm.com (HELO e23smtp05.au.ibm.com) (202.81.31.147) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 16 Feb 2014 17:19:52 +0000 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Feb 2014 03:19:43 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 17 Feb 2014 03:19:42 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 9C2062CE8052 for ; Mon, 17 Feb 2014 04:19:41 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1GH07Rc63439026 for ; Mon, 17 Feb 2014 04:00:08 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1GHJefu015885 for ; Mon, 17 Feb 2014 04:19:40 +1100 Received: from [9.77.137.133] (sig-9-77-137-133.mts.ibm.com [9.77.137.133]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s1GHJbna015874; Mon, 17 Feb 2014 04:19:39 +1100 Message-ID: <1392571196.20991.24.camel@gnopaine> Subject: [PATCH, rs6000] Provide little-endian support for vmrgew and vmrgow From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com Date: Sun, 16 Feb 2014 17:19:00 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14021617-1396-0000-0000-0000044D0704 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00974.txt.bz2 Hi, With -mcpu=power8, we see two test cases (gcc.dg/vect/slp-perm-2.c and gcc.dg/vect/slp-perm-5.c) regress for powerpc64le-linux. GCC makes use of some new Power8 instructions (vmrgew and vmrgow) which need adjustment for little endian targets. As with merge-high and merge-low, we need to reverse the order of the input vectors and reverse the use of the "odd" and "even" instructions (since the change in element ordering changes which elements are odd and which are even). Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no regressions. The failing tests now run to completion. Is this ok for trunk? Thanks, Bill 2014-02-16 Bill Schmidt * config/rs6000/altivec.md (p8_vmrgew): Handle little endian targets. (p8_vmrgow): Likewise. Index: gcc/config/rs6000/altivec.md =================================================================== --- gcc/config/rs6000/altivec.md (revision 207809) +++ gcc/config/rs6000/altivec.md (working copy) @@ -1234,7 +1234,12 @@ (parallel [(const_int 0) (const_int 4) (const_int 2) (const_int 6)])))] "TARGET_P8_VECTOR" - "vmrgew %0,%1,%2" +{ + if (BYTES_BIG_ENDIAN) + return "vmrgew %0,%1,%2"; + else + return "vmrgow %0,%2,%1"; +} [(set_attr "type" "vecperm")]) (define_insn "p8_vmrgow" @@ -1246,7 +1251,12 @@ (parallel [(const_int 1) (const_int 5) (const_int 3) (const_int 7)])))] "TARGET_P8_VECTOR" - "vmrgow %0,%1,%2" +{ + if (BYTES_BIG_ENDIAN) + return "vmrgow %0,%1,%2"; + else + return "vmrgew %0,%2,%1"; +} [(set_attr "type" "vecperm")]) (define_expand "vec_widen_umult_even_v16qi"