aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vec-unpack.c
blob: 8dcdac7b06309b6b607a54c6eb1e14ed22be3dab (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
122
123
124
125
126
127
/* { dg-do compile } */
/* { dg-options "-O3 -mavx512f" } */

long long *D;
int *S;
short *H;
char *Q;

long long foo_unpack_1 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    D[i] *= S[i];

  return D[ind];
}

long long foo_unpack_2 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    D[i] *= H[i];

  return D[ind];
}

long long foo_unpack_3 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    D[i] *= Q[i];

  return D[ind];
}

int foo_unpack_4 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    S[i] *= H[i];

  return S[ind];
}

int foo_unpack_5 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    S[i] *= Q[i];

  return S[ind];
}

short foo_unpack_6 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    H[i] *= Q[i];

  return H[ind];
}

int foo_expand_1 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    S[i] *= D[i];

  return S[ind];
}

short foo_expand_2 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    H[i] *= D[i];

  return H[ind];
}

char foo_expand_3 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    Q[i] *= D[i];

  return Q[ind];
}

short foo_expand_4 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    H[i] *= S[i];

  return H[ind];
}

char foo_expand_5 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    Q[i] *= S[i];

  return Q[ind];
}

char foo_expand_6 (int low, int high, int ind)
{
  int i;

  for (i = low; i <= high; i++)
    Q[i] *= H[i];

  return Q[ind];
}