Re: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.

2011-10-18 Thread H.J. Lu
On Mon, Oct 17, 2011 at 7:49 AM, Kirill Yukhin kirill.yuk...@gmail.com wrote:
 Thanks, guys, could anybody please commit that?


I checked it in for you.


-- 
H.J.


Re: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.

2011-10-18 Thread Kirill Yukhin
Thank you!

K

On Tue, Oct 18, 2011 at 7:42 PM, H.J. Lu hjl.to...@gmail.com wrote:
 On Mon, Oct 17, 2011 at 7:49 AM, Kirill Yukhin kirill.yuk...@gmail.com 
 wrote:
 Thanks, guys, could anybody please commit that?


 I checked it in for you.


 --
 H.J.



Re: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.

2011-10-17 Thread Kirill Yukhin
Thanks for inputs, Jakub!

I am attaching updated patch.

Updated testsuite/ChangeLog entry:
2011-10-17  Kirill Yukhin  kirill.yuk...@intel.com

* gcc.target/i386/avx2-vpop-check.h: New header.
* gcc.target/i386/avx2-vpaddd-3.c: New test.
* gcc.target/i386/avx2-vpaddw-3.c: Ditto.
* gcc.target/i386/avx2-vpaddb-3.c: Ditto.
* gcc.target/i386/avx2-vpaddq-3.c: Ditto.
* gcc.target/i386/avx2-vpand-3.c: Ditto.
* gcc.target/i386/avx2-vpmulld-3.c: Ditto.
* gcc.target/i386/avx2-vpmullw-3.c: Ditto.
* gcc.target/i386/avx2-vpsrad-3.c: Ditto.
* gcc.target/i386/avx2-vpsraw-3.c: Ditto.
* gcc.target/i386/avx2-vpsrld-3.c: Ditto.
* gcc.target/i386/avx2-vpsrlw-3.c: Ditto.
* gcc.target/i386/avx2-vpsubb-3.c: Ditto.
* gcc.target/i386/avx2-vpsubd-3.c: Ditto.
* gcc.target/i386/avx2-vpsubq-3.c: Ditto.
* gcc.target/i386/avx2-vpsubw-3.c: Ditto.


Could you please guys have a look?

K


avx2.vect-3.tests.gcc.patch
Description: Binary data


Re: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.

2011-10-17 Thread Jakub Jelinek
On Mon, Oct 17, 2011 at 06:27:04PM +0400, Kirill Yukhin wrote:
 Thanks for inputs, Jakub!
 
 I am attaching updated patch.
 
 Updated testsuite/ChangeLog entry:
 2011-10-17  Kirill Yukhin  kirill.yuk...@intel.com
 
 * gcc.target/i386/avx2-vpop-check.h: New header.
 * gcc.target/i386/avx2-vpaddd-3.c: New test.
 * gcc.target/i386/avx2-vpaddw-3.c: Ditto.
 * gcc.target/i386/avx2-vpaddb-3.c: Ditto.
 * gcc.target/i386/avx2-vpaddq-3.c: Ditto.
 * gcc.target/i386/avx2-vpand-3.c: Ditto.
 * gcc.target/i386/avx2-vpmulld-3.c: Ditto.
 * gcc.target/i386/avx2-vpmullw-3.c: Ditto.
 * gcc.target/i386/avx2-vpsrad-3.c: Ditto.
 * gcc.target/i386/avx2-vpsraw-3.c: Ditto.
 * gcc.target/i386/avx2-vpsrld-3.c: Ditto.
 * gcc.target/i386/avx2-vpsrlw-3.c: Ditto.
 * gcc.target/i386/avx2-vpsubb-3.c: Ditto.
 * gcc.target/i386/avx2-vpsubd-3.c: Ditto.
 * gcc.target/i386/avx2-vpsubq-3.c: Ditto.
 * gcc.target/i386/avx2-vpsubw-3.c: Ditto.
 
 
 Could you please guys have a look?

This is ok for the trunk.

Jakub


Re: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.

2011-10-17 Thread Kirill Yukhin
Thanks, guys, could anybody please commit that?

K

On Mon, Oct 17, 2011 at 6:33 PM, Jakub Jelinek ja...@redhat.com wrote:
 On Mon, Oct 17, 2011 at 06:27:04PM +0400, Kirill Yukhin wrote:
 Thanks for inputs, Jakub!

 I am attaching updated patch.

 Updated testsuite/ChangeLog entry:
 2011-10-17  Kirill Yukhin  kirill.yuk...@intel.com

         * gcc.target/i386/avx2-vpop-check.h: New header.
         * gcc.target/i386/avx2-vpaddd-3.c: New test.
         * gcc.target/i386/avx2-vpaddw-3.c: Ditto.
         * gcc.target/i386/avx2-vpaddb-3.c: Ditto.
         * gcc.target/i386/avx2-vpaddq-3.c: Ditto.
         * gcc.target/i386/avx2-vpand-3.c: Ditto.
         * gcc.target/i386/avx2-vpmulld-3.c: Ditto.
         * gcc.target/i386/avx2-vpmullw-3.c: Ditto.
         * gcc.target/i386/avx2-vpsrad-3.c: Ditto.
         * gcc.target/i386/avx2-vpsraw-3.c: Ditto.
         * gcc.target/i386/avx2-vpsrld-3.c: Ditto.
         * gcc.target/i386/avx2-vpsrlw-3.c: Ditto.
         * gcc.target/i386/avx2-vpsubb-3.c: Ditto.
         * gcc.target/i386/avx2-vpsubd-3.c: Ditto.
         * gcc.target/i386/avx2-vpsubq-3.c: Ditto.
         * gcc.target/i386/avx2-vpsubw-3.c: Ditto.


 Could you please guys have a look?

 This is ok for the trunk.

        Jakub



Re: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.

2011-10-14 Thread Jakub Jelinek
On Fri, Oct 14, 2011 at 03:13:45PM +0400, Kirill Yukhin wrote:

--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c
@@ -0,0 +1,49 @@
+/* { dg-do run } */
+/* { dg-options -mavx2 -O2 -ftree-vectorize -save-temps } */
+/* { dg-require-effective-target avx2 } */
+
...
+
+/* { dg-final { scan-assembler-times vpaddb\[ \\t\]+\[^\n\]*%ymm\[0-9\] 1 } 
} */

You need
/* { dg-final { cleanup-saved-temps } } */
in all the testcases compiled with -save-temps. 

Jakub


Re: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.

2011-10-14 Thread Kirill Yukhin
Thanks, done.

Anything else?

K

On Fri, Oct 14, 2011 at 3:53 PM, Jakub Jelinek ja...@redhat.com wrote:
 On Fri, Oct 14, 2011 at 03:13:45PM +0400, Kirill Yukhin wrote:

 --- /dev/null
 +++ b/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c
 @@ -0,0 +1,49 @@
 +/* { dg-do run } */
 +/* { dg-options -mavx2 -O2 -ftree-vectorize -save-temps } */
 +/* { dg-require-effective-target avx2 } */
 +
 ...
 +
 +/* { dg-final { scan-assembler-times vpaddb\[ \\t\]+\[^\n\]*%ymm\[0-9\] 1 
 } } */

 You need
 /* { dg-final { cleanup-saved-temps } } */
 in all the testcases compiled with -save-temps.

        Jakub



avx2.vect-2.tests.gcc.patch
Description: Binary data


Re: [PATCH, i386 tests] New tests to check vectorization for AVX2 insns.

2011-10-14 Thread Jakub Jelinek
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