summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512f-vec-init.c
blob: acbd34f3f36bee31014595a0dc52e6fbfe37f50a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* { dg-do compile } */
/* { dg-options "-O3 -mavx512f" } */
/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+%zmm" 2 } } */
/* { dg-final { scan-assembler-times "vpbroadcastd" 1 } } */
/* { dg-final { scan-assembler-times "vpbroadcastq" 1 } } */
/* { dg-final { scan-assembler-times "vpbroadcastb" 2 } } */
/* { dg-final { scan-assembler-times "vpbroadcastw" 2 } } */
/* { dg-final { scan-assembler-times "vbroadcastss" 1 } } */
/* { dg-final { scan-assembler-times "vbroadcastsd" 1 } } */

#include <x86intrin.h>

typedef char __v64qi __attribute__ ((vector_size (64)));
typedef short __v32hi __attribute__ ((vector_size (64)));

__v64qi foo_1 (char c)
{
  __v64qi v1 = {
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c
  };

  return v1;
}

__v32hi foo_2 (short c)
{
  __v32hi v1 = {
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c
  };

  return v1;
}

__v16si foo_3 (int c)
{
  __v16si v1 = {
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c
  };

  return v1;
}

__v8di foo_4 (long long c)
{
  __v8di v1 = {
      c, c, c, c, c, c, c, c
  };

  return v1;
}

__v32qi foo_5 (char c)
{
  __v32qi v1 = {
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c
  };

  return v1;
}

__v16hi foo_6 (short c)
{
  __v16hi v1 = {
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c
  };

  return v1;
}

__v8si foo_7 (int c)
{
  __v8si v1 = {
      c, c, c, c, c, c, c, c
  };

  return v1;
}

__v4di foo_8 (long long c)
{
  __v4di v1 = {
      c, c, c, c
  };

  return v1;
}


__v16qi foo_9 (char c)
{
  __v16qi v1 = {
      c, c, c, c, c, c, c, c,
      c, c, c, c, c, c, c, c
  };

  return v1;
}

__v8hi foo_10(short c)
{
  __v8hi v1 = {
      c, c, c, c, c, c, c, c
  };

  return v1;
}