aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2020-08-31 10:54:13 +0800
committerliuhongt <hongtao.liu@intel.com>2020-09-03 10:25:50 +0800
commit8bd5530bfa136663f1fa79e9a1d3932b5adf15bd (patch)
treeae2df4ccdd5a66178593995654aec1ddf327a544 /gcc
parent6a8f4e47c91c70707ec428e5c8b5cf01196464b2 (diff)
downloadgcc-8bd5530bfa136663f1fa79e9a1d3932b5adf15bd.zip
gcc-8bd5530bfa136663f1fa79e9a1d3932b5adf15bd.tar.gz
gcc-8bd5530bfa136663f1fa79e9a1d3932b5adf15bd.tar.bz2
Adjust testcase.
gcc/testsuite/ChangeLog: PR target/96246 PR target/96855 PR target/96856 PR target/96857 * g++.target/i386/avx512bw-pr96246-2.C: Add runtime check for AVX512BW. * g++.target/i386/avx512vl-pr96246-2.C: Add runtime check for AVX512BW and AVX512VL * g++.target/i386/avx512f-helper.h: New header. * gcc.target/i386/pr92658-avx512f.c: Add -mprefer-vector-width=512 to avoid impact of different default mtune which gcc is built with. * gcc.target/i386/avx512bw-pr95488-1.c: Ditto. * gcc.target/i386/pr92645-4.c: Add -mno-avx512f to avoid impact of different default march which gcc is built with.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C9
-rw-r--r--gcc/testsuite/g++.target/i386/avx512f-helper.h1
-rw-r--r--gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C21
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92645-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92658-avx512f.c2
6 files changed, 25 insertions, 12 deletions
diff --git a/gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C b/gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C
index b96b7c7..30a1b959 100644
--- a/gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C
+++ b/gcc/testsuite/g++.target/i386/avx512bw-pr96246-2.C
@@ -3,6 +3,10 @@
/* { dg-require-effective-target avx512bw } */
/* { dg-options "-O2 -std=c++14 -mavx512bw" } */
+#define AVX512BW
+
+#include "avx512f-helper.h"
+
#include "avx512bw-pr96246-1.C"
#define RUNTIME_TEST(vtype, num) \
@@ -24,8 +28,8 @@
} \
while (0)
-int
-main (void)
+void
+test_512 (void)
{
RUNTIME_TEST (v64qi, 64);
RUNTIME_TEST (v32hi, 32);
@@ -33,5 +37,4 @@ main (void)
RUNTIME_TEST (v8di, 8);
RUNTIME_TEST (v16sf, 16);
RUNTIME_TEST (v8df, 8);
- return 0;
}
diff --git a/gcc/testsuite/g++.target/i386/avx512f-helper.h b/gcc/testsuite/g++.target/i386/avx512f-helper.h
new file mode 100644
index 0000000..09b6bcb
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/avx512f-helper.h
@@ -0,0 +1 @@
+#include "../../gcc.target/i386/avx512f-helper.h"
diff --git a/gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C b/gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C
index 9a16f0d..db9dce2 100644
--- a/gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C
+++ b/gcc/testsuite/g++.target/i386/avx512vl-pr96246-2.C
@@ -4,6 +4,11 @@
/* { dg-require-effective-target avx512vl } */
/* { dg-options "-O2 -std=c++14 -mavx512bw -mavx512vl" } */
+#define AVX512VL
+#define AVX512BW
+
+#include "avx512f-helper.h"
+
#include "avx512vl-pr96246-1.C"
#define RUNTIME_TEST(vtype, num) \
@@ -25,17 +30,21 @@
} \
while (0)
-int
-main (void)
+void
+test_256 (void)
{
- RUNTIME_TEST (v16qi, 16);
RUNTIME_TEST (v32qi, 32);
RUNTIME_TEST (v16hi, 16);
- RUNTIME_TEST (v4si, 4);
RUNTIME_TEST (v8si, 8);
- RUNTIME_TEST (v4sf, 4);
RUNTIME_TEST (v8sf, 8);
RUNTIME_TEST (v4di, 4);
RUNTIME_TEST (v4df, 4);
- return 0;
+}
+
+void
+test_128 (void)
+{
+ RUNTIME_TEST (v16qi, 16);
+ RUNTIME_TEST (v4si, 4);
+ RUNTIME_TEST (v4sf, 4);
}
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c
index 594e511..e6e0ac2 100644
--- a/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr95488-1.c
@@ -1,6 +1,6 @@
/* PR target/95488 */
/* { dg-do compile } */
-/* { dg-options "-O2 -mavx512bw" } */
+/* { dg-options "-O2 -mavx512bw -mprefer-vector-width=512" } */
/* { dg-final { scan-assembler-times "vpmovzxbw" 4 } } */
/* { dg-final { scan-assembler-times "vpmullw\[^\n\]*zmm" 2 } } */
/* { dg-final { scan-assembler-times "vpmovwb" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr92645-4.c b/gcc/testsuite/gcc.target/i386/pr92645-4.c
index 5d45904..28a3f9a 100644
--- a/gcc/testsuite/gcc.target/i386/pr92645-4.c
+++ b/gcc/testsuite/gcc.target/i386/pr92645-4.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -mavx2 -fdump-tree-optimized -Wno-psabi" } */
+/* { dg-options "-O2 -mavx2 -fdump-tree-optimized -Wno-psabi -mno-avx512f" } */
typedef unsigned int u32v4 __attribute__((vector_size(16)));
typedef unsigned short u16v16 __attribute__((vector_size(32)));
diff --git a/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c b/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c
index 2ba2907..e9ee3d2 100644
--- a/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c
+++ b/gcc/testsuite/gcc.target/i386/pr92658-avx512f.c
@@ -1,6 +1,6 @@
/* PR target/92658 */
/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -mavx512f" } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512f -mprefer-vector-width=512" } */
typedef unsigned char v8qi __attribute__((vector_size (8)));
typedef unsigned char v16qi __attribute__((vector_size (16)));