1 /* { dg-do compile { target { ! ia32 } } } */
2 /* { dg-options "-O2 -mavx512vl -mavx512dq" } */
3 
4 #include <x86intrin.h>
5 
6 void
f1(__m128i x)7 f1 (__m128i x)
8 {
9   register __m128i a __asm ("xmm16");
10   register __m256i c;
11   a = x;
12   asm volatile ("" : "+v" (a));
13   c = _mm256_broadcastsi128_si256 (a);
14   register __m256i b __asm ("xmm16");
15   b = c;
16   asm volatile ("" : "+v" (b));
17 }
18 
19 /* { dg-final { scan-assembler "vinserti64x2\[^\n\r]*(xmm16\[^\n\r]*ymm16\[^\n\r]*ymm16|ymm16\[^\n\r]*ymm16\[^\n\r]*xmm16)" } } */
20 
21 void
f2(__m128i * x)22 f2 (__m128i *x)
23 {
24   register __m256i a __asm ("xmm16");
25   a = _mm256_broadcastsi128_si256 (*x);
26   asm volatile ("" : "+v" (a));
27 }
28 
29 /* { dg-final { scan-assembler "vbroadcasti64x2\[^\n\r]*ymm16" } } */
30 
31 void
f3(__m128 * x)32 f3 (__m128 *x)
33 {
34   register __m256 a __asm ("xmm16");
35   a = _mm256_broadcast_ps (x);
36   asm volatile ("" : "+v" (a));
37 }
38 
39 /* { dg-final { scan-assembler "vbroadcastf32x4\[^\n\r]*ymm16" } } */
40 
41 void
f4(__m128d * x)42 f4 (__m128d *x)
43 {
44   register __m256d a __asm ("xmm16");
45   a = _mm256_broadcast_pd (x);
46   asm volatile ("" : "+v" (a));
47 }
48 
49 /* { dg-final { scan-assembler "vbroadcastf64x2\[^\n\r]*ymm16" } } */
50