From: Richard Sandiford <rdsandiford@googlemail.com>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: RFC: Representing vector lane load/store operations
Date: Tue, 22 Mar 2011 19:43:00 -0000 [thread overview]
Message-ID: <87k4frlz5c.fsf@firetop.home> (raw)
In-Reply-To: <AANLkTi=mKUpvPTvcz83QoyufYDodcc_DeLut-mrVHqs0@mail.gmail.com> (Richard Guenther's message of "Tue, 22 Mar 2011 18:10:19 +0100")
Richard Guenther <richard.guenther@gmail.com> writes:
> Simple. Just make them registers anyway (I did that in the past
> when working on middle-end arrays). You'd set DECL_GIMPLE_REG_P
> on the decl.
OK, thanks, I'll give that a go. TBH, I'm still hopeful we can
do without it, because we do seem to cope quite well as things stand.
But I suppose that might not hold true as the examples get more complicated.
> 4. a vector-of-vectors type
>
> Cons
> * I don't think we want that ;)
Yeah :-)
>> __builtin_load_lanes (REF : array N*M of X)
>> returns array N of vector M of X
>> maps to vldN on ARM
>> in practice, the result would be used in assignments of the form:
>> vectorY = ARRAY_REF <result, Y>
>>
>> __builtin_store_lanes (VECTORS : array N of vector M of X)
>> returns array N*M of X
>> maps to vstN on ARM
>> in practice, the argument would be populated by assignments of the form:
>> ARRAY_REF <VECTORS, Y> = vectorY
>>
>> __builtin_load_lane (REF : array N of X,
>> VECTORS : array N of vector M of X,
>> LANE : integer)
>> returns array N of vector M of X
>> maps to vldN_lane on ARM
>>
>> __builtin_store_lane (VECTORS : array N of vector M of X,
>> LANE : integer)
>> returns array N of X
>> maps to vstN_lane on ARM
>>
>> __builtin_load_dup (REF : array N of X)
>> returns array N of vector M of X
>> maps to vldN_dup on ARM
>>
>> I've hacked up a prototype of this and it seems to produce good code.
>> What do you think?
>
> How do you expect these to be used? That is, would you ever expect
> components of those large vectors/arrays be used in operations
> like add, or does the HW provide vector-lane variants for those as well?
The individual vectors would be used for add, etc. That's what the
ARRAY_REF stuff above is supposed to be getting at. So...
> Thus, will
>
> for (i=0; i<N; ++i)
> X[i] = Y[i] + Z[i];
>
> result in a single add per vector lane load or a single vector lane load
> for M "unrolled" instances of (small) vector adds? If the latter then
> we have to think about indexing the vector lanes as well as allowing
> partial stores (or have a vector-lane construct operation). Representing
> vector lanes as automatic memory (with array of vector type) makes
> things easy, but eventually not very efficient.
...Ira would know best, but I don't think it would be used for this
kind of loop. It would be more something like:
for (i=0; i<N; ++i)
X[i] = Y[i].red + Y[i].blue + Y[i].green;
(not a realistic example). You'd then have:
compoundY = __builtin_load_lanes (Y);
red = ARRAY_REF <compoundY, 0>
green = ARRAY_REF <compoundY, 1>
blue = ARRAY_REF <compoundY, 2>
D1 = red + green
D2 = D1 + blue
MEM_REF <X> = D2;
My understanding is that'd we never do any operations besides ARRAY_REFs
on the compound value, and that the individual vectors would be treated
pretty much like any other.
> I had new tree/stmt codes for array loads/stores for middle-end arrays.
> Eventually the vector lane support can at least walk in the same direction
> that middle-end arrays would ;)
What's the status of the middle-end array stuff? A quick search
showed up your paper, but is it still WIP, or has it already gone in?
(Showing my ignorance of tree-level stuff here. :-)) It does sound
like it'd be a good fit for these ops.
Richard
next prev parent reply other threads:[~2011-03-22 19:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 16:52 Richard Sandiford
2011-03-22 17:10 ` Richard Guenther
2011-03-22 19:43 ` Richard Sandiford [this message]
2011-03-23 9:23 ` Richard Guenther
2011-03-23 10:38 ` Richard Sandiford
2011-03-23 11:52 ` Richard Guenther
2011-03-23 12:18 ` Richard Sandiford
2011-03-23 12:37 ` Richard Guenther
2011-03-23 13:01 ` Richard Sandiford
2011-03-23 13:14 ` Richard Guenther
2011-03-23 14:14 ` Richard Sandiford
2011-03-23 14:28 ` Richard Guenther
2011-03-23 14:41 ` Richard Sandiford
2011-03-29 12:50 ` Richard Sandiford
2011-03-29 14:05 ` Richard Guenther
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=87k4frlz5c.fsf@firetop.home \
--to=rdsandiford@googlemail.com \
--cc=gcc@gcc.gnu.org \
--cc=richard.guenther@gmail.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).