public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jim Wilson <jimw@sifive.com>
To: Richard Biener <richard.guenther@gmail.com>,
	"Kewen.Lin" <linkw@linux.ibm.com>,
	 GCC Patches <gcc-patches@gcc.gnu.org>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	 David Edelsohn <dje.gcc@gmail.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	 Jim Wilson <wilson@tuliptree.org>,
	Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [PATCH 1/7 v5] ifn/optabs: Support vector load/store with length
Date: Tue, 23 Jun 2020 19:40:58 -0700	[thread overview]
Message-ID: <CAFyWVaa0zHOpKoOPSd=JS54Hj0wE98_Qji0+GcXAnSQA2oZhbw@mail.gmail.com> (raw)
In-Reply-To: <mptsgemug62.fsf@arm.com>

On Tue, Jun 23, 2020 at 5:21 AM Richard Sandiford
<richard.sandiford@arm.com> wrote:
> MVE and Power both set inactive lanes to zero.  But I'm not sure about RVV.
> AIUI, for RVV the approach instead would be to reduce the effective vector
> length for the final iteration of the vector loop, and I'm not sure
> whether in that situation it makes sense to say that the other elements
> still exist and are guaranteed to be zero.
>
> I'm the last person who should be speculating on that though.  Let's see
> whether Jim has any comments.

The RVV spec supports two policies for tail elements, i.e. elements
beyond the current vector length.  They can be undisturbed or
agnostic.  In the undisturbed case, the trail elements retain their
old values.  In the agnostic case, the implementation can choose to
either retain their old values, or set them to all ones, and this
choice can be different from lane to lane.  The latter case is useful
because registers may be wider than the execution unit, and current
vector length may not be a multiple of the width of the execution
unit.  So for instance if the vector registers can hold 8 elements,
and the execution unit works on 4 elements at a time, and the current
vector length is 2, then it might make sense to leave the last four
elements unmodified to avoid an iteration across the registers, but
the third and fourth elements might be set to all ones because you
have to write to them anyways.  The choice is left up to the
implementation because we have multiple parties designing vector
units, and some are target for low cost embedded market, and some are
target for high performance, and they couldn't agree on a single best
way to implement this.  The software is expected to choose agnostic
only if it doesn't care about what happens to tail elements, and
undisturbed if you want to preserve them.  The value of all ones was
chosen to discourage software developers from trying to use the values
in tail elements.  The choice of undisturbed or agnostic can be
changed every time you set the current vector length and type.

In most cases, I think RVV programs will use agnostic for tail
elements, since we can change the vector length at will, and it will
be rare that we will care about elements beyond the current vector
length.

Tail elements can't cause exceptions so there is no need to worry
about whether those elements hold valid values.

Jim

  reply	other threads:[~2020-06-24  2:41 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  5:49 [PATCH 0/7] " Kewen.Lin
2020-05-26  5:51 ` [PATCH 1/7] ifn/optabs: " Kewen.Lin
2020-06-10  6:41   ` [PATCH 1/7 V2] " Kewen.Lin
2020-06-10  9:22     ` Richard Sandiford
2020-06-10 12:36       ` [PATCH 1/7 V3] " Kewen.Lin
2020-06-22  8:51         ` [PATCH 1/7 V4] " Kewen.Lin
2020-06-22 19:59           ` Richard Sandiford
2020-06-22 22:19             ` Segher Boessenkool
2020-06-23  3:54             ` [PATCH 1/7 v5] " Kewen.Lin
2020-06-23  9:52               ` Richard Sandiford
2020-06-23 11:25                 ` Richard Biener
2020-06-23 12:20                   ` Richard Sandiford
2020-06-24  2:40                     ` Jim Wilson [this message]
2020-06-24  7:34                       ` Richard Sandiford
2020-06-29  6:32                         ` [PATCH 1/7 v6] " Kewen.Lin
2020-06-29 10:07                           ` Richard Sandiford
2020-06-29 10:39                             ` [PATCH 1/7 v7] " Kewen.Lin
2020-06-30 15:32                               ` Richard Sandiford
2020-07-01 13:35                                 ` [PATCH 1/7 v8] " Kewen.Lin
2020-07-07  9:24                                   ` Richard Sandiford
2020-06-24 23:56                     ` [PATCH 1/7 v5] " Segher Boessenkool
2020-06-23  6:47             ` [PATCH 1/7 V4] " Richard Biener
2020-05-26  5:53 ` [PATCH 2/7] rs6000: lenload/lenstore optab support Kewen.Lin
2020-06-10  6:43   ` [PATCH 2/7 V2] " Kewen.Lin
2020-06-10 12:39     ` [PATCH 2/7 V3] " Kewen.Lin
2020-06-11 22:55       ` Segher Boessenkool
2020-06-12  3:02         ` Kewen.Lin
2020-06-23  3:58       ` [PATCH 2/7 v4] " Kewen.Lin
2020-06-29  6:32         ` [PATCH 2/7 v5] " Kewen.Lin
2020-06-29 17:57           ` Segher Boessenkool
2020-05-26  5:54 ` [PATCH 3/7] vect: Factor out codes for niters smaller than vf check Kewen.Lin
2020-05-26  5:55 ` [PATCH 4/7] hook/rs6000: Add vectorize length mode for vector with length Kewen.Lin
2020-06-10  6:44   ` [PATCH 4/7 V2] " Kewen.Lin
2020-05-26  5:57 ` [PATCH 5/7] vect: Support vector load/store with length in vectorizer Kewen.Lin
2020-05-26 12:49   ` Richard Sandiford
2020-05-26 12:52     ` Richard Sandiford
2020-05-27  8:25     ` Kewen.Lin
2020-05-27 10:02       ` Richard Sandiford
2020-05-28  1:21         ` Kewen.Lin
2020-05-29  8:32           ` Richard Sandiford
2020-05-29 12:38             ` Segher Boessenkool
2020-06-02  9:03             ` [PATCH 5/7 v3] " Kewen.Lin
2020-06-02 11:50               ` Richard Sandiford
2020-06-02 17:01                 ` Segher Boessenkool
2020-06-03  6:33                 ` Kewen.Lin
2020-06-10  9:19                   ` [PATCH 5/7 v4] " Kewen.Lin
2020-06-22  8:33                     ` [PATCH 5/7 v5] " Kewen.Lin
2020-06-29  6:33                       ` [PATCH 5/7 v6] " Kewen.Lin
2020-06-30 19:53                         ` Richard Sandiford
2020-07-01 13:23                           ` Kewen.Lin
2020-07-01 15:17                             ` Richard Sandiford
2020-07-02  5:20                               ` Kewen.Lin
2020-07-07  9:26                                 ` Kewen.Lin
2020-07-07 10:44                                   ` Richard Sandiford
2020-07-08  6:52                                     ` Kewen.Lin
2020-07-08 12:50                                       ` Richard Sandiford
2020-07-10  7:40                                         ` Kewen.Lin
2020-07-07 10:15                                 ` Richard Sandiford
2020-07-08  7:01                                   ` Kewen.Lin
2020-07-10  9:55                           ` [PATCH 5/7 v7] " Kewen.Lin
2020-07-17  9:54                             ` Richard Sandiford
2020-07-20  2:25                               ` Kewen.Lin
2020-05-26  5:58 ` [PATCH 6/7] ivopts: Add handlings for vector with length IFNs Kewen.Lin
2020-07-22 12:51   ` Richard Sandiford
2020-05-26  5:59 ` [PATCH 7/7] rs6000/testsuite: Vector with length test cases Kewen.Lin
2020-07-10 10:07   ` [PATCH 7/7 v2] " Kewen.Lin
2020-07-20 16:58     ` Segher Boessenkool
2020-07-21  2:53       ` Kewen.Lin
2020-05-26  7:12 ` [PATCH 0/7] Support vector load/store with length Richard Biener
2020-05-26  8:51   ` Kewen.Lin
2020-05-26  9:44     ` Richard Biener
2020-05-26 10:10       ` Kewen.Lin
2020-05-26 12:29         ` Richard Sandiford
2020-05-27  0:09           ` Segher Boessenkool
2020-05-27  7:25             ` Richard Biener
2020-05-27  8:50               ` Kewen.Lin
2020-05-27 14:08               ` Segher Boessenkool
2020-05-26 22:34   ` Jim Wilson
2020-05-27  7:21     ` Richard Biener
2020-05-27  7:46       ` 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='CAFyWVaa0zHOpKoOPSd=JS54Hj0wE98_Qji0+GcXAnSQA2oZhbw@mail.gmail.com' \
    --to=jimw@sifive.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=richard.guenther@gmail.com \
    --cc=richard.sandiford@arm.com \
    --cc=segher@kernel.crashing.org \
    --cc=wilson@tuliptree.org \
    --cc=wschmidt@linux.ibm.com \
    /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).