1 /* { dg-do compile { target { ! ia32 } } } */
2 /* { dg-options "-O2 -mavx512vl -mavx512dq -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 "vpinsrq\[^\n\r]*\\\$1\[^\n\r]*%rsi\[^\n\r]*%xmm16\[^\n\r]*%xmm17" } } */
18 
19 void
f2(long long x,long long * y)20 f2 (long long x, long long *y)
21 {
22   register long long a __asm ("xmm18");
23   register V c __asm ("xmm19");
24   a = x;
25   asm volatile ("" : "+v" (a));
26   c = (V) { a, *y };
27   asm volatile ("" : "+v" (c));
28 }
29 
30 /* { dg-final { scan-assembler "vpinsrq\[^\n\r]*\\\$1\[^\n\r]*%\[re]si\[^\n\r]*%xmm18\[^\n\r]*%xmm19" } } */
31 
32 void
f3(long long x)33 f3 (long long x)
34 {
35   register V a __asm ("xmm20");
36   a = (V) { x, 0 };
37   asm volatile ("" : "+v" (a));
38 }
39 
40 /* { dg-final { scan-assembler "vmov\[dq]\[^\n\r]*%rdi\[^\n\r]*%xmm20" } } */
41 
42 void
f4(long long * x)43 f4 (long long *x)
44 {
45   register V a __asm ("xmm21");
46   a = (V) { *x, 0 };
47   asm volatile ("" : "+v" (a));
48 }
49 
50 /* { dg-final { scan-assembler "vmovq\[^\n\r]*%\[re]di\[^\n\r]*%xmm21" } } */
51 
52 void
f5(long long x)53 f5 (long long x)
54 {
55   register long long a __asm ("xmm22");
56   register V c __asm ("xmm23");
57   a = x;
58   asm volatile ("" : "+v" (a));
59   c = (V) { a, 0 };
60   asm volatile ("" : "+v" (c));
61 }
62 
63 /* { dg-final { scan-assembler "vmovq\[^\n\r]*%xmm22\[^\n\r]*%xmm23" } } */
64 
65 void
f6(long long x,long long y)66 f6 (long long x, long long y)
67 {
68   register long long a __asm ("xmm24");
69   register long long b __asm ("xmm25");
70   register V c __asm ("xmm26");
71   a = x;
72   b = y;
73   asm volatile ("" : "+v" (a), "+v" (b));
74   c = (V) { a, b };
75   asm volatile ("" : "+v" (c));
76 }
77 
78 /* { dg-final { scan-assembler "vpunpcklqdq\[^\n\r]*%xmm25\[^\n\r]*%xmm24\[^\n\r]*%xmm26" } } */
79