2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512f-vec-init.c
blobc00fa42757126852cc9dbcc972c03e40b681c0a7
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -mavx512f" } */
3 /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 0 } } */
4 /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
5 /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
6 /* { dg-final { scan-assembler-times "vpbroadcastq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
7 /* { dg-final { scan-assembler-times "vpbroadcastq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
8 /* { dg-final { scan-assembler-times "vpbroadcastq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
9 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */
10 /* { dg-final { scan-assembler-times "vpbroadcastb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
11 /* { dg-final { scan-assembler-times "vpbroadcastw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */
12 /* { dg-final { scan-assembler-times "vpbroadcastw\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
13 /* { dg-final { scan-assembler-times "vbroadcastss\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 0 } } */
14 /* { dg-final { scan-assembler-times "vbroadcastsd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 0 } } */
16 #include <x86intrin.h>
18 typedef char __v64qi __attribute__ ((vector_size (64)));
19 typedef short __v32hi __attribute__ ((vector_size (64)));
21 __v64qi foo_1 (char c)
23 __v64qi v1 = {
24 c, c, c, c, c, c, c, c,
25 c, c, c, c, c, c, c, c,
26 c, c, c, c, c, c, c, c,
27 c, c, c, c, c, c, c, c,
28 c, c, c, c, c, c, c, c,
29 c, c, c, c, c, c, c, c,
30 c, c, c, c, c, c, c, c,
31 c, c, c, c, c, c, c, c
34 return v1;
37 __v32hi foo_2 (short c)
39 __v32hi v1 = {
40 c, c, c, c, c, c, c, c,
41 c, c, c, c, c, c, c, c,
42 c, c, c, c, c, c, c, c,
43 c, c, c, c, c, c, c, c
46 return v1;
49 __v16si foo_3 (int c)
51 __v16si v1 = {
52 c, c, c, c, c, c, c, c,
53 c, c, c, c, c, c, c, c
56 return v1;
59 __v8di foo_4 (long long c)
61 __v8di v1 = {
62 c, c, c, c, c, c, c, c
65 return v1;
68 __v32qi foo_5 (char c)
70 __v32qi v1 = {
71 c, c, c, c, c, c, c, c,
72 c, c, c, c, c, c, c, c,
73 c, c, c, c, c, c, c, c,
74 c, c, c, c, c, c, c, c
77 return v1;
80 __v16hi foo_6 (short c)
82 __v16hi v1 = {
83 c, c, c, c, c, c, c, c,
84 c, c, c, c, c, c, c, c
87 return v1;
90 __v8si foo_7 (int c)
92 __v8si v1 = {
93 c, c, c, c, c, c, c, c
96 return v1;
99 __v4di foo_8 (long long c)
101 __v4di v1 = {
102 c, c, c, c
105 return v1;
109 __v16qi foo_9 (char c)
111 __v16qi v1 = {
112 c, c, c, c, c, c, c, c,
113 c, c, c, c, c, c, c, c
116 return v1;
119 __v8hi foo_10(short c)
121 __v8hi v1 = {
122 c, c, c, c, c, c, c, c
125 return v1;