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: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.


On Fri, Oct 14, 2011 at 05:53:28PM +0400, Kirill Yukhin wrote:
> Thanks, done.
> 
> Anything else?

First of all, most of the testcases look very similar, the only changes
in between many of them are (unimportant) function names and different type.
So, I think it would be much better to just write one testcase that will use
instead of int or whatever the type is TYPE
where there will be
#ifndef TYPE
#define TYPE int
#endif
early in the testcase.  Then all the other type variants can just include
the base variant of the testcase, and would contain just

/* { dg-do run } */
/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */
/* { dg-require-effective-target avx2 } */

#define TYPE long long int
#include "avx2-vpaddd-3.c"

/* { dg-final { scan-assembler-times "vpaddq\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */
/* { dg-final { cleanup-saved-temps } } */


The indentation is not the GNU standard one, though perhaps for the
testcases it is less important.  For testcases we import from somewhere
else we often keep it in the weirdo formatting it originally had
(after all, it doesn't hurt to verify that e.g. our lexer etc. isn't
surprised by whitespace missing or being present at unexpected spots).
These testcases on the other side are written for GCC just to check
the vectorization, so perhaps it should follow the GNU coding conventions.

+  for (i = 0; i < 4; ++i ) {
+    for ( j = 0; j < SIZE; ++j ) {
+      a[i] = i*i+i;
+      b[i] = i*i*i;
+    }

{ should be on the next line, indented by two columns from for.
= i * i + i;
= i * i * i;

+    if ( memcmp(c, c_ref, SIZE * sizeof (char) ) )

if (memcmp (c, c_ref, SIZE * sizeof (TYPE)))

+      abort();
+  }
+}
+

	Jakub


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