LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-42.c
bloba65b4a622764ddb12fa986d0c70128df5804336e
1 /* { dg-require-effective-target vect_float } */
2 /* { dg-add-options double_vectors } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 256
9 __attribute__ ((noinline))
10 void bar (float *pa, float *pb, float *pc)
12 int i;
14 /* check results: */
15 for (i = 0; i < N; i++)
17 if (pa[i] != (pb[i] * pc[i]))
18 abort ();
21 return;
24 /* Unaligned write access, aligned read accesses.
25 Since we are handling an unaligned store by peeling the loop,
26 the loads will become unaligned.
27 The loop bound is known and divisible by the vectorization factor.
28 No aliasing problems. */
30 __attribute__ ((noinline)) int
31 main1 (float * __restrict__ pa, float *pb, float *pc)
33 float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
34 float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
35 int i;
37 /* We also vectorize this loop. */
38 for (i = 0; i < N; i++)
40 b[i] = pb[i];
41 c[i] = pc[i];
44 for (i = 0; i < N; i++)
46 pa[i] = b[i] * c[i];
49 return 0;
52 int main (void)
54 int i;
55 float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
56 float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
57 float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
59 check_vect ();
61 main1 (a,b,c);
62 bar (a,b,c);
63 return 0;
66 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
67 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
68 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_element_align } } } } } */
69 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */
70 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */
71 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */