From: Richard Biener <richard.guenther@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
Richard Sandiford <richard.sandiford@linaro.org>
Subject: Re: [11/13] Use vec_perm_builder::series_p in shift_amt_for_vec_perm_mask
Date: Tue, 02 Jan 2018 13:08:00 -0000 [thread overview]
Message-ID: <CAFiYyc0+-JumD9nOWANmCxxX-r4obhtBVBOwPoWu0CmCZ0+VNQ@mail.gmail.com> (raw)
In-Reply-To: <871sk3lc2y.fsf_-_@linaro.org>
On Sun, Dec 10, 2017 at 12:24 AM, Richard Sandiford
<richard.sandiford@linaro.org> wrote:
> This patch makes shift_amt_for_vec_perm_mask use series_p to check
> for the simple case of a natural linear series before falling back
> to testing each element individually. The series_p test works with
> variable-length vectors but testing every individual element doesn't.
Ok.
Richard.
>
> 2017-12-09 Richard Sandiford <richard.sandiford@linaro.org>
>
> gcc/
> * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
> before testing each element individually.
>
> Index: gcc/optabs.c
> ===================================================================
> --- gcc/optabs.c 2017-12-09 22:48:52.266015836 +0000
> +++ gcc/optabs.c 2017-12-09 22:48:56.257154317 +0000
> @@ -5375,20 +5375,20 @@ vector_compare_rtx (machine_mode cmp_mod
> static rtx
> shift_amt_for_vec_perm_mask (machine_mode mode, const vec_perm_indices &sel)
> {
> - unsigned int i, first, nelt = GET_MODE_NUNITS (mode);
> + unsigned int nelt = GET_MODE_NUNITS (mode);
> unsigned int bitsize = GET_MODE_UNIT_BITSIZE (mode);
> -
> - first = sel[0];
> + unsigned int first = sel[0];
> if (first >= nelt)
> return NULL_RTX;
> - for (i = 1; i < nelt; i++)
> - {
> - int idx = sel[i];
> - unsigned int expected = i + first;
> - /* Indices into the second vector are all equivalent. */
> - if (idx < 0 || (MIN (nelt, (unsigned) idx) != MIN (nelt, expected)))
> - return NULL_RTX;
> - }
> +
> + if (!sel.series_p (0, 1, first, 1))
> + for (unsigned int i = 1; i < nelt; i++)
> + {
> + unsigned int expected = i + first;
> + /* Indices into the second vector are all equivalent. */
> + if (MIN (nelt, sel[i]) != MIN (nelt, expected))
> + return NULL_RTX;
> + }
>
> return GEN_INT (first * bitsize);
> }
next prev parent reply other threads:[~2018-01-02 13:08 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-09 23:06 [00/13] Make VEC_PERM_EXPR work for variable-length vectors Richard Sandiford
2017-12-09 23:08 ` [01/13] Add a qimode_for_vec_perm helper function Richard Sandiford
2017-12-18 13:34 ` Richard Biener
2017-12-09 23:09 ` [02/13] Pass vec_perm_indices by reference Richard Sandiford
2017-12-12 14:23 ` Richard Biener
2017-12-09 23:11 ` [03/13] Split can_vec_perm_p into can_vec_perm_{var,const}_p Richard Sandiford
2017-12-12 14:25 ` Richard Biener
2017-12-09 23:13 ` [04/13] Refactor expand_vec_perm Richard Sandiford
2017-12-12 15:17 ` Richard Biener
2017-12-09 23:17 ` [05/13] Remove vec_perm_const optab Richard Sandiford
2017-12-12 15:26 ` Richard Biener
2017-12-20 13:42 ` Richard Sandiford
2017-12-09 23:18 ` [06/13] Check whether a vector of QIs can store all indices Richard Sandiford
2017-12-12 15:27 ` Richard Biener
2017-12-09 23:20 ` [07/13] Make vec_perm_indices use new vector encoding Richard Sandiford
2017-12-12 15:32 ` Richard Biener
2017-12-12 15:47 ` Richard Sandiford
2017-12-14 10:37 ` Richard Biener
2017-12-20 13:48 ` Richard Sandiford
2018-01-02 13:15 ` Richard Biener
2018-01-02 18:30 ` Richard Sandiford
2017-12-09 23:20 ` [08/13] Add a vec_perm_indices_to_tree helper function Richard Sandiford
2017-12-18 13:34 ` Richard Biener
2017-12-09 23:21 ` [09/13] Use explicit encodings for simple permutes Richard Sandiford
2017-12-19 20:37 ` Richard Sandiford
2018-01-02 13:07 ` Richard Biener
2017-12-09 23:23 ` [10/13] Rework VEC_PERM_EXPR folding Richard Sandiford
2017-12-09 23:24 ` [11/13] Use vec_perm_builder::series_p in shift_amt_for_vec_perm_mask Richard Sandiford
2017-12-19 20:37 ` Richard Sandiford
2018-01-02 13:08 ` Richard Biener [this message]
2017-12-09 23:25 ` [12/13] Use ssizetype selectors for autovectorised VEC_PERM_EXPRs Richard Sandiford
2017-12-19 20:37 ` Richard Sandiford
2018-01-02 13:09 ` Richard Biener
2017-12-19 20:37 ` [10/13] Rework VEC_PERM_EXPR folding Richard Sandiford
2018-01-02 13:08 ` Richard Biener
2017-12-09 23:27 ` [13/13] [AArch64] Use vec_perm_indices helper routines Richard Sandiford
2017-12-19 20:37 ` Richard Sandiford
2018-01-04 11:28 ` Richard Sandiford
2018-01-09 12:18 ` James Greenhalgh
2018-01-09 16:24 ` RFA: Expand vec_perm_indices::series_p comment Richard Sandiford
2018-01-29 20:56 ` Ping: " Richard Sandiford
2018-01-30 7:20 ` Jeff Law
2017-12-12 14:12 ` [00/13] Make VEC_PERM_EXPR work for variable-length vectors Richard Biener
2017-12-12 15:32 ` Richard Sandiford
2017-12-12 15:38 ` Richard Biener
2017-12-12 15:57 ` Richard Sandiford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFiYyc0+-JumD9nOWANmCxxX-r4obhtBVBOwPoWu0CmCZ0+VNQ@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.sandiford@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).