1 /* { dg-do compile { target { ! ia32 } } } */
2 /* { dg-options "-O2 -mavx512vl -mno-avx512dq -masm=att -mtune=haswell" } */
3 
4 typedef long long V __attribute__((vector_size (16)));
5 
6 void
f1(long long x,long long y)7 f1 (long long x, long long y)
8 {
9   register long long a __asm ("xmm16");
10   register V c __asm ("xmm17");
11   a = x;
12   asm volatile ("" : "+v" (a));
13   c = (V) { a, y };
14   asm volatile ("" : "+v" (c));
15 }
16 
17 /* { dg-final { scan-assembler-not "vpinsrq\[^\n\r]*\[^\n\r]*%xmm1\[6-9]" } } */
18 /* { dg-final { scan-assembler-not "vpinsrq\[^\n\r]*\[^\n\r]*%xmm\[23]\[0-9]" } } */
19 
20 void
f2(long long x,long long * y)21 f2 (long long x, long long *y)
22 {
23   register long long a __asm ("xmm18");
24   register V c __asm ("xmm19");
25   a = x;
26   asm volatile ("" : "+v" (a));
27   c = (V) { a, *y };
28   asm volatile ("" : "+v" (c));
29 }
30 
31 /* { dg-final { scan-assembler "vmovhps\[^\n\r]*%\[re]si\[^\n\r]*%xmm18\[^\n\r]*%xmm19" } } */
32 
33 void
f3(long long x)34 f3 (long long x)
35 {
36   register V a __asm ("xmm20");
37   a = (V) { x, 0 };
38   asm volatile ("" : "+v" (a));
39 }
40 
41 /* { dg-final { scan-assembler "vmov\[dq]\[^\n\r]*%rdi\[^\n\r]*%xmm20" } } */
42 
43 void
f4(long long * x)44 f4 (long long *x)
45 {
46   register V a __asm ("xmm21");
47   a = (V) { *x, 0 };
48   asm volatile ("" : "+v" (a));
49 }
50 
51 /* { dg-final { scan-assembler "vmovq\[^\n\r]*%\[re]di\[^\n\r]*%xmm21" } } */
52 
53 void
f5(long long x)54 f5 (long long x)
55 {
56   register long long a __asm ("xmm22");
57   register V c __asm ("xmm23");
58   a = x;
59   asm volatile ("" : "+v" (a));
60   c = (V) { a, 0 };
61   asm volatile ("" : "+v" (c));
62 }
63 
64 /* { dg-final { scan-assembler "vmovq\[^\n\r]*%xmm22\[^\n\r]*%xmm23" } } */
65 
66 void
f6(long long x,long long y)67 f6 (long long x, long long y)
68 {
69   register long long a __asm ("xmm24");
70   register long long b __asm ("xmm25");
71   register V c __asm ("xmm26");
72   a = x;
73   b = y;
74   asm volatile ("" : "+v" (a), "+v" (b));
75   c = (V) { a, b };
76   asm volatile ("" : "+v" (c));
77 }
78 
79 /* { dg-final { scan-assembler "vpunpcklqdq\[^\n\r]*%xmm25\[^\n\r]*%xmm24\[^\n\r]*%xmm26" } } */
80