1 /* { dg-do compile } */
2 /* { dg-options "-mavx512fp16 -O2" } */
3 /* { dg-final { scan-assembler-times "vrndscaleph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
4 /* { dg-final { scan-assembler-times "vrndscaleph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
5 /* { dg-final { scan-assembler-times "vrndscaleph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
6 /* { dg-final { scan-assembler-times "vrndscaleph\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
7 /* { dg-final { scan-assembler-times "vrndscaleph\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
8 /* { dg-final { scan-assembler-times "vrndscaleph\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
9
10 #include <immintrin.h>
11
12 #define IMM 123
13
14 volatile __m512h x1;
15 volatile __mmask32 m;
16
17 void extern
18 avx512fp16_test (void)
19 {
20 x1 = _mm512_roundscale_ph (x1, IMM);
21 x1 = _mm512_mask_roundscale_ph (x1, m, x1, IMM);
22 x1 = _mm512_maskz_roundscale_ph (m, x1, IMM);
23 x1 = _mm512_roundscale_round_ph (x1, IMM, 8);
24 x1 = _mm512_mask_roundscale_round_ph (x1, m, x1, IMM, 8);
25 x1 = _mm512_maskz_roundscale_round_ph (m, x1, IMM, 8);
26 }