blob: 54148384f785fe67cc4a9634a76af5ba063c0d10 (
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
|
/* { dg-require-effective-target vect_int } */
#include <stdarg.h>
#include "tree-vect.h"
#define A 3
#define N 256
short src[N], dst[N];
void foo (short * __restrict__ dst, short * __restrict__ src, int h,
int stride, int dummy)
{
int i;
h /= 8;
for (i = 0; i < h; i++)
{
dst[0] += A*src[0];
dst[1] += A*src[1];
dst[2] += A*src[2];
dst[3] += A*src[3];
dst[4] += A*src[4];
dst[5] += A*src[5];
dst[6] += A*src[6];
dst[7] += A*src[7];
dst += stride;
src += stride;
if (dummy == 32)
abort ();
}
}
int main (void)
{
int i;
check_vect ();
for (i = 0; i < N; i++)
{
dst[i] = 0;
src[i] = i;
}
foo (dst, src, N, 8, 0);
for (i = 0; i < N; i++)
{
if (dst[i] != A * i)
abort ();
}
return 0;
}
/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { target vect_element_align } } } */
/* { dg-final { cleanup-tree-dump "slp1" } } */
/* { dg-final { cleanup-tree-dump "slp2" } } */
|