public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ira Rosen <IRAR@il.ibm.com>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Richard Henderson <rth@redhat.com>
Subject: Re: [patch] Support vectorization of min/max location pattern - take 	2
Date: Mon, 09 Aug 2010 12:33:00 -0000	[thread overview]
Message-ID: <OFA1A49B1D.1B3C4346-ONC225777A.0041879C-C225777A.00449811@il.ibm.com> (raw)
In-Reply-To: <AANLkTimJhJshpO+9SNPXKgb2WTK=GVs9hyk+DwA6PUoA@mail.gmail.com>



Richard Guenther <richard.guenther@gmail.com> wrote on 09/08/2010 02:00:59
PM:

> On Mon, Aug 9, 2010 at 12:53 PM, Ira Rosen <IRAR@il.ibm.com> wrote:
> >
> >
> > Richard Guenther <richard.guenther@gmail.com> wrote on 09/08/2010
12:50:14
> > PM:
> >> > I implemented VEC_COND_EXPR extension in the attached patch.
> >> >
> >> > For reduction epilogue I defined new tree codes
> >> > REDUC_MIN/MAX_FIRST/LAST_LOC_EXPR.
> >>
> >> Why do you need new tree codes here?
> >
> > After vector loop we have two vectors one with four minimums and the
second
> > with four corresponding array indexes. The extraction of the correct
index
> > out of four can be done differently on each platform (including
problematic
> > vector comparisons).
>
> So the tree code is just to tie those two operations together?

It is not to tie MIN/MAX extraction and index extraction together. It is to
extract scalar value from a vector of indexes. To do that we need both
vectors (minimums and indexes). We already have tree codes for other
reduction epilogues (like REDUC_PLUS_EXPR).

>
> >> They btw need
> >> documentation - just stating the new operand is a vector isn't
> >> very informative.  They need documentation in generic.texi.
> >
> > Sorry about that, I'll add documentation for both.
>
> Thanks.
>
> >>
> >> Likewise the new RTX codes (what are they for??)
> >
> > Probably there is a better way to do that, but I needed to map new
vector
> > comparison instructions that compare floats and return ints.
>
> So you just need this at expansion time then and the RTXen
> will never appear in RTL code?

It will appear in RTL code. AFAIU, current RTX codes for vector comparison
require same types for input and output, so I had to add new codes.

> Why not use a target hook for
> expanding those comparisons then?  Btw, my GSoC student
> implemented lowering of generic vector comparisons resulting
> in a mask in tree-vect-generic.c using a target hook that eventually
> uses target specific builtins.  I attached the latest patch for that.

I used a target hook in the original patch, but I inserted calls it in the
vectorizer.
BTW, I don't understand how your hook will work for mips:

> >> >>
> >> >> (2) The mips C.cond.PS instruction does *not* produce a bitmask
> >> >>     like altivec or sse do.  Instead it sets multiple condition
> >> >>     codes.  One then uses MOV[TF].PS to merge the elements based
> >> >>     on the individual condition codes.  While there's no direct
> >> >>     corresponding instruction that will operate on integers, I
> >> >>     don't think it would be too difficult to use MOV[TF].G or
> >> >>     BC1AND2[FT] instructions to emulate it.  In any case, this
> >> >>     is again a case where you don't want to expose any part of
> >> >>     the VEC_COND at the gimple level.
> >> >>
> >> >>
> >> >> r~
> >


If VECT_COND_EXPR and REDUC_..._LOC_EXPR are used, why do we need a target
hook? To avoid new RTX codes?

>
> >> need documentation
> >> in rtl.texi.
> >>
> >> Btw, you still don't adjust if-conversion to fold the COND_EXPR
> >> it generates - that would generate the MIN/MAX expressions
> >> directly and you wouldn't have to pattern match the COND_EXPR.
> >
> > I don't see how it can help to avoid pattern matching. We will still
need
> > to match MIN/MAX's arguments with the COND_EXPR arguments.
>
> True, but you need to match MIN/MAX instead.  Well, my point
> is that if-convert shouldn't create a COND_EXPR in that case.

OK, I'll try to fix if-convert (and my patch accordingly).

Thanks,
Ira

>
> Richard.
>

  parent reply	other threads:[~2010-08-09 12:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01  8:01 [RFC] [patch] Support vectorization of min/max location pattern Ira Rosen
2010-07-06  7:15 ` Ira Rosen
2010-07-07 20:43   ` Richard Henderson
2010-07-08  7:34     ` Ira Rosen
2010-07-08  9:21       ` Richard Guenther
2010-07-08 17:15       ` Richard Henderson
2010-07-08 18:20         ` Ira Rosen
2010-07-08 20:10           ` Richard Henderson
2010-08-09  7:55             ` [patch] Support vectorization of min/max location pattern - take 2 Ira Rosen
2010-08-09 10:05               ` Richard Guenther
2010-08-09 10:58                 ` Ira Rosen
2010-08-09 11:01                   ` Richard Guenther
2010-08-09 11:03                     ` Richard Guenther
2010-08-09 12:33                     ` Ira Rosen [this message]
2010-11-19 15:53   ` [RFC] [patch] Support vectorization of min/max location pattern H.J. Lu
2010-12-15 20:27     ` H.J. Lu

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=OFA1A49B1D.1B3C4346-ONC225777A.0041879C-C225777A.00449811@il.ibm.com \
    --to=irar@il.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=rth@redhat.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).