111
|
1 /* { dg-require-effective-target vect_int } */
|
|
2 /* { dg-add-options double_vectors } */
|
|
3
|
|
4 #include <stdarg.h>
|
|
5 #include "tree-vect.h"
|
|
6
|
131
|
7 #if VECTOR_BITS > 128
|
|
8 #define N (VECTOR_BITS * 2 / 8)
|
|
9 #else
|
111
|
10 #define N 32
|
131
|
11 #endif
|
111
|
12
|
|
13 int ib[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
|
|
14 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
|
|
15 short sb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
|
|
16 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
|
|
17 char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
|
|
18 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
|
|
19
|
|
20 __attribute__ ((noinline))
|
|
21 int main1 (int n, int * __restrict__ pib,
|
|
22 short * __restrict__ psb,
|
|
23 char * __restrict__ pcb)
|
|
24 {
|
|
25 int i;
|
|
26 int ia[N];
|
|
27 short sa[N];
|
|
28 char ca[N];
|
|
29
|
|
30 /* Multiple types with different sizes, used in independent
|
|
31 computations. Vectorizable. The loads are misaligned. */
|
|
32 for (i = 0; i < n; i++)
|
|
33 {
|
|
34 ia[i] = pib[i];
|
|
35 sa[i] = psb[i];
|
|
36 ca[i] = pcb[i];
|
|
37 }
|
|
38
|
|
39 /* check results: */
|
|
40 for (i = 0; i < n; i++)
|
|
41 {
|
|
42 if (ia[i] != pib[i]
|
|
43 || sa[i] != psb[i]
|
|
44 || ca[i] != pcb[i])
|
|
45 abort ();
|
|
46 }
|
|
47
|
|
48 return 0;
|
|
49 }
|
|
50
|
|
51 int main (void)
|
|
52 {
|
|
53 check_vect ();
|
|
54
|
|
55 main1 (N, ib, sb, cb);
|
|
56 main1 (N-3, ib, sb, &cb[2]);
|
|
57 return 0;
|
|
58 }
|
|
59
|
|
60 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
|
|
61 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
|
131
|
62 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */
|
111
|
63
|