Newer
Older
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
typedef long long llong;
typedef char vchar64 __attribute__((__vector_size__(64 * sizeof(char))));
typedef char vchar32 __attribute__((__vector_size__(32 * sizeof(char))));
__attribute__((noinline)) __attribute__((noclone)) vchar32 test1char32(char c)
{
vchar32 v = { 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 v;
}
__attribute__((noinline)) __attribute__((noclone)) vchar32 test2char32(char * p)
{
char c = *p;
vchar32 v = { 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 v;
}
typedef char vchar16 __attribute__((__vector_size__(16 * sizeof(char))));
__attribute__((noinline)) __attribute__((noclone)) vchar16 test1char16(char c)
{
vchar16 v = { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vchar16 test2char16(char * p)
{
char c = *p;
vchar16 v = { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c };
return v;
}
typedef char vchar8 __attribute__((__vector_size__(8 * sizeof(char))));
__attribute__((noinline)) __attribute__((noclone)) vchar8 test1char8(char c)
{
vchar8 v = { c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vchar8 test2char8(char * p)
{
char c = *p;
vchar8 v = { c, c, c, c, c, c, c, c };
return v;
}
typedef char vchar4 __attribute__((__vector_size__(4 * sizeof(char))));
__attribute__((noinline)) __attribute__((noclone)) vchar4 test1char4(char c)
{
vchar4 v = { c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vchar4 test2char4(char * p)
{
char c = *p;
vchar4 v = { c, c, c, c };
return v;
}
typedef char vchar2 __attribute__((__vector_size__(2 * sizeof(char))));
__attribute__((noinline)) __attribute__((noclone)) vchar2 test1char2(char c)
{
vchar2 v = { c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vchar2 test2char2(char * p)
{
char c = *p;
vchar2 v = { c, c };
return v;
}
typedef char vchar1 __attribute__((__vector_size__(1 * sizeof(char))));
__attribute__((noinline)) __attribute__((noclone)) vchar1 test1char1(char c)
{
vchar1 v = { c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vchar1 test2char1(char * p)
{
char c = *p;
vchar1 v = { c };
return v;
}
typedef short vshort32 __attribute__((__vector_size__(32 * sizeof(short))));
__attribute__((noinline)) __attribute__((noclone)) vshort32 test1short32(short c)
{
vshort32 v = { 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 v;
}
__attribute__((noinline)) __attribute__((noclone)) vshort32 test2short32(short * p)
{
short c = *p;
vshort32 v = { 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 v;
}
typedef short vshort16 __attribute__((__vector_size__(16 * sizeof(short))));
__attribute__((noinline)) __attribute__((noclone)) vshort16 test1short16(short c)
{
vshort16 v = { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vshort16 test2short16(short * p)
{
short c = *p;
vshort16 v = { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c };
return v;
}
typedef short vshort8 __attribute__((__vector_size__(8 * sizeof(short))));
__attribute__((noinline)) __attribute__((noclone)) vshort8 test1short8(short c)
{
vshort8 v = { c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vshort8 test2short8(short * p)
{
short c = *p;
vshort8 v = { c, c, c, c, c, c, c, c };
return v;
}
typedef short vshort4 __attribute__((__vector_size__(4 * sizeof(short))));
__attribute__((noinline)) __attribute__((noclone)) vshort4 test1short4(short c)
{
vshort4 v = { c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vshort4 test2short4(short * p)
{
short c = *p;
vshort4 v = { c, c, c, c };
return v;
}
typedef short vshort2 __attribute__((__vector_size__(2 * sizeof(short))));
__attribute__((noinline)) __attribute__((noclone)) vshort2 test1short2(short c)
{
vshort2 v = { c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vshort2 test2short2(short * p)
{
short c = *p;
vshort2 v = { c, c };
return v;
}
typedef short vshort1 __attribute__((__vector_size__(1 * sizeof(short))));
__attribute__((noinline)) __attribute__((noclone)) vshort1 test1short1(short c)
{
vshort1 v = { c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vshort1 test2short1(short * p)
{
short c = *p;
vshort1 v = { c };
return v;
}
typedef int vint16 __attribute__((__vector_size__(16 * sizeof(int))));
__attribute__((noinline)) __attribute__((noclone)) vint16 test1int16(int c)
{
vint16 v = { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vint16 test2int16(int * p)
{
int c = *p;
vint16 v = { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c };
return v;
}
typedef int vint8 __attribute__((__vector_size__(8 * sizeof(int))));
__attribute__((noinline)) __attribute__((noclone)) vint8 test1int8(int c)
{
vint8 v = { c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vint8 test2int8(int * p)
{
int c = *p;
vint8 v = { c, c, c, c, c, c, c, c };
return v;
}
void test3int8(void)
{
int c = 17;
int i;
vint8 a = test1int8(c);
for (i = 0; i < 8; i++)
if (a[i] != 17)
__builtin_abort();
vint8 b = test2int8(&c);
for (i = 0; i < 8; i++)
if (a[i] != 17)
__builtin_abort();
}
typedef int vint4 __attribute__((__vector_size__(4 * sizeof(int))));
__attribute__((noinline)) __attribute__((noclone)) vint4 test1int4(int c)
{
vint4 v = { c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vint4 test2int4(int * p)
{
int c = *p;
vint4 v = { c, c, c, c };
return v;
}
typedef int vint2 __attribute__((__vector_size__(2 * sizeof(int))));
__attribute__((noinline)) __attribute__((noclone)) vint2 test1int2(int c)
{
vint2 v = { c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vint2 test2int2(int * p)
{
int c = *p;
vint2 v = { c, c };
return v;
}
typedef int vint1 __attribute__((__vector_size__(1 * sizeof(int))));
__attribute__((noinline)) __attribute__((noclone)) vint1 test1int1(int c)
{
vint1 v = { c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vint1 test2int1(int * p)
{
int c = *p;
vint1 v = { c };
return v;
}
typedef float vfloat16 __attribute__((__vector_size__(16 * sizeof(float))));
__attribute__((noinline)) __attribute__((noclone)) vfloat16 test1float16(float c)
{
vfloat16 v = { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vfloat16 test2float16(float * p)
{
float c = *p;
vfloat16 v = { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c };
return v;
}
typedef float vfloat8 __attribute__((__vector_size__(8 * sizeof(float))));
__attribute__((noinline)) __attribute__((noclone)) vfloat8 test1float8(float c)
{
vfloat8 v = { c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vfloat8 test2float8(float * p)
{
float c = *p;
vfloat8 v = { c, c, c, c, c, c, c, c };
return v;
}
typedef float vfloat4 __attribute__((__vector_size__(4 * sizeof(float))));
__attribute__((noinline)) __attribute__((noclone)) vfloat4 test1float4(float c)
{
vfloat4 v = { c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vfloat4 test2float4(float * p)
{
float c = *p;
vfloat4 v = { c, c, c, c };
return v;
}
typedef float vfloat2 __attribute__((__vector_size__(2 * sizeof(float))));
__attribute__((noinline)) __attribute__((noclone)) vfloat2 test1float2(float c)
{
vfloat2 v = { c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vfloat2 test2float2(float * p)
{
float c = *p;
vfloat2 v = { c, c };
return v;
}
typedef float vfloat1 __attribute__((__vector_size__(1 * sizeof(float))));
__attribute__((noinline)) __attribute__((noclone)) vfloat1 test1float1(float c)
{
vfloat1 v = { c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vfloat1 test2float1(float * p)
{
float c = *p;
vfloat1 v = { c };
return v;
}
typedef llong vllong8 __attribute__((__vector_size__(8 * sizeof(llong))));
__attribute__((noinline)) __attribute__((noclone)) vllong8 test1llong8(llong c)
{
vllong8 v = { c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vllong8 test2llong8(llong * p)
{
llong c = *p;
vllong8 v = { c, c, c, c, c, c, c, c };
return v;
}
typedef llong vllong4 __attribute__((__vector_size__(4 * sizeof(llong))));
__attribute__((noinline)) __attribute__((noclone)) vllong4 test1llong4(llong c)
{
vllong4 v = { c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vllong4 test2llong4(llong * p)
{
llong c = *p;
vllong4 v = { c, c, c, c };
return v;
}
typedef llong vllong2 __attribute__((__vector_size__(2 * sizeof(llong))));
__attribute__((noinline)) __attribute__((noclone)) vllong2 test1llong2(llong c)
{
vllong2 v = { c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vllong2 test2llong2(llong * p)
{
llong c = *p;
vllong2 v = { c, c };
return v;
}
typedef llong vllong1 __attribute__((__vector_size__(1 * sizeof(llong))));
__attribute__((noinline)) __attribute__((noclone)) vllong1 test1llong1(llong c)
{
vllong1 v = { c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vllong1 test2llong1(llong * p)
{
llong c = (llong) *test1char8;
vllong1 v = { c };
return v;
}
typedef double vdouble8 __attribute__((__vector_size__(8 * sizeof(double))));
__attribute__((noinline)) __attribute__((noclone)) vdouble8 test1double8(double c)
{
vdouble8 v = { c, c, c, c, c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vdouble8 test2double8(double * p)
{
double c = *p;
vdouble8 v = { c, c, c, c, c, c, c, c };
return v;
}
typedef double vdouble4 __attribute__((__vector_size__(4 * sizeof(double))));
__attribute__((noinline)) __attribute__((noclone)) vdouble4 test1double4(double c)
{
vdouble4 v = { c, c, c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vdouble4 test2double4(double * p)
{
double c = *p;
vdouble4 v = { c, c, c, c };
return v;
}
typedef double vdouble2 __attribute__((__vector_size__(2 * sizeof(double))));
__attribute__((noinline)) __attribute__((noclone)) vdouble2 test1double2(double c)
{
vdouble2 v = { c, c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vdouble2 test2double2(double * p)
{
double c = *p;
vdouble2 v = { c, c };
return v;
}
typedef double vdouble1 __attribute__((__vector_size__(1 * sizeof(double))));
__attribute__((noinline)) __attribute__((noclone)) vdouble1 test1double1(double c)
{
vdouble1 v = { c };
return v;
}
__attribute__((noinline)) __attribute__((noclone)) vdouble1 test2double1(double * p)
{
double c = *p;
vdouble1 v = { c };
return v;
}
int main()
{
test3int8();
return 0;
}