Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-41.c
blob2ad9fd2077231a0124c7fe2aaf37570a3a10f849
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_pack_trunc } */
3 /* { dg-require-effective-target vect_unpack } */
4 /* { dg-require-effective-target vect_hw_misalign } */
6 #include "tree-vect.h"
8 void __attribute__((noinline,noclone))
9 testi (int *p, short *q, int stride, int n)
11 int i;
12 for (i = 0; i < n; ++i)
14 q[i*4+0] = p[i*stride+0];
15 q[i*4+1] = p[i*stride+1];
16 q[i*4+2] = p[i*stride+2];
17 q[i*4+3] = p[i*stride+3];
21 void __attribute__((noinline,noclone))
22 testi2 (int *q, short *p, int stride, int n)
24 int i;
25 for (i = 0; i < n; ++i)
27 q[i*4+0] = p[i*stride+0];
28 q[i*4+1] = p[i*stride+1];
29 q[i*4+2] = p[i*stride+2];
30 q[i*4+3] = p[i*stride+3];
34 int ia[256];
35 short sa[256];
37 extern void abort (void);
39 int main()
41 int i;
43 check_vect ();
45 for (i = 0; i < 256; ++i)
47 ia[i] = sa[i] = i;
48 __asm__ volatile ("");
50 testi (ia, sa, 8, 32);
51 for (i = 0; i < 128; ++i)
52 if (sa[i] != ia[(i / 4) * 8 + i % 4])
53 abort ();
55 for (i = 0; i < 256; ++i)
57 ia[i] = sa[i] = i;
58 __asm__ volatile ("");
60 testi2 (ia, sa, 8, 32);
61 for (i = 0; i < 128; ++i)
62 if (ia[i] != sa[(i / 4) * 8 + i % 4])
63 abort ();
65 return 0;
68 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */