1 /* { dg-do compile { target { ! ia32 } } } */ 2 /* { dg-options "-O2 -mavx512vl -mavx512bw" } */ 3 4 typedef char V1 __attribute__((vector_size (16))); 5 typedef short V2 __attribute__((vector_size (16))); 6 typedef char V5 __attribute__((vector_size (32))); 7 typedef short V6 __attribute__((vector_size (32))); 8 typedef int V7 __attribute__((vector_size (32))); 9 10 void f1(V1 x)11f1 (V1 x) 12 { 13 register V1 a __asm ("xmm16"); 14 a = x; 15 asm volatile ("" : "+v" (a)); 16 a = __builtin_shuffle (a, (V1) { 0 }); 17 asm volatile ("" : "+v" (a)); 18 } 19 20 /* { dg-final { scan-assembler "vpbroadcastb\[^\n\r]*xmm16\[^\n\r]*xmm16" } } */ 21 22 void f2(V2 x)23f2 (V2 x) 24 { 25 register V2 a __asm ("xmm16"); 26 a = x; 27 asm volatile ("" : "+v" (a)); 28 a = __builtin_shuffle (a, (V2) { 0 }); 29 asm volatile ("" : "+v" (a)); 30 } 31 32 /* { dg-final { scan-assembler "vpbroadcastw\[^\n\r]*xmm16\[^\n\r]*xmm16" } } */ 33 34 void f5(V5 x)35f5 (V5 x) 36 { 37 register V5 a __asm ("xmm16"); 38 a = x; 39 asm volatile ("" : "+v" (a)); 40 a = __builtin_shuffle (a, (V5) { 0 }); 41 asm volatile ("" : "+v" (a)); 42 } 43 44 /* { dg-final { scan-assembler "vpbroadcastb\[^\n\r]*(xmm16\[^\n\r]*ymm16|ymm16\[^\n\r]*xmm16)" } } */ 45 46 void f6(V6 x)47f6 (V6 x) 48 { 49 register V6 a __asm ("xmm16"); 50 a = x; 51 asm volatile ("" : "+v" (a)); 52 a = __builtin_shuffle (a, (V6) { 0 }); 53 asm volatile ("" : "+v" (a)); 54 } 55 56 /* { dg-final { scan-assembler "vpbroadcastw\[^\n\r]*(xmm16\[^\n\r]*ymm16|ymm16\[^\n\r]*xmm16)" } } */ 57 58 void f7(V7 x)59f7 (V7 x) 60 { 61 register V7 a __asm ("xmm16"); 62 a = x; 63 asm volatile ("" : "+v" (a)); 64 a = __builtin_shuffle (a, (V7) { 0 }); 65 asm volatile ("" : "+v" (a)); 66 } 67 68 /* { dg-final { scan-assembler "vpbroadcastd\[^\n\r]*(xmm16\[^\n\r]*ymm16|ymm16\[^\n\r]*xmm16)" } } */ 69