1 /* { dg-do compile { target { ! ia32 } } } */
2 /* { dg-options "-O2 -mavx512vl -mno-avx512bw" } */
3 
4 #include <x86intrin.h>
5 
6 void
f1(__m128i x)7 f1 (__m128i x)
8 {
9   register __m128i a __asm ("xmm16");
10   a = x;
11   asm volatile ("" : "+v" (a));
12   a = _mm_broadcastb_epi8 (a);
13   asm volatile ("" : "+v" (a));
14 }
15 
16 /* { dg-final { scan-assembler-not "vpbroadcastb\[^\n\r]*xmm16" } } */
17 
18 void
f2(__m128i x)19 f2 (__m128i x)
20 {
21   register __m128i a __asm ("xmm16");
22   a = x;
23   asm volatile ("" : "+v" (a));
24   a = _mm_broadcastw_epi16 (a);
25   asm volatile ("" : "+v" (a));
26 }
27 
28 /* { dg-final { scan-assembler-not "vpbroadcastw\[^\n\r]*xmm16" } } */
29 
30 void
f3(__m128i x)31 f3 (__m128i x)
32 {
33   register __m128i a __asm ("xmm16");
34   a = x;
35   asm volatile ("" : "+v" (a));
36   a = _mm_broadcastd_epi32 (a);
37   asm volatile ("" : "+v" (a));
38 }
39 
40 /* { dg-final { scan-assembler "vpbroadcastd\[^\n\r]*xmm16\[^\n\r]*xmm16" } } */
41 
42 void
f4(__m128i x)43 f4 (__m128i x)
44 {
45   register __m128i a __asm ("xmm16");
46   a = x;
47   asm volatile ("" : "+v" (a));
48   a = _mm_broadcastq_epi64 (a);
49   asm volatile ("" : "+v" (a));
50 }
51 
52 /* { dg-final { scan-assembler "vpbroadcastq\[^\n\r]*xmm16\[^\n\r]*xmm16" } } */
53 
54 void
f5(__m128i x)55 f5 (__m128i x)
56 {
57   register __m128i a __asm ("xmm16");
58   register __m256i b __asm ("xmm17");
59   a = x;
60   asm volatile ("" : "+v" (a));
61   b = _mm256_broadcastb_epi8 (a);
62   asm volatile ("" : "+v" (b));
63 }
64 
65 /* { dg-final { scan-assembler-not "vpbroadcastb\[^\n\r]*\[xy]mm1\[67]" } } */
66 
67 void
f6(__m128i x)68 f6 (__m128i x)
69 {
70   register __m128i a __asm ("xmm16");
71   register __m256i b __asm ("xmm17");
72   a = x;
73   asm volatile ("" : "+v" (a));
74   b = _mm256_broadcastw_epi16 (a);
75   asm volatile ("" : "+v" (b));
76 }
77 
78 /* { dg-final { scan-assembler-not "vpbroadcastw\[^\n\r]*\[xy]mm1\[67]" } } */
79 
80 void
f7(__m128i x)81 f7 (__m128i x)
82 {
83   register __m128i a __asm ("xmm16");
84   register __m256i b __asm ("xmm17");
85   a = x;
86   asm volatile ("" : "+v" (a));
87   b = _mm256_broadcastd_epi32 (a);
88   asm volatile ("" : "+v" (b));
89 }
90 
91 /* { dg-final { scan-assembler "vpbroadcastd\[^\n\r]*(xmm1\[67]\[^\n\r]*ymm1\[67]|ymm1\[67]\[^\n\r]*xmm1\[67])" } } */
92 
93 void
f8(__m128i x)94 f8 (__m128i x)
95 {
96   register __m128i a __asm ("xmm16");
97   register __m256i b __asm ("xmm17");
98   a = x;
99   asm volatile ("" : "+v" (a));
100   b = _mm256_broadcastq_epi64 (a);
101   asm volatile ("" : "+v" (b));
102 }
103 
104 /* { dg-final { scan-assembler "vpbroadcastq\[^\n\r]*(xmm1\[67]\[^\n\r]*ymm1\[67]|ymm1\[67]\[^\n\r]*xmm1\[67])" } } */
105