Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-6.c
blob73d3b30384ebc4f15b853a140512d004262db3ef
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-add-options double_vectors } */
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #if VECTOR_BITS > 128
10 #define N (VECTOR_BITS * 2 / 8)
11 #else
12 #define N 32
13 #endif
15 unsigned int ic[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 unsigned int ib[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 unsigned short sc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
20 {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};
21 unsigned short sb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
22 {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};
23 unsigned char cc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
24 {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};
25 unsigned char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
26 {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};
28 __attribute__ ((noinline))
29 int main1 (int n,
30 unsigned int * __restrict__ pic, unsigned int * __restrict__ pib,
31 unsigned short * __restrict__ psc, unsigned short * __restrict__ psb,
32 unsigned char * __restrict__ pcc, unsigned char * __restrict__ pcb)
34 int i;
35 unsigned int ia[N];
36 unsigned short sa[N];
37 unsigned char ca[N];
39 /* Multiple types with different sizes, used in independent
40 computations. Vectorizable. The loads are misaligned. */
41 for (i = 0; i < n; i++)
43 ia[i] = pib[i] + pic[i];
44 sa[i] = psb[i] + psc[i];
45 ca[i] = pcb[i] + pcc[i];
48 /* check results: */
49 #pragma GCC novector
50 for (i = 0; i < n; i++)
52 if (ia[i] != pib[i] + pic[i]
53 || sa[i] != psb[i] + psc[i]
54 || ca[i] != pcb[i] + pcc[i])
55 abort ();
58 return 0;
61 int main (void)
63 check_vect ();
65 main1 (N, ic, ib, sc, sb, cc, cb);
66 main1 (N-3, ic, ib, &sc[1], sb, cc, &cb[2]);
67 return 0;
70 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { sparc*-*-* && ilp32 } }} } */
71 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
72 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */