i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-section-anchors-vect-69.c
blob0861d488e134d3f01a2fa83c56eff7174f36ddfb
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
3 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #if VECTOR_BITS > 128
9 #define NINTS (VECTOR_BITS / 32)
10 #else
11 #define NINTS 4
12 #endif
14 #define N (NINTS * 6)
16 struct s{
17 int m;
18 int n[N][N][N];
21 struct s2{
22 int m;
23 int n[N-1][N-1][N-1];
26 struct test1{
27 struct s a; /* array a.n is unaligned */
28 int pad[NINTS - 2];
29 struct s e; /* array e.n is aligned */
32 struct test2{
33 struct s2 a; /* array a.n is unaligned */
34 int b;
35 int c;
36 struct s2 e; /* array e.n is aligned */
40 struct test1 tmp1[4];
41 struct test2 tmp2[4];
43 __attribute__ ((noinline))
44 int main1 ()
46 int i,j;
48 /* 1. unaligned (known misalignment) */
49 for (i = 0; i < N; i++)
51 tmp1[2].a.n[1][2][i] = 5;
54 /* check results: */
55 #pragma GCC novector
56 for (i = 0; i <N; i++)
58 if (tmp1[2].a.n[1][2][i] != 5)
59 abort ();
62 /* 2. aligned */
63 for (i = NINTS - 1; i < N - 1; i++)
65 tmp1[2].a.n[1][2][i] = 6;
68 /* check results: */
69 #pragma GCC novector
70 for (i = NINTS; i < N - 1; i++)
72 if (tmp1[2].a.n[1][2][i] != 6)
73 abort ();
76 /* 3. aligned */
77 for (i = 0; i < N; i++)
79 for (j = 0; j < N; j++)
81 tmp1[2].e.n[1][i][j] = 8;
85 /* check results: */
86 for (i = 0; i < N; i++)
88 #pragma GCC novector
89 for (j = 0; j < N; j++)
91 if (tmp1[2].e.n[1][i][j] != 8)
92 abort ();
96 /* 4. unaligned (unknown misalignment) */
97 for (i = 0; i < N - NINTS; i++)
99 for (j = 0; j < N - NINTS; j++)
101 tmp2[2].e.n[1][i][j] = 8;
105 /* check results: */
106 for (i = 0; i < N - NINTS; i++)
108 #pragma GCC novector
109 for (j = 0; j < N - NINTS; j++)
111 if (tmp2[2].e.n[1][i][j] != 8)
112 abort ();
116 return 0;
119 int main (void)
121 check_vect ();
123 return main1 ();
126 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_hw_misalign } } } */
127 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { ! vect_hw_misalign } } } } */
128 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_hw_misalign } } } } } */