i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-recurr-5.c
blobc3dd8cbabc4e08e1e411fce85403448a6fec2e46
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_perm } */
4 #include "tree-vect.h"
6 void __attribute__((noipa))
7 foo (int * __restrict__ a, short * __restrict__ b, int * __restrict__ c)
9 int t1 = *c;
10 int t2 = *c;
11 for (int i = 0; i < 64; i+=2)
13 b[i] = a[i] - t1;
14 t1 = a[i];
15 b[i+1] = a[i+1] - t2;
16 t2 = a[i+1];
20 int a[64];
21 short b[64];
23 int
24 main ()
26 check_vect ();
27 for (int i = 0; i < 64; ++i)
29 a[i] = i;
30 __asm__ volatile ("" ::: "memory");
32 int c = 7;
33 foo (a, b, &c);
34 #pragma GCC novector
35 for (int i = 2; i < 64; i+=2)
36 if (b[i] != a[i] - a[i-2]
37 || b[i+1] != a[i+1] - a[i-1])
38 abort ();
39 if (b[0] != -7 || b[1] != -6)
40 abort ();
41 return 0;
44 /* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" } } */