1 /* { dg-do compile } */
2 /* { dg-options "-mavx512dq -mavx512vl -O2" } */
3 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)"  1 } } */
4 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)"  1 } } */
5 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)"  1 } } */
6 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
7 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
8 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
9 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
10 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
11 /* { dg-final { scan-assembler-times "vreduceps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
12 
13 #include <immintrin.h>
14 
15 #define IMM 123
16 
17 volatile __m512 x1;
18 volatile __m256 x2;
19 volatile __m128 x3;
20 volatile __mmask16 m16;
21 volatile __mmask8 m8;
22 
23 void extern
avx512dq_test(void)24 avx512dq_test (void)
25 {
26   x1 = _mm512_reduce_ps (x1, IMM);
27   x2 = _mm256_reduce_ps (x2, IMM);
28   x3 = _mm_reduce_ps (x3, IMM);
29 
30   x1 = _mm512_mask_reduce_ps (x1, m16, x1, IMM);
31   x2 = _mm256_mask_reduce_ps (x2, m8, x2, IMM);
32   x3 = _mm_mask_reduce_ps (x3, m8, x3, IMM);
33 
34   x1 = _mm512_maskz_reduce_ps (m16, x1, IMM);
35   x2 = _mm256_maskz_reduce_ps (m8, x2, IMM);
36   x3 = _mm_maskz_reduce_ps (m8, x3, IMM);
37 }
38