From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66304 invoked by alias); 9 Jan 2018 15:49:19 -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 66283 invoked by uid 89); 9 Jan 2018 15:49:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-16.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f171.google.com Received: from mail-wr0-f171.google.com (HELO mail-wr0-f171.google.com) (209.85.128.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Jan 2018 15:49:16 +0000 Received: by mail-wr0-f171.google.com with SMTP id f8so14588816wre.4 for ; Tue, 09 Jan 2018 07:49:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version; bh=E+/eQ1Ezv76S/Hs958NQQCPnEPW/UjYa/XSgXFpm4eg=; b=PZaZk53xi1R4WUD4oqUSGwZUbTT4KtYomzaNE/ld7mdIksYE8/aTE7pm3xt4wj6cCc bXmZFI3u+zSHMD2/xt7ACkQEOAshKydkawyMyxaS8i689VSVcRkombNxkdCTdhqHjReB XFDHANOUwG9CQSBu42f8YTBCFtGlRa3oIZDAP2pTa90oHDoyiv2RXwUeQfxiwTTSBM7Q odN2HM3YGCzNdNo6Gf+RuYPZ25dAMK4KvGs01qItQN1aggXSnSvjZWgy7plwSH/mE09x 27wVWtrYTIPaCPnHMTM+sQ9Vv8PuQ1pry2tE5ICuiX1+iawXobhPs3SPjLAW5gx5rjUW HBrA== X-Gm-Message-State: AKwxytcebfpxD0rXfl4BsgU1u+na+NoxyzcAORC5GAMq8eOPkrv6k5hv oS3X/40x9mtPbWLo1Ppyi0xDCDs6jXY= X-Google-Smtp-Source: ACJfBoumJE2VNxRbJRfdA9WIoa4L4wzr0GCVeTqL+wm2s1x+yzrkJGD1kCSBzlIqVBVPMGXV/GIS+w== X-Received: by 10.223.157.194 with SMTP id q2mr1781858wre.21.1515512954324; Tue, 09 Jan 2018 07:49:14 -0800 (PST) Received: from localhost ([95.144.14.233]) by smtp.gmail.com with ESMTPSA id y137sm17836006wme.0.2018.01.09.07.49.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Jan 2018 07:49:13 -0800 (PST) From: Richard Sandiford To: James Greenhalgh Mail-Followup-To: James Greenhalgh ,"gcc-patches\@gcc.gnu.org" , richard.sandiford@linaro.org Cc: "gcc-patches\@gcc.gnu.org" Subject: RFA: Expand vec_perm_indices::series_p comment References: <87indfmrgt.fsf@linaro.org> <87shcjjxcc.fsf@linaro.org> <87r2rq314b.fsf@linaro.org> <87k1wxvp6r.fsf@linaro.org> <20180109121729.GA16646@arm.com> Date: Tue, 09 Jan 2018 16:24:00 -0000 In-Reply-To: <20180109121729.GA16646@arm.com> (James Greenhalgh's message of "Tue, 9 Jan 2018 12:17:29 +0000") Message-ID: <87zi5nav7r.fsf_-_@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-01/txt/msg00639.txt.bz2 James Greenhalgh writes: > On Thu, Jan 04, 2018 at 11:27:56AM +0000, Richard Sandiford wrote: >> Ping**2 > > This is OK. Thanks. > It took me a while to get the hang of the interface - a worked example > in the comment in vec-perm-indices.c would probably have been helpful. > It took until your code for REV for this to really make sense to me; so > perhaps that make for a good example. Yeah, good idea. Is the following OK? Tested on aarch64-linux-gnu. Thanks, Richard 2018-01-09 Richard Sandiford gcc/ * vec-perm-indices.c (vec_perm_indices::series_p): Give examples of usage. Index: gcc/vec-perm-indices.c =================================================================== --- gcc/vec-perm-indices.c 2018-01-03 11:12:55.709763763 +0000 +++ gcc/vec-perm-indices.c 2018-01-09 15:46:40.004232873 +0000 @@ -114,7 +114,18 @@ vec_perm_indices::rotate_inputs (int del } /* Return true if index OUT_BASE + I * OUT_STEP selects input - element IN_BASE + I * IN_STEP. */ + element IN_BASE + I * IN_STEP. For example, the call to test + whether a permute reverses a vector of N elements would be: + + series_p (0, 1, N - 1, -1) + + which would return true for { N - 1, N - 2, N - 3, ... }. + The calls to test for an interleaving of elements starting + at N1 and N2 would be: + + series_p (0, 2, N1, 1) && series_p (1, 2, N2, 1). + + which would return true for { N1, N2, N1 + 1, N2 + 1, ... }. */ bool vec_perm_indices::series_p (unsigned int out_base, unsigned int out_step,