vect-40: Use aligned arrays instead of arrays to aligned type.
authorDorit Nuzman <dorit@il.ibm.com>
Tue, 16 Aug 2005 15:02:39 +0000 (15:02 +0000)
committerDorit Nuzman <dorit@gcc.gnu.org>
Tue, 16 Aug 2005 15:02:39 +0000 (15:02 +0000)
        * 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

31 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect-35.c
gcc/testsuite/gcc.dg/vect/vect-40.c
gcc/testsuite/gcc.dg/vect/vect-41.c
gcc/testsuite/gcc.dg/vect/vect-42.c
gcc/testsuite/gcc.dg/vect/vect-43.c
gcc/testsuite/gcc.dg/vect/vect-44.c
gcc/testsuite/gcc.dg/vect/vect-46.c
gcc/testsuite/gcc.dg/vect/vect-47.c
gcc/testsuite/gcc.dg/vect/vect-48.c
gcc/testsuite/gcc.dg/vect/vect-52.c
gcc/testsuite/gcc.dg/vect/vect-53.c
gcc/testsuite/gcc.dg/vect/vect-54.c
gcc/testsuite/gcc.dg/vect/vect-55.c
gcc/testsuite/gcc.dg/vect/vect-56.c
gcc/testsuite/gcc.dg/vect/vect-57.c
gcc/testsuite/gcc.dg/vect/vect-58.c
gcc/testsuite/gcc.dg/vect/vect-59.c
gcc/testsuite/gcc.dg/vect/vect-60.c
gcc/testsuite/gcc.dg/vect/vect-61.c
gcc/testsuite/gcc.dg/vect/vect-74.c
gcc/testsuite/gcc.dg/vect/vect-75.c
gcc/testsuite/gcc.dg/vect/vect-76.c
gcc/testsuite/gcc.dg/vect/vect-77.c
gcc/testsuite/gcc.dg/vect/vect-78.c
gcc/testsuite/gcc.dg/vect/vect-80.c
gcc/testsuite/gcc.dg/vect/vect-85.c
gcc/testsuite/gcc.dg/vect/vect-87.c
gcc/testsuite/gcc.dg/vect/vect-88.c
gcc/testsuite/gcc.dg/vect/vect-92.c
gcc/testsuite/gcc.dg/vect/vect-93.c

index 407be8c..a38b710 100644 (file)
@@ -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.
index 897868d..ef36d1c 100644 (file)
@@ -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" } } */
index 89fc88e..7abacd6 100644 (file)
@@ -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 ();
 
index 21591b6..ee2ccdf 100644 (file)
@@ -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 ();
 
index 4cab631..7145968 100644 (file)
@@ -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 ();
 
index 12db333..e47bdaa 100644 (file)
@@ -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 ();
 
index 46eb2a6..0bd2d22 100644 (file)
@@ -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 ();
 
index 4ced75a..6873934 100644 (file)
@@ -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 ();
 
index 12a7a5a..4f21ffc 100644 (file)
@@ -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 ();
 
index b4da6d0..83ec09a 100644 (file)
@@ -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 ();
 
index d321dcf..a1cb82c 100644 (file)
@@ -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 ();
 
index ff3c103..1fd7c93 100644 (file)
@@ -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 ();
 
index b68c61b..197e6d1 100644 (file)
@@ -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 ();
 
index 6d130df..6601b2f 100644 (file)
@@ -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 ();
 
index de53a2a..fe4c7b6 100644 (file)
@@ -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 ();
 
index 950cdae..f197eb4 100644 (file)
@@ -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 ();
 
index 5d282d4..67bce93 100644 (file)
@@ -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 ();
 
index 568dc0e..c061a3a 100644 (file)
@@ -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 ();
 
index 188fa15..3021ee4 100644 (file)
@@ -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 ();
 
index 2911048..5b0f5d9 100644 (file)
@@ -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 ();
 
index 86e09c9..d4593cb 100644 (file)
@@ -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)
index 121eddd..d923a83 100644 (file)
@@ -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)
 {
index 1c3eba9..b831278 100644 (file)
@@ -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)
 {
index 8557b29..0e45679 100644 (file)
@@ -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)
 {
index a059f30..f231e0d 100644 (file)
@@ -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)
index e05ff04..25ca6d6 100644 (file)
@@ -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)
 {
index 7d19399..4c24262 100644 (file)
@@ -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 ();
 
index 959a466..6b74a0d 100644 (file)
@@ -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 ();
 
index 884b3b2..478a142 100644 (file)
@@ -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 ();
 
index a2c5740..b47d859 100644 (file)
@@ -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;
 }
index 87650ab..af2f166 100644 (file)
@@ -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 ();