This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] [patch] Support vectorization of min/max location pattern



Richard Henderson <rth@redhat.com> wrote on 08/07/2010 08:15:25 PM:

> On 07/08/2010 12:33 AM, Ira Rosen wrote:
> >> (1) The documentation should go into the DEFHOOK.
> >
> > I am sorry, but I don't understand what you mean.
>
> DEFHOOK
> (builtin_vect_compare,
>  "This hook returns a target builtin..."
>  tree, (unsigned code, tree type, tree *return_type), NULL)
>
> For new code, the only thing that goes in tm.texi.in is
>
> @hook TARGET_VECTORIZE_BUILTIN_VECT_COMPARE

Thanks, I'll fix this.

>
> > BUILTIN_VECT_COMPARE is used for location and not for MIN/MAX. There
> > are two statements to vectorize: min/max and location computation.
> > And min/max is vectorized as you described. Location has different
> > types in condition (float) and then/else (integer).
>
> Ah, well it seems I didn't really know what I was reviewing.
> What is "location computation" in this context?

It's minloc pattern, i.e., a loop that finds the location of the minimum:

  float  arr[N};

  for (i = 0; i < N; i++)
    if (arr[i] < limit)
      {
        pos = i + 1;
        limit = arr[i];
      }

Vectorizer's input code:

  # pos_22 = PHI <pos_1(4), 1(2)>
  # limit_24 = PHI <limit_4(4), 0(2)>
  ...
  pos_1 = [cond_expr] limit_9 < limit_24 ? pos_10 : pos_22;       //
location
  limit_4 = [cond_expr] limit_9 < limit_24 ? limit_9 : limit_24;  // min


Please see my original mail for some more details
http://gcc.gnu.org/ml/gcc-patches/2010-07/msg00018.html.

Ira

>
>
> r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]