Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512bw-vpmovwb-1.c
blobe67da87b33d29bbb21daafc1f543cf2b255ca4e4
1 /* { dg-do compile } */
2 /* { dg-options "-mavx512bw -mavx512vl -O2" } */
3 /* { dg-additional-options "-fno-common" { target *-*-darwin* } } */
4 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
5 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
6 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */
7 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*res1\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
8 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
9 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
10 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */
11 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*res2\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
12 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
13 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
14 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */
15 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*res3\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
17 #include <immintrin.h>
19 volatile __m128i x, z, res1;
20 volatile __m256i y, res2;
21 volatile __m512i u, res3;
22 volatile __mmask8 m1;
23 volatile __mmask16 m2;
24 volatile __mmask32 m3;
26 void extern
27 avx512bw_test (void)
29 z = _mm_cvtepi16_epi8 (x);
30 z = _mm_mask_cvtepi16_epi8 (z, m1, x);
31 z = _mm_maskz_cvtepi16_epi8 (m1, x);
32 _mm_mask_cvtepi16_storeu_epi8 ((void *) &res1, m1, x);
33 z = _mm256_cvtepi16_epi8 (y);
34 z = _mm256_mask_cvtepi16_epi8 (z, m2, y);
35 z = _mm256_maskz_cvtepi16_epi8 (m2, y);
36 _mm256_mask_cvtepi16_storeu_epi8 ((void *) &res2, m2, y);
37 y = _mm512_cvtepi16_epi8 (u);
38 y = _mm512_mask_cvtepi16_epi8 (y, m3, u);
39 y = _mm512_maskz_cvtepi16_epi8 (m3, u);
40 _mm512_mask_cvtepi16_storeu_epi8 ((void *) &res3, m3, u);