1 /* { dg-do compile { target { ! ia32 } } } */ 2 /* { dg-options "-O2 -mavx512vl -mno-avx512dq" } */ 3 4 #include <x86intrin.h> 5 6 void f1(__m128i x)7f1 (__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 "vinserti32x4\[^\n\r]*(xmm16\[^\n\r]*ymm16\[^\n\r]*ymm16|ymm16\[^\n\r]*ymm16\[^\n\r]*xmm16)" } } */ 20 21 void f2(__m128i * x)22f2 (__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 "vbroadcasti32x4\[^\n\r]*ymm16" } } */ 30 31 void f3(__m128 * x)32f3 (__m128 *x) 33 { 34 register __m256 a __asm ("xmm16"); 35 a = _mm256_broadcast_ps (x); 36 asm volatile ("" : "+v" (a)); 37 } 38 39 void f4(__m128d * x)40f4 (__m128d *x) 41 { 42 register __m256d a __asm ("xmm16"); 43 a = _mm256_broadcast_pd (x); 44 asm volatile ("" : "+v" (a)); 45 } 46 47 /* { dg-final { scan-assembler-times "vbroadcastf32x4\[^\n\r]*ymm16" 2 } } */ 48