From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82597 invoked by alias); 22 Jun 2017 15:23:47 -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 82541 invoked by uid 89); 22 Jun 2017 15:23:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=06pm, 06PM, love, boring X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Jun 2017 15:23:42 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id v5MFNYPs019689; Thu, 22 Jun 2017 10:23:35 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id v5MFNWRN019687; Thu, 22 Jun 2017 10:23:32 -0500 Date: Thu, 22 Jun 2017 15:23:00 -0000 From: Segher Boessenkool To: Carl Love Cc: gcc-patches@gcc.gnu.org, David Edelsohn , Bill Schmidt Subject: Re: [PATCH v2, rs6000] Add vec_reve support Message-ID: <20170622152332.GD16550@gate.crashing.org> References: <1498080186.20938.9.camel@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1498080186.20938.9.camel@us.ibm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01677.txt.bz2 Hi Carl, On Wed, Jun 21, 2017 at 02:23:06PM -0700, Carl Love wrote: > +;; Vector reverse elements > +(define_expand "altivec_vreve2" > + [(set (match_operand:VEC_A 0 "register_operand" "=v") > + (unspec:VEC_A [(match_operand:VEC_A 1 "register_operand" "v")] > + UNSPEC_VREVEV))] The constraints on an expand are never used; it's less confusing if you remove them. > + for (j = num_elements - 1; j >= 0; j--) > + for (i = 0; i < size; i++) > + RTVEC_ELT (v, i + j * size) > + = gen_rtx_CONST_INT (QImode, > + size * num_elements - j * size + i - size); Maybe + RTVEC_ELT (v, i + j * size) + = gen_rtx_CONST_INT (QImode, i + (num_elements - j - 1) * size); (so it is clearer this is reverting the elements)? Oh, and you can make the "j" loop run forward now. You can assume the compiler will strength-reduce the loop and everything; write your code so it is easily readable, everything boring, everything the same as always. This makes unusual things stand out more, too, which is a very good thing :-) > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-vec_reve-runnable.c > @@ -0,0 +1,394 @@ > +/* { dg-do run { target { powerpc*-*-linux* } } } */ > +/* { dg-require-effective-target vsx_hw } */ > +/* { dg-options "-O2 -mvsx -mcpu=power8" } */ > +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ This will make it run on power7 as well... That won't work. I think you're previous patch had something similar (and that is in fact failing on power7). Please investigate. (Maybe it wants p8vector_hw instead?) Segher