Patchwork [RFC] 256bit AVX vectorization support

login
register
mail settings
Submitter H.J. Lu
Date Oct. 14, 2010, 2:10 a.m.
Message ID <AANLkTik1hVbYk-OiJ5gthEG+RHgsXM=L8VHti0JKv_B6@mail.gmail.com>
Download mbox | patch
Permalink /patch/67771/
State New
Headers show

Comments

H.J. Lu - Oct. 14, 2010, 2:10 a.m.
On Wed, Oct 13, 2010 at 1:35 PM, Richard Guenther <rguenther@suse.de> wrote:
> On Wed, 13 Oct 2010, H.J. Lu wrote:
>
>> Those patterns were added for the old 256bit vectorizer changes.
>> I am not sure if they are needed now.  I deleted them. I will
>> investigate against the new 256bit vectorizer changes after they
>> are checked into trunk.
>
> They are all in already.
>
> Richard.
>

Great. I am checking in this testcase.

BTW, vectorizer has been broken for more than a month:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

Any plan to fix it?

Thanks.
Richard Guenther - Oct. 14, 2010, 8:31 a.m.
On Wed, 13 Oct 2010, H.J. Lu wrote:

> On Wed, Oct 13, 2010 at 1:35 PM, Richard Guenther <rguenther@suse.de> wrote:
> > On Wed, 13 Oct 2010, H.J. Lu wrote:
> >
> >> Those patterns were added for the old 256bit vectorizer changes.
> >> I am not sure if they are needed now.  I deleted them. I will
> >> investigate against the new 256bit vectorizer changes after they
> >> are checked into trunk.
> >
> > They are all in already.
> >
> > Richard.
> >
> 
> Great. I am checking in this testcase.
> 
> BTW, vectorizer has been broken for more than a month:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720
> 
> Any plan to fix it?

You reverted the fix, no?

And yes, of course - it's a P1 so it will be fixed before 4.6 goes out.

Richard.
H.J. Lu - Oct. 14, 2010, 8:37 a.m.
On Thu, Oct 14, 2010 at 1:31 AM, Richard Guenther <rguenther@suse.de> wrote:
> On Wed, 13 Oct 2010, H.J. Lu wrote:
>
>> On Wed, Oct 13, 2010 at 1:35 PM, Richard Guenther <rguenther@suse.de> wrote:
>> > On Wed, 13 Oct 2010, H.J. Lu wrote:
>> >
>> >> Those patterns were added for the old 256bit vectorizer changes.
>> >> I am not sure if they are needed now.  I deleted them. I will
>> >> investigate against the new 256bit vectorizer changes after they
>> >> are checked into trunk.
>> >
>> > They are all in already.
>> >
>> > Richard.
>> >
>>
>> Great. I am checking in this testcase.
>>
>> BTW, vectorizer has been broken for more than a month:
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720
>>
>> Any plan to fix it?
>
> You reverted the fix, no?

You asked me to revert my revert.

>
> And yes, of course - it's a P1 so it will be fixed before 4.6 goes out.
>

Since vectorizer is broken, it is impossible to check 256bit
vectorizer.
Richard Guenther - Oct. 14, 2010, 9:01 a.m.
On Thu, 14 Oct 2010, H.J. Lu wrote:

> On Thu, Oct 14, 2010 at 1:31 AM, Richard Guenther <rguenther@suse.de> wrote:
> > On Wed, 13 Oct 2010, H.J. Lu wrote:
> >
> >> On Wed, Oct 13, 2010 at 1:35 PM, Richard Guenther <rguenther@suse.de> wrote:
> >> > On Wed, 13 Oct 2010, H.J. Lu wrote:
> >> >
> >> >> Those patterns were added for the old 256bit vectorizer changes.
> >> >> I am not sure if they are needed now.  I deleted them. I will
> >> >> investigate against the new 256bit vectorizer changes after they
> >> >> are checked into trunk.
> >> >
> >> > They are all in already.
> >> >
> >> > Richard.
> >> >
> >>
> >> Great. I am checking in this testcase.
> >>
> >> BTW, vectorizer has been broken for more than a month:
> >>
> >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720
> >>
> >> Any plan to fix it?
> >
> > You reverted the fix, no?
> 
> You asked me to revert my revert.

Indeed, I didn't see that revert of the revert in the PR.  Micha 
has analyzed the problem and was waiting on advise from Sebastian
or Zdenek - I'll ask him to ping people today.

> > And yes, of course - it's a P1 so it will be fixed before 4.6 goes out.
> >
> 
> Since vectorizer is broken, it is impossible to check 256bit
> vectorizer.

Well, it's not completely broken.  It's also broken for PR44913.

Thanks,
Richard.

Patch

--- /dev/null	2010-10-13 10:21:15.312298381 -0700
+++ gcc/gcc/testsuite/gcc.target/i386/pr44180.c	2010-10-13 19:01:10.270027180 -0700
@@ -0,0 +1,35 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target avx } */
+/* { dg-options "-O2 -ftree-vectorize -mavx" } */
+
+#include "avx-check.h"
+
+#define N 16
+
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+
+static void
+__attribute__ ((noinline))
+avx_test ()
+{
+  int i;
+  float a[N];
+
+  /* Strided access. Vectorizable on platforms that support load of strided 
+     accesses (extract of even/odd vector elements).  */
+  for (i = 0; i < N/2; i++)
+    {
+      a[i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+      d[i] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
+    }
+
+  /* Check results.  */
+  for (i = 0; i < N/2; i++)
+    {
+      if (a[i] != b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i]
+	  || d[i] != b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i])
+	abort();
+    }
+}