PR rtl-optimization/87918
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512dq-vbroadcast-2.c
blob645765696e0b7a199ebbe514aa248ff5b7f834c7
1 /* { dg-do compile { target { ! ia32 } } } */
2 /* { dg-options "-O2 -mavx512vl -mavx512dq" } */
4 #include <x86intrin.h>
6 void
7 f1 (__m128i x)
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));
19 /* { dg-final { scan-assembler "vinserti64x2\[^\n\r]*(xmm16\[^\n\r]*ymm16\[^\n\r]*ymm16|ymm16\[^\n\r]*ymm16\[^\n\r]*xmm16)" } } */
21 void
22 f2 (__m128i *x)
24 register __m256i a __asm ("xmm16");
25 a = _mm256_broadcastsi128_si256 (*x);
26 asm volatile ("" : "+v" (a));
29 /* { dg-final { scan-assembler "vbroadcasti64x2\[^\n\r]*ymm16" } } */
31 void
32 f3 (__m128 *x)
34 register __m256 a __asm ("xmm16");
35 a = _mm256_broadcast_ps (x);
36 asm volatile ("" : "+v" (a));
39 /* { dg-final { scan-assembler "vbroadcastf32x4\[^\n\r]*ymm16" } } */
41 void
42 f4 (__m128d *x)
44 register __m256d a __asm ("xmm16");
45 a = _mm256_broadcast_pd (x);
46 asm volatile ("" : "+v" (a));
49 /* { dg-final { scan-assembler "vbroadcastf64x2\[^\n\r]*ymm16" } } */