IVOPT performance tuning patch. The main problem is a variant of maximal weight
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-strided-a-mult.c
blobc88814297ec5f652ac1832748afde0030f5d50e6
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
8 typedef struct {
9 unsigned short a;
10 unsigned short b;
11 } s;
13 typedef struct {
14 unsigned int a;
15 unsigned int b;
16 } ii;
18 __attribute__ ((noinline)) int
19 main1 ()
21 s arr[N];
22 s *ptr = arr;
23 ii iarr[N];
24 ii *iptr = iarr;
25 s res[N];
26 ii ires[N];
27 int i;
29 for (i = 0; i < N; i++)
31 arr[i].a = i;
32 arr[i].b = i * 2;
33 iarr[i].a = i;
34 iarr[i].b = i * 3;
35 if (arr[i].a == 178)
36 abort();
39 for (i = 0; i < N; i++)
41 ires[i].a = iptr->b - iptr->a;
42 ires[i].b = iptr->b + iptr->a;
43 res[i].b = ptr->b - ptr->a;
44 res[i].a = ptr->b + ptr->a;
45 iptr++;
46 ptr++;
49 /* check results: */
50 for (i = 0; i < N; i++)
52 if (res[i].b != arr[i].b - arr[i].a
53 || ires[i].a != iarr[i].b - iarr[i].a
54 || res[i].a != arr[i].b + arr[i].a
55 || ires[i].b != iarr[i].b + iarr[i].a
57 abort ();
60 return 0;
63 int main (void)
65 int i;
67 check_vect ();
69 main1 ();
71 return 0;
74 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
75 /* { dg-final { cleanup-tree-dump "vect" } } */