aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDorit Nuzman <dorit@il.ibm.com>2005-08-16 15:02:39 +0000
committerDorit Nuzman <dorit@gcc.gnu.org>2005-08-16 15:02:39 +0000
commitd110b74089c5edde21dd46fbcf35659cbc1f98d0 (patch)
treeeb986f4c63313c2d95433b7ac6166cd8defb1989
parent20fe2233a7169a95be493c7f0a335a3332711d8b (diff)
downloadgcc-d110b74089c5edde21dd46fbcf35659cbc1f98d0.zip
gcc-d110b74089c5edde21dd46fbcf35659cbc1f98d0.tar.gz
gcc-d110b74089c5edde21dd46fbcf35659cbc1f98d0.tar.bz2
vect-40: Use aligned arrays instead of arrays to aligned type.
* gcc.dg/vect/vect-40: Use aligned arrays instead of arrays to aligned type. * gcc.dg/vect/vect-41: Likewise. * gcc.dg/vect/vect-42: Likewise. * gcc.dg/vect/vect-43: Likewise. * gcc.dg/vect/vect-44: Likewise. * gcc.dg/vect/vect-46: Likewise. * gcc.dg/vect/vect-47: Likewise. * gcc.dg/vect/vect-48: Likewise. * gcc.dg/vect/vect-52: Likewise. * gcc.dg/vect/vect-53: Likewise. * gcc.dg/vect/vect-54: Likewise. * gcc.dg/vect/vect-55: Likewise. * gcc.dg/vect/vect-56: Likewise. * gcc.dg/vect/vect-57: Likewise. * gcc.dg/vect/vect-58: Likewise. * gcc.dg/vect/vect-59: Likewise. * gcc.dg/vect/vect-60: Likewise. * gcc.dg/vect/vect-61: Likewise. * gcc.dg/vect/vect-85: Likewise. * gcc.dg/vect/vect-87: Likewise. * gcc.dg/vect/vect-88: Likewise. * gcc.dg/vect/vect-93.c: Likewise. * gcc.dg/vect/vect-74: Likewise, and also added documentation. * gcc.dg/vect/vect-75: Likewise. * gcc.dg/vect/vect-76: Likewise. * gcc.dg/vect/vect-77: Likewise. * gcc.dg/vect/vect-78: Likewise. * gcc.dg/vect/vect-80: Likewise. * gcc.dg/vect/vect-35: Likewise, and also check that the test wasn't vectorized for the expected reason, rather than checking how alignment was handled. * gcc.dg/vect/vect-92.c: Use aligned arrays instead of arrays to aligned type and also instead of aligned pointers. Added documentation. From-SVN: r103158
-rw-r--r--gcc/testsuite/ChangeLog37
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-35.c16
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-40.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-41.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-42.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-43.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-44.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-46.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-47.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-48.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-52.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-53.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-54.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-55.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-56.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-57.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-58.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-59.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-60.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-61.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-74.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-75.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-76.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-77.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-78.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-80.c11
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-85.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-87.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-88.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-92.c29
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-93.c5
31 files changed, 158 insertions, 105 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 407be8c..a38b710 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,40 @@
+2005-08-16 Dorit Nuzman <dorit@il.ibm.com>
+
+ * gcc.dg/vect/vect-40: Use aligned arrays instead of arrays to aligned
+ type.
+ * gcc.dg/vect/vect-41: Likewise.
+ * gcc.dg/vect/vect-42: Likewise.
+ * gcc.dg/vect/vect-43: Likewise.
+ * gcc.dg/vect/vect-44: Likewise.
+ * gcc.dg/vect/vect-46: Likewise.
+ * gcc.dg/vect/vect-47: Likewise.
+ * gcc.dg/vect/vect-48: Likewise.
+ * gcc.dg/vect/vect-52: Likewise.
+ * gcc.dg/vect/vect-53: Likewise.
+ * gcc.dg/vect/vect-54: Likewise.
+ * gcc.dg/vect/vect-55: Likewise.
+ * gcc.dg/vect/vect-56: Likewise.
+ * gcc.dg/vect/vect-57: Likewise.
+ * gcc.dg/vect/vect-58: Likewise.
+ * gcc.dg/vect/vect-59: Likewise.
+ * gcc.dg/vect/vect-60: Likewise.
+ * gcc.dg/vect/vect-61: Likewise.
+ * gcc.dg/vect/vect-85: Likewise.
+ * gcc.dg/vect/vect-87: Likewise.
+ * gcc.dg/vect/vect-88: Likewise.
+ * gcc.dg/vect/vect-93.c: Likewise.
+ * gcc.dg/vect/vect-74: Likewise, and also added documentation.
+ * gcc.dg/vect/vect-75: Likewise.
+ * gcc.dg/vect/vect-76: Likewise.
+ * gcc.dg/vect/vect-77: Likewise.
+ * gcc.dg/vect/vect-78: Likewise.
+ * gcc.dg/vect/vect-80: Likewise.
+ * gcc.dg/vect/vect-35: Likewise, and also check that the test wasn't
+ vectorized for the expected reason, rather than checking how alignment
+ was handled.
+ * gcc.dg/vect/vect-92.c: Use aligned arrays instead of arrays to aligned
+ type and also instead of aligned pointers. Added documentation.
+
2005-08-16 Feng Wang <fengwang@nudt.edu.cn>
* gfortran.dg/power.f90: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/vect-35.c b/gcc/testsuite/gcc.dg/vect/vect-35.c
index 897868d..ef36d1c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-35.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-35.c
@@ -3,24 +3,24 @@
#include <stdarg.h>
#include "tree-vect.h"
-typedef char achar __attribute__ ((__aligned__(16)));
-
#define N 16
-achar x[N];
int main1 ()
{
union {
- achar a[N];
- achar b[N];
+ char a[N] __attribute__ ((__aligned__(16)));
+ char b[N] __attribute__ ((__aligned__(16)));
} s;
int i;
+ /* Initialization. */
for (i = 0; i < N; i++)
{
s.b[i] = 3*i;
}
+ /* Can't vectorize - dependence analysis fails cause s.a and s.b may
+ overlap. */
for (i = 0; i < N; i++)
{
s.a[i] = s.b[i] + 1;
@@ -29,7 +29,7 @@ int main1 ()
/* check results: */
for (i = 0; i < N; i++)
{
- if (s.a[i] != s.b[i])
+ if (s.a[i] != 3*i + 1)
abort ();
}
@@ -44,6 +44,6 @@ int main (void)
}
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "can't determine dependence between" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-40.c b/gcc/testsuite/gcc.dg/vect/vect-40.c
index 89fc88e..7abacd6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-40.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-40.c
@@ -38,9 +38,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-41.c b/gcc/testsuite/gcc.dg/vect/vect-41.c
index 21591b6..ee2ccdf 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-41.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-41.c
@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc)
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-42.c b/gcc/testsuite/gcc.dg/vect/vect-42.c
index 4cab631..7145968 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-42.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-42.c
@@ -26,8 +26,8 @@ int
main1 (afloat * __restrict__ pa)
{
int i;
- afloat pb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat pc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float pb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float pc[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
for (i = 0; i < N; i++)
@@ -41,9 +41,9 @@ main1 (afloat * __restrict__ pa)
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-43.c b/gcc/testsuite/gcc.dg/vect/vect-43.c
index 12db333..e47bdaa 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-43.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-43.c
@@ -26,8 +26,8 @@ int
main1 (afloat * pa)
{
int i;
- afloat pb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat pc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float pb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float pc[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
/* Not vectorizable: pa may alias pb and/or pc, since their addresses escape. */
for (i = 0; i < N; i++)
@@ -66,9 +66,9 @@ main2 (afloat * pa)
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-44.c b/gcc/testsuite/gcc.dg/vect/vect-44.c
index 46eb2a6..0bd2d22 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-44.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-44.c
@@ -5,8 +5,6 @@
#define N 256
-typedef float afloat __attribute__ ((__aligned__(16)));
-
void bar (float *pa, float *pb, float *pc)
{
int i;
@@ -21,7 +19,6 @@ void bar (float *pa, float *pb, float *pc)
return;
}
-
int
main1 (float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
{
@@ -40,9 +37,9 @@ main1 (float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc
int main (void)
{
int i;
- afloat a[N+4];
- afloat b[N+4] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69};
- afloat c[N+4] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
+ float a[N+4] __attribute__ ((__aligned__(16)));
+ float b[N+4] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69};
+ float c[N+4] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-46.c b/gcc/testsuite/gcc.dg/vect/vect-46.c
index 4ced75a..6873934 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-46.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-46.c
@@ -39,9 +39,9 @@ int main (void)
{
int i;
int n=N;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-47.c b/gcc/testsuite/gcc.dg/vect/vect-47.c
index 12a7a5a..4f21ffc 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-47.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-47.c
@@ -41,9 +41,9 @@ int main (void)
{
int i;
int n=N;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-48.c b/gcc/testsuite/gcc.dg/vect/vect-48.c
index b4da6d0..83ec09a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-48.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-48.c
@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, float * __restrict__ pb, float * __restrict__ p
int main (void)
{
int i;
- afloat a[N];
- afloat b[N+1] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N+1] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-52.c b/gcc/testsuite/gcc.dg/vect/vect-52.c
index d321dcf..a1cb82c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-52.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-52.c
@@ -40,9 +40,9 @@ main1 (int n, afloat * __restrict__ pa, float * __restrict__ pb, float * __restr
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-53.c b/gcc/testsuite/gcc.dg/vect/vect-53.c
index ff3c103..1fd7c93 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-53.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-53.c
@@ -40,9 +40,9 @@ main1 (int n, afloat *pa, float *pb, float *pc)
int main (void)
{
int i;
- afloat a[N];
- afloat b[N+1] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
- afloat c[N+1] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N+1] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
+ float c[N+1] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-54.c b/gcc/testsuite/gcc.dg/vect/vect-54.c
index b68c61b..197e6d1 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-54.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-54.c
@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-55.c b/gcc/testsuite/gcc.dg/vect/vect-55.c
index 6d130df..6601b2f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-55.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-55.c
@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc)
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc/testsuite/gcc.dg/vect/vect-56.c
index de53a2a..fe4c7b6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-56.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-56.c
@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-57.c b/gcc/testsuite/gcc.dg/vect/vect-57.c
index 950cdae..f197eb4 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-57.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-57.c
@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc)
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-58.c b/gcc/testsuite/gcc.dg/vect/vect-58.c
index 5d282d4..67bce93 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-58.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-58.c
@@ -41,9 +41,9 @@ int main (void)
{
int i;
int n=N;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-59.c b/gcc/testsuite/gcc.dg/vect/vect-59.c
index 568dc0e..c061a3a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-59.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-59.c
@@ -41,9 +41,9 @@ int main (void)
{
int i;
int n=N;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc/testsuite/gcc.dg/vect/vect-60.c
index 188fa15..3021ee4 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-60.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-60.c
@@ -41,9 +41,9 @@ int main (void)
{
int i;
int n=N;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-61.c b/gcc/testsuite/gcc.dg/vect/vect-61.c
index 2911048..5b0f5d9 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-61.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-61.c
@@ -42,9 +42,9 @@ int main (void)
{
int i;
int n=N;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-74.c b/gcc/testsuite/gcc.dg/vect/vect-74.c
index 86e09c9..d4593cb 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-74.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-74.c
@@ -7,9 +7,13 @@
typedef float afloat __attribute__ ((__aligned__(16)));
-afloat a[N];
-afloat b[N+4] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
-afloat c[N] = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5};
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+float a[N] __attribute__ ((__aligned__(16)));
+float b[N+4] __attribute__ ((__aligned__(16))) = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
+float c[N] __attribute__ ((__aligned__(16))) = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5};
int
main1 (afloat *__restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-75.c b/gcc/testsuite/gcc.dg/vect/vect-75.c
index 121eddd..d923a83 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-75.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-75.c
@@ -8,7 +8,11 @@
typedef int aint __attribute__ ((__aligned__(16)));
-aint ib[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
int main1 (aint *ib)
{
diff --git a/gcc/testsuite/gcc.dg/vect/vect-76.c b/gcc/testsuite/gcc.dg/vect/vect-76.c
index 1c3eba9..b831278 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-76.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-76.c
@@ -8,7 +8,11 @@
typedef int aint __attribute__ ((__aligned__(16)));
-aint ib[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
int main1 (aint *pib)
{
diff --git a/gcc/testsuite/gcc.dg/vect/vect-77.c b/gcc/testsuite/gcc.dg/vect/vect-77.c
index 8557b29..0e45679 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-77.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-77.c
@@ -8,7 +8,11 @@
typedef int aint __attribute__ ((__aligned__(16)));
-aint ib[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
int main1 (aint *ib, int off)
{
diff --git a/gcc/testsuite/gcc.dg/vect/vect-78.c b/gcc/testsuite/gcc.dg/vect/vect-78.c
index a059f30..f231e0d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-78.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-78.c
@@ -8,7 +8,11 @@
typedef int aint __attribute__ ((__aligned__(16)));
-aint ib[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
int off = 8;
int main1 (aint *ib)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-80.c b/gcc/testsuite/gcc.dg/vect/vect-80.c
index e05ff04..25ca6d6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-80.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-80.c
@@ -5,13 +5,14 @@
#define N 16
-typedef float afloat __attribute__ ((__aligned__(16)));
+float fa[N] __attribute__ ((__aligned__(16)));
+float fb[N+4] __attribute__ ((__aligned__(16))) = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
+float fc[N] __attribute__ ((__aligned__(16))) = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5};
-afloat fa[N];
-afloat fb[N+4] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
-afloat fc[N] = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5};
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
-/* Not vectorizable: not aligned pointers. */
int
main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc)
{
diff --git a/gcc/testsuite/gcc.dg/vect/vect-85.c b/gcc/testsuite/gcc.dg/vect/vect-85.c
index 7d19399..4c24262 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-85.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-85.c
@@ -5,8 +5,6 @@
#define N 16
-typedef int aint __attribute__ ((__aligned__(16)));
-
int main1 (int *a)
{
int i, j, k;
@@ -36,7 +34,7 @@ int main1 (int *a)
int main (void)
{
- aint a[N];
+ int a[N] __attribute__ ((__aligned__(16)));
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-87.c b/gcc/testsuite/gcc.dg/vect/vect-87.c
index 959a466..6b74a0d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-87.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-87.c
@@ -5,8 +5,6 @@
#define N 16
-typedef int aint __attribute__ ((__aligned__(16)));
-
int main1 (int n, int *a)
{
int i, j, k;
@@ -36,7 +34,7 @@ int main1 (int n, int *a)
int main (void)
{
- aint a[N];
+ int a[N] __attribute__ ((__aligned__(16)));
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-88.c b/gcc/testsuite/gcc.dg/vect/vect-88.c
index 884b3b2..478a142 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-88.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-88.c
@@ -5,8 +5,6 @@
#define N 16
-typedef int aint __attribute__ ((__aligned__(16)));
-
int main1 (int n, int *a)
{
int i, j, k;
@@ -36,7 +34,7 @@ int main1 (int n, int *a)
int main (void)
{
- aint a[N+1];
+ int a[N+1] __attribute__ ((__aligned__(16)));
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-92.c b/gcc/testsuite/gcc.dg/vect/vect-92.c
index a2c5740..b47d859 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-92.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-92.c
@@ -5,12 +5,20 @@
#define N 256
-typedef float afloat __attribute__ ((__aligned__(16)));
-
-/* known misalignment: same alignment */
+float pa[N] __attribute__ ((__aligned__(16)));
+float pb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+float pc[N] __attribute__ ((__aligned__(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+/* Check handling of unaligned accesses when the misalignment is
+ known at compile time and different accesses have the same
+ misalignment (e.g. peeling to align one access will align all
+ accesses with the same misalignment. Also, the number of
+ peeled iterations is known in this case, and the vectorizer
+ can use this information (generate prolog and epilog loops
+ with known number of iterations, and only if needed). */
int
-main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc)
+main1 ()
{
int i;
@@ -30,7 +38,7 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
}
int
-main2 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc)
+main2 ()
{
int i;
@@ -50,7 +58,7 @@ main2 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
}
int
-main3 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc, int n)
+main3 (int n)
{
int i;
@@ -72,15 +80,12 @@ main3 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
int main (void)
{
int i;
- afloat a[N];
- afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
- afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
check_vect ();
- main1 (a,b,c);
- main2 (a,b,c);
- main3 (a,b,c,N-1);
+ main1 ();
+ main2 ();
+ main3 (N-1);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-93.c b/gcc/testsuite/gcc.dg/vect/vect-93.c
index 87650ab..af2f166 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-93.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-93.c
@@ -5,7 +5,6 @@
#define N 3001
-typedef float afloat __attribute__ ((__aligned__(16)));
int
main1 (float *pa)
@@ -42,8 +41,8 @@ main1 (float *pa)
int main (void)
{
int i;
- afloat a[N];
- afloat b[N];
+ float a[N] __attribute__ ((__aligned__(16)));
+ float b[N] __attribute__ ((__aligned__(16)));
check_vect ();