From 80effa00835d53962608a3607ef79da243a6dc5a Mon Sep 17 00:00:00 2001
From: liuhongt <hongtao.liu@intel.com>
Date: Mon, 31 Aug 2020 10:54:13 +0800
Subject: [PATCH] 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.
---
.../g++.target/i386/avx512bw-pr96246-2.C | 9 +++++---
.../g++.target/i386/avx512f-helper.h | 1 +
.../g++.target/i386/avx512vl-pr96246-2.C | 21 +++++++++++++------
.../gcc.target/i386/avx512bw-pr95488-1.c | 2 +-
gcc/testsuite/gcc.target/i386/pr92645-4.c | 2 +-
.../gcc.target/i386/pr92658-avx512f.c | 2 +-
6 files changed, 25 insertions(+), 12 deletions(-)
create mode 100644 gcc/testsuite/g++.target/i386/avx512f-helper.h
@@ -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;
}
new file mode 100644
@@ -0,0 +1 @@
+#include "../../gcc.target/i386/avx512f-helper.h"
@@ -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);
}
@@ -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 } } */
@@ -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)));
@@ -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)));
--
2.18.1