Initial support for AVX-512{VL,BW,DQ}
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512bw-vpermt2w-1.c
blob1596695251cd357367b460b47034fd0a6fafb7ec
1 /* { dg-do compile } */
2 /* { dg-options "-mavx512bw -mavx512vl -O2" } */
3 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%zmm\[0-9\]" 3 } } */
4 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 3 } } *
5 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%xmm\[0-9\]" 3 } } */
6 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%zmm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */
7 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%ymm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */
8 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%xmm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */
9 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%zmm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */
10 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%ymm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */
11 /* { dg-final { scan-assembler-times "vpermt2w\[ \\t\]+\[^\n\]*%xmm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */
13 #include <immintrin.h>
15 volatile __m512i x3;
16 volatile __m256i x2;
17 volatile __m128i x1;
18 volatile __m512i z;
19 volatile __m256i y;
20 volatile __m128i x;
21 volatile __mmask32 m3;
22 volatile __mmask16 m2;
23 volatile __mmask8 m1;
25 void extern
26 avx512bw_test (void)
28 x3 = _mm512_permutex2var_epi16 (x3, z, x3);
29 x3 = _mm512_mask_permutex2var_epi16 (x3, m3, z, x3);
30 x3 = _mm512_maskz_permutex2var_epi16 (m3, x3, z, x3);
31 x2 = _mm256_permutex2var_epi16 (x2, y, x2);
32 x2 = _mm256_mask_permutex2var_epi16 (x2, m2, y, x2);
33 x2 = _mm256_maskz_permutex2var_epi16 (m2, x2, y, x2);
34 x1 = _mm_permutex2var_epi16 (x1, x, x1);
35 x1 = _mm_mask_permutex2var_epi16 (x1, m1, x, x1);
36 x1 = _mm_maskz_permutex2var_epi16 (m1, x1, x, x1);