diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d44d2c5fa29..ff6cc272f91 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,22 @@ +2011-10-18 Kirill Yukhin + + * 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. + 2011-10-18 Mikael Morin PR fortran/50420 diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c new file mode 100644 index 00000000000..238f0209218 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE char +#define BIN_OP(a, b) ((a) + (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpaddb\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpaddd-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpaddd-3.c new file mode 100644 index 00000000000..c57ef8fea30 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpaddd-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE int +#define BIN_OP(a, b) ((a) + (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpaddd\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpaddq-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpaddq-3.c new file mode 100644 index 00000000000..801bd39d82f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpaddq-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE long long int +#define BIN_OP(a, b) ((a) + (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpaddq\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpaddw-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpaddw-3.c new file mode 100644 index 00000000000..facee9f2d57 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpaddw-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE short +#define BIN_OP(a, b) ((a) + (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpaddw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpand-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpand-3.c new file mode 100644 index 00000000000..67ca4a7cda1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpand-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE unsigned +#define BIN_OP(a, b) ((a) & (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpand\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpmulld-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpmulld-3.c new file mode 100644 index 00000000000..b2d539ba49a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpmulld-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE int +#define BIN_OP(a, b) ((a) * (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpmulld\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpmullw-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpmullw-3.c new file mode 100644 index 00000000000..46d173fc371 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpmullw-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE short +#define BIN_OP(a, b) ((a) * (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpmullw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpop-check.h b/gcc/testsuite/gcc.target/i386/avx2-vpop-check.h new file mode 100644 index 00000000000..143b54dae03 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpop-check.h @@ -0,0 +1,53 @@ +#include "avx2-check.h" + +#define SIZE 256 + +TYPE a[SIZE]; +TYPE b[SIZE]; +TYPE c[SIZE]; +volatile TYPE c_ref[SIZE]; + +__attribute__ ((__noinline__)) +void +gen_pop () +{ + int i; + for (i = 0; i < SIZE; ++i) +#ifdef BIN_OP + c[i] = BIN_OP (a[i], b[i]); +#else /* Must be UN_OP */ + c[i] = UN_OP (a[i]); +#endif /* BIN_OP */ +} + +void +check_pop () +{ + int i; + for (i = 0; i < SIZE; ++i) +#ifdef BIN_OP + c_ref[i] = BIN_OP (a[i], b[i]); +#else /* Must be UN_OP */ + c_ref[i] = UN_OP (a[i]); +#endif /* BIN_OP */ +} + +void static +avx2_test (void) +{ + int i, j; + for (i = 0; i < 4; ++i ) + { + for ( j = 0; j < SIZE; ++j ) + { + a[i] = i * i + i; + b[i] = i * i * i; + } + + gen_pop (); + check_pop (); + + if (memcmp (c, c_ref, SIZE * sizeof (TYPE))) + abort(); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpsrad-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpsrad-3.c new file mode 100644 index 00000000000..97affb4bb7e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpsrad-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE unsigned +#define UN_OP(a) ((a) >> (5)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpsrld\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpsraw-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpsraw-3.c new file mode 100644 index 00000000000..e7112565b3a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpsraw-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE short +#define UN_OP(a) ((a) >> (5)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpsraw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpsrld-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpsrld-3.c new file mode 100644 index 00000000000..97affb4bb7e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpsrld-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE unsigned +#define UN_OP(a) ((a) >> (5)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpsrld\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpsrlw-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpsrlw-3.c new file mode 100644 index 00000000000..67f3afc4131 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpsrlw-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE unsigned short +#define UN_OP(a) ((a) >> (5)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpsrlw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpsubb-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpsubb-3.c new file mode 100644 index 00000000000..843128b4f27 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpsubb-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE char +#define BIN_OP(a, b) ((a) - (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpsubb\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpsubd-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpsubd-3.c new file mode 100644 index 00000000000..f8f399f6b00 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpsubd-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE int +#define BIN_OP(a, b) ((a) - (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpsubd\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpsubq-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpsubq-3.c new file mode 100644 index 00000000000..0a23a280e52 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpsubq-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE long long int +#define BIN_OP(a, b) ((a) - (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpsubq\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpsubw-3.c b/gcc/testsuite/gcc.target/i386/avx2-vpsubw-3.c new file mode 100644 index 00000000000..1cb90b5a8e3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-vpsubw-3.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-mavx2 -O2 -ftree-vectorize -save-temps" } */ +/* { dg-require-effective-target avx2 } */ + + +#define TYPE short +#define BIN_OP(a, b) ((a) - (b)) + +#include "avx2-vpop-check.h" + +/* { dg-final { scan-assembler-times "vpsubw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */