| 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 bind_pic_locally } */ |
| 5 |
|
| 6 |
#include <stdarg.h> |
| 7 |
#include "tree-vect.h" |
| 8 |
|
| 9 |
#if VECTOR_BITS > 128 |
| 10 |
#define NINTS (VECTOR_BITS / 32) |
| 11 |
#else |
| 12 |
#define NINTS 4 |
| 13 |
#endif |
| 14 |
|
| 15 |
#define N (NINTS * 4) |
| 16 |
|
| 17 |
int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 18 |
int ia[N][NINTS][N + 1]; |
| 19 |
int ic[N][N][NINTS - 1][2 * N + 2]; |
| 20 |
int id[N][N][N + NINTS]; |
| 21 |
|
| 22 |
__attribute__ ((noinline)) |
| 23 |
int main1 () |
| 24 |
{ |
| 25 |
int i, j; |
| 26 |
|
| 27 |
/* Multidimensional array. Not aligned: vectorizable. */ |
| 28 |
for (i = 0; i < N; i++) |
| 29 |
{ |
| 30 |
for (j = 0; j < N; j++) |
| 31 |
{ |
| 32 |
ia[i][1][j] = ib[i]; |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
/* Multidimensional array. Aligned: vectorizable. */ |
| 37 |
for (i = 0; i < N; i++) |
| 38 |
{ |
| 39 |
for (j = 0; j < N; j++) |
| 40 |
{ |
| 41 |
ic[i][1][1][j] = ib[i]; |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
/* Multidimensional array. Not aligned: vectorizable. */ |
| 46 |
for (i = 0; i < N; i++) |
| 47 |
{ |
| 48 |
for (j = 0; j < N; j++) |
| 49 |
{ |
| 50 |
id[i][1][j+1] = ib[i]; |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
/* check results: */ |
| 55 |
for (i = 0; i < N; i++) |
| 56 |
{ |
| 57 |
#pragma GCC novector |
| 58 |
for (j = 0; j < N; j++) |
| 59 |
{ |
| 60 |
if (ia[i][1][j] != ib[i]) |
| 61 |
abort(); |
| 62 |
} |
| 63 |
} |
| 64 |
|
| 65 |
/* check results: */ |
| 66 |
for (i = 0; i < N; i++) |
| 67 |
{ |
| 68 |
#pragma GCC novector |
| 69 |
for (j = 0; j < N; j++) |
| 70 |
{ |
| 71 |
if (ic[i][1][1][j] != ib[i]) |
| 72 |
abort(); |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
/* check results: */ |
| 77 |
for (i = 0; i < N; i++) |
| 78 |
{ |
| 79 |
#pragma GCC novector |
| 80 |
for (j = 0; j < N; j++) |
| 81 |
{ |
| 82 |
if (id[i][1][j+1] != ib[i]) |
| 83 |
abort(); |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
return 0; |
| 88 |
} |
| 89 |
|
| 90 |
int main (void) |
| 91 |
{ |
| 92 |
check_vect (); |
| 93 |
|
| 94 |
return main1 (); |
| 95 |
} |
| 96 |
|
| 97 |
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ |
| 98 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ |
| 99 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_element_align_preferred } } } */ |