aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512bw-vpmaddubsw-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512bw-vpmaddubsw-1.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-vpmaddubsw-1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmaddubsw-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpmaddubsw-1.c
new file mode 100644
index 00000000000..f4f41b58df7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmaddubsw-1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx512bw -mavx512vl -O2" } */
+/* { dg-final { scan-assembler-times "vpmaddubsw\[ \\t\]+\[^\n\]*%zmm\[0-9\]" 3 } } */
+/* { dg-final { scan-assembler-times "vpmaddubsw\[ \\t\]+\[^\n\]*%zmm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */
+/* { dg-final { scan-assembler-times "vpmaddubsw\[ \\t\]+\[^\n\]*%zmm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */
+/* { dg-final { scan-assembler-times "vpmaddubsw\[ \\t\]+\[^\n\]*%ymm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */
+/* { dg-final { scan-assembler-times "vpmaddubsw\[ \\t\]+\[^\n\]*%ymm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */
+/* { dg-final { scan-assembler-times "vpmaddubsw\[ \\t\]+\[^\n\]*%xmm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */
+/* { dg-final { scan-assembler-times "vpmaddubsw\[ \\t\]+\[^\n\]*%xmm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */
+
+#include <immintrin.h>
+
+volatile __m512i x;
+volatile __m256i xq;
+volatile __m128i xw;
+
+void extern
+avx512bw_test (void)
+{
+ x = _mm512_maddubs_epi16 (x, x);
+ x = _mm512_mask_maddubs_epi16 (x, 2, x, x);
+ x = _mm512_maskz_maddubs_epi16 (2, x, x);
+ xq = _mm256_mask_maddubs_epi16 (xq, 2, xq, xq);
+ xq = _mm256_maskz_maddubs_epi16 (2, xq, xq);
+ xw = _mm_mask_maddubs_epi16 (xw, 2, xw, xw);
+ xw = _mm_maskz_maddubs_epi16 (2, xw, xw);
+}