From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59344 invoked by alias); 21 Jun 2017 14:37:10 -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 59170 invoked by uid 89); 21 Jun 2017 14:37:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=oddly, love 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; Wed, 21 Jun 2017 14:37:05 +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 v5LEapr7026777; Wed, 21 Jun 2017 09:36:52 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id v5LEakdN026764; Wed, 21 Jun 2017 09:36:46 -0500 Date: Wed, 21 Jun 2017 14:37:00 -0000 From: Segher Boessenkool To: Carl Love Cc: gcc-patches@gcc.gnu.org, David Edelsohn , Bill Schmidt Subject: Re: [PATCH, rs6000] Add vec_reve support Message-ID: <20170621143645.GV16550@gate.crashing.org> References: <1498008213.20531.1.camel@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1498008213.20531.1.camel@us.ibm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01585.txt.bz2 Hi Carl, On Tue, Jun 20, 2017 at 06:23:33PM -0700, Carl Love wrote: > * config/rs6000/rs6000-builtin.def (VREVE_V2DI, VREVE_V4SI, > VREVE_V8HI, VREVE_V16QI, VREVE_V2DF, VREVE_V4SF, VREVE): New "New." or "New builtin.". > * config/rs6000/altivec.md (UNSPEC_VREVEV, VEC_A_size, > altivec_vrev): New > UNSPEC, new mode_attr, new patterns. This wrapped oddly... mail client problem? Please put these things in separate entries. > * config/rs6000/altivec.h (vec_reve): New define Dot. > * gcc.target/powerpc/builtins-3-vec_reve-runable.c (test_results, > main): Add new runnable test file for the vec_rev built-ins. You misspelled the filename. > diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h > index d542315..98ccfd2 100644 > --- a/gcc/config/rs6000/altivec.h > +++ b/gcc/config/rs6000/altivec.h > @@ -142,6 +142,7 @@ > #define vec_madd __builtin_vec_madd > #define vec_madds __builtin_vec_madds > #define vec_mtvscr __builtin_vec_mtvscr > +#define vec_reve __builtin_vec_vreve > #define vec_vmaxfp __builtin_vec_vmaxfp > #define vec_vmaxsw __builtin_vec_vmaxsw > #define vec_vmaxsh __builtin_vec_vmaxsh All the rest here use just a single space, please do the same. > UNSPEC_VPACK_UNS_UNS_SAT > UNSPEC_VPACK_UNS_UNS_MOD > UNSPEC_VPACK_UNS_UNS_MOD_DIRECT > + UNSPEC_VREVEV > UNSPEC_VSLV4SI > UNSPEC_VSLO > UNSPEC_VSR > @@ -231,6 +232,11 @@ > ;; Vector negate > (define_mode_iterator VNEG [V4SI V2DI]) > > +;; Vector reverse elements, uses define_mode_iterator VEC_A > +;; size in bytes of the vector element > +(define_mode_attr VEC_A_size [(V2DI "8") (V4SI "4") (V8HI "2") > + (V16QI "1") (V2DF "8") (V4SF "4")]) I think you want to use GET_MODE_UNIT_SIZE instead, no need for a new attribute. > + size = ; size = GET_MODE_UNIT_SIZE (mode); > + num_elements = 16 / size; num_elements = GET_MODE_NUNITS (mode); > + 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, k++); Why does j walk backwards? Oh, because of k++. Write that one as something with i and j as well? Segher