i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-6-big-array.c
blob8acab07fac4ab75787021692a5bff5e42ceb5875
1 /* { dg-require-effective-target vect_float } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 128
9 float results1[N];
10 float results2[N];
11 float a[N] = {0};
12 float e[N] = {0};
13 float b[N];
14 float c[N];
16 __attribute__ ((noinline))
17 int main1 ()
19 int i;
21 for (i=0; i<N; i++)
23 b[i] = i*3;
24 c[i] = i;
25 results1[i] = 0;
26 results2[i] = 0;
27 asm volatile ("" ::: "memory");
29 for (i=0; i<N/2; i++)
31 results1[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
32 results2[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
33 asm volatile ("" ::: "memory");
36 for (i = 0; i < N/2; i++)
38 a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
39 e[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
42 /* check results: */
43 #pragma GCC novector
44 for (i=0; i<N; i++)
46 if (a[i] != results1[i] || e[i] != results2[i])
47 abort ();
51 for (i = 1; i <=N-4; i++)
53 a[i+3] = b[i-1];
56 /* check results: */
57 #pragma GCC novector
58 for (i = 1; i <=N-4; i++)
60 if (a[i+3] != b[i-1])
61 abort ();
64 return 0;
67 int main (void)
69 check_vect ();
71 return main1 ();
74 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
75 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
76 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
77 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */