From patchwork Tue Jan 9 15:49:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 123971 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4171584qgn; Tue, 9 Jan 2018 07:49:30 -0800 (PST) X-Google-Smtp-Source: ACJfBovKuJbSVsTjnKxkhYIUqjXt1o+bqoCfZ8z8XUOJ9jtlOFPWK5J2vKMnPH4ODRzelmmKleeo X-Received: by 10.98.60.132 with SMTP id b4mr9571675pfk.120.1515512970630; Tue, 09 Jan 2018 07:49:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515512970; cv=none; d=google.com; s=arc-20160816; b=dv9mCZyAdLt+wou7yVWHixOXUriuwQ2ckmZKYTkdSTTV2yP/XbxiP0PsR+S2LeHAFY mIWVR5UZuX3Cnd+f5h3GvFdLNT8RaGFPSylM7ZayhjJynCmtz76FKgIEkrMwcatBPL36 VOo+ZSOID8XCtCyKjO46+40USJGoWwr6c0tXE2w2nx8b0ZJ0c+KJi1su6C00IRoTQjxc xXo2RkVlkleVsroTjX7W5TE4BN0ptl1hpjr6QE+z9jyK7qNpFyLd1KsMH+hcKPhY0fW9 O5OT/dEmLrrbarF93RTpyPArCiGd4UvIgTIojUJuzBtpo1rp9p+kW3tPx2qNdTskaFeG JVyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=E+/eQ1Ezv76S/Hs958NQQCPnEPW/UjYa/XSgXFpm4eg=; b=jSC2ynscZHIn+gGEN6iorXZ2AwZwfAeLs6fzUr1YhJTa8m3K9A1Lhun6x4VmkMY7Cx ItmH0Pu8dgt70LLOeIhIph+1EQHrZKP0ljNEYIxipi/+5DvJYl7rpXvo8uPVK9yTkJn2 ONliRN5lcYk6mKvPET9K5EbfKLGVIxCMtAVDuTWamgOslrbur0k0U8RYYl/1qrl3OOg+ OXr4Qf8VEWO9sI1K1Tz/Xg0JeU3BYib2Wjpyh5Qlj46rDHx33IsOdl+cSUVIbyin7N7O Pw3ochXEhAx8OFA1SC15gZOL06pGRdCjQFc2xghJ7YX3TwxA/vzrnwUaV65PT9s0cPVQ PS9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=YN71XW/Z; spf=pass (google.com: domain of gcc-patches-return-470568-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470568-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b62si10222622pfe.291.2018.01.09.07.49.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 07:49:30 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-470568-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=YN71XW/Z; spf=pass (google.com: domain of gcc-patches-return-470568-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470568-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=ZUcJd3Rjiqu5IuXK nmaht3ErntUkMpYq8kUAfo4CUdjyetJpiiK1gSiNeq8Zx51cDIRQbG0Id0w2iZa+ bbXeUGGQfHqQJ+gBl7VocX8z2Knf4WAm/WYRTonfTRdGvqsgiXPiEsa8K7+665Zf 3hiCOWoZr5UE2YPm+zPvIt1gz9A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=88ZoeIOx7mBkUDpPYtmenB ajxD4=; b=YN71XW/ZvmiymVwS8BKzTTHJsZzRQ5JPPEff1LUmDOYqvTOztrD97K V04rSt/2s9dtlUv5FsBxihoDwpcM3KpIilkmwZJWEAkB0t5fWJCnrGp5WQPeb0E5 LoY2qCUk4M2KABncpMPRwz7sQqMumFCNLoAymCotG15wqCO//5WNs= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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-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 15:49:12 +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 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,