i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-40.c
blob746ad5fe455b5ec9218e3e98c3d53c55cd44be9d
1 /* { dg-require-effective-target vect_float } */
2 /* { dg-add-options double_vectors } */
3 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #define N 256
10 __attribute__ ((noinline))
11 void bar (float *pa, float *pb, float *pc)
13 int i;
15 /* check results: */
16 #pragma GCC novector
17 for (i = 0; i < N; i++)
19 if (pa[i] != (pb[i] * pc[i]))
20 abort ();
23 return;
26 /* Aligned pointer accesses.
27 The loop bound is known and divisible by the vectorization factor.
28 No aliasing problems.
29 vect-46.c is similar to this one with one difference:
30 the loop bound is unknown. */
32 float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)))
33 = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
34 float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)))
35 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
37 __attribute__ ((noinline)) int
38 main1 ()
40 int i;
41 float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
42 float *pa = a;
43 float *pb = b;
44 float *pc = c;
46 for (i = 0; i < N; i++)
48 pa[i] = pb[i] * pc[i];
51 bar (pa,pb,pc);
53 return 0;
56 int main (void)
58 check_vect ();
59 main1 ();
60 return 0;
63 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */
64 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
65 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */