Commit d110b740 by Dorit Nuzman Committed by Dorit Nuzman

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
parent 20fe2233
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> 2005-08-16 Feng Wang <fengwang@nudt.edu.cn>
* gfortran.dg/power.f90: New test. * gfortran.dg/power.f90: New test.
......
...@@ -3,24 +3,24 @@ ...@@ -3,24 +3,24 @@
#include <stdarg.h> #include <stdarg.h>
#include "tree-vect.h" #include "tree-vect.h"
typedef char achar __attribute__ ((__aligned__(16)));
#define N 16 #define N 16
achar x[N];
int main1 () int main1 ()
{ {
union { union {
achar a[N]; char a[N] __attribute__ ((__aligned__(16)));
achar b[N]; char b[N] __attribute__ ((__aligned__(16)));
} s; } s;
int i; int i;
/* Initialization. */
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
{ {
s.b[i] = 3*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++) for (i = 0; i < N; i++)
{ {
s.a[i] = s.b[i] + 1; s.a[i] = s.b[i] + 1;
...@@ -29,7 +29,7 @@ int main1 () ...@@ -29,7 +29,7 @@ int main1 ()
/* check results: */ /* check results: */
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
{ {
if (s.a[i] != s.b[i]) if (s.a[i] != 3*i + 1)
abort (); abort ();
} }
...@@ -44,6 +44,6 @@ int main (void) ...@@ -44,6 +44,6 @@ int main (void)
} }
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "can't determine dependence between" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -38,9 +38,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ ...@@ -38,9 +38,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc) ...@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc)
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -26,8 +26,8 @@ int ...@@ -26,8 +26,8 @@ int
main1 (afloat * __restrict__ pa) main1 (afloat * __restrict__ pa)
{ {
int i; 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}; 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};
afloat pc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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++) for (i = 0; i < N; i++)
...@@ -41,9 +41,9 @@ main1 (afloat * __restrict__ pa) ...@@ -41,9 +41,9 @@ main1 (afloat * __restrict__ pa)
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -26,8 +26,8 @@ int ...@@ -26,8 +26,8 @@ int
main1 (afloat * pa) main1 (afloat * pa)
{ {
int i; 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}; 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};
afloat pc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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. */ /* Not vectorizable: pa may alias pb and/or pc, since their addresses escape. */
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
...@@ -66,9 +66,9 @@ main2 (afloat * pa) ...@@ -66,9 +66,9 @@ main2 (afloat * pa)
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#define N 256 #define N 256
typedef float afloat __attribute__ ((__aligned__(16)));
void bar (float *pa, float *pb, float *pc) void bar (float *pa, float *pb, float *pc)
{ {
int i; int i;
...@@ -21,7 +19,6 @@ void bar (float *pa, float *pb, float *pc) ...@@ -21,7 +19,6 @@ void bar (float *pa, float *pb, float *pc)
return; return;
} }
int int
main1 (float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc) main1 (float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
{ {
...@@ -40,9 +37,9 @@ 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 main (void)
{ {
int i; int i;
afloat a[N+4]; float a[N+4] __attribute__ ((__aligned__(16)));
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}; 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};
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 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 (); check_vect ();
......
...@@ -39,9 +39,9 @@ int main (void) ...@@ -39,9 +39,9 @@ int main (void)
{ {
int i; int i;
int n=N; int n=N;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -41,9 +41,9 @@ int main (void) ...@@ -41,9 +41,9 @@ int main (void)
{ {
int i; int i;
int n=N; int n=N;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, float * __restrict__ pb, float * __restrict__ p ...@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, float * __restrict__ pb, float * __restrict__ p
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
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}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -40,9 +40,9 @@ main1 (int n, afloat * __restrict__ pa, float * __restrict__ pb, float * __restr ...@@ -40,9 +40,9 @@ main1 (int n, afloat * __restrict__ pa, float * __restrict__ pb, float * __restr
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60}; 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};
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 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 (); check_vect ();
......
...@@ -40,9 +40,9 @@ main1 (int n, afloat *pa, float *pb, float *pc) ...@@ -40,9 +40,9 @@ main1 (int n, afloat *pa, float *pb, float *pc)
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
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}; 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};
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 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 (); check_vect ();
......
...@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ ...@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc) ...@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc)
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ ...@@ -40,9 +40,9 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc) ...@@ -40,9 +40,9 @@ main1 (afloat * pa, afloat * pb, afloat * pc)
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -41,9 +41,9 @@ int main (void) ...@@ -41,9 +41,9 @@ int main (void)
{ {
int i; int i;
int n=N; int n=N;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -41,9 +41,9 @@ int main (void) ...@@ -41,9 +41,9 @@ int main (void)
{ {
int i; int i;
int n=N; int n=N;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -41,9 +41,9 @@ int main (void) ...@@ -41,9 +41,9 @@ int main (void)
{ {
int i; int i;
int n=N; int n=N;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -42,9 +42,9 @@ int main (void) ...@@ -42,9 +42,9 @@ int main (void)
{ {
int i; int i;
int n=N; int n=N;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; 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};
afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; 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 (); check_vect ();
......
...@@ -7,9 +7,13 @@ ...@@ -7,9 +7,13 @@
typedef float afloat __attribute__ ((__aligned__(16))); typedef float afloat __attribute__ ((__aligned__(16)));
afloat a[N]; /* Check handling of accesses for which the "initial condition" -
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}; the expression that represents the first location accessed - is
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}; 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 int
main1 (afloat *__restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc) main1 (afloat *__restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc)
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
typedef int aint __attribute__ ((__aligned__(16))); 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 main1 (aint *ib)
{ {
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
typedef int aint __attribute__ ((__aligned__(16))); 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) int main1 (aint *pib)
{ {
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
typedef int aint __attribute__ ((__aligned__(16))); 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) int main1 (aint *ib, int off)
{ {
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
typedef int aint __attribute__ ((__aligned__(16))); 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 off = 8;
int main1 (aint *ib) int main1 (aint *ib)
......
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
#define N 16 #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]; /* Check handling of accesses for which the "initial condition" -
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}; the expression that represents the first location accessed - is
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}; more involved than just an ssa_name. */
/* Not vectorizable: not aligned pointers. */
int int
main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc) main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc)
{ {
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#define N 16 #define N 16
typedef int aint __attribute__ ((__aligned__(16)));
int main1 (int *a) int main1 (int *a)
{ {
int i, j, k; int i, j, k;
...@@ -36,7 +34,7 @@ int main1 (int *a) ...@@ -36,7 +34,7 @@ int main1 (int *a)
int main (void) int main (void)
{ {
aint a[N]; int a[N] __attribute__ ((__aligned__(16)));
check_vect (); check_vect ();
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#define N 16 #define N 16
typedef int aint __attribute__ ((__aligned__(16)));
int main1 (int n, int *a) int main1 (int n, int *a)
{ {
int i, j, k; int i, j, k;
...@@ -36,7 +34,7 @@ int main1 (int n, int *a) ...@@ -36,7 +34,7 @@ int main1 (int n, int *a)
int main (void) int main (void)
{ {
aint a[N]; int a[N] __attribute__ ((__aligned__(16)));
check_vect (); check_vect ();
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#define N 16 #define N 16
typedef int aint __attribute__ ((__aligned__(16)));
int main1 (int n, int *a) int main1 (int n, int *a)
{ {
int i, j, k; int i, j, k;
...@@ -36,7 +34,7 @@ int main1 (int n, int *a) ...@@ -36,7 +34,7 @@ int main1 (int n, int *a)
int main (void) int main (void)
{ {
aint a[N+1]; int a[N+1] __attribute__ ((__aligned__(16)));
check_vect (); check_vect ();
......
...@@ -5,12 +5,20 @@ ...@@ -5,12 +5,20 @@
#define N 256 #define N 256
typedef float afloat __attribute__ ((__aligned__(16))); 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};
/* known misalignment: same alignment */ 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 int
main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc) main1 ()
{ {
int i; int i;
...@@ -30,7 +38,7 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ ...@@ -30,7 +38,7 @@ main1 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
} }
int int
main2 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc) main2 ()
{ {
int i; int i;
...@@ -50,7 +58,7 @@ main2 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ ...@@ -50,7 +58,7 @@ main2 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
} }
int int
main3 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc, int n) main3 (int n)
{ {
int i; int i;
...@@ -72,15 +80,12 @@ main3 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ ...@@ -72,15 +80,12 @@ main3 (afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__
int main (void) int main (void)
{ {
int i; 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 (); check_vect ();
main1 (a,b,c); main1 ();
main2 (a,b,c); main2 ();
main3 (a,b,c,N-1); main3 (N-1);
return 0; return 0;
} }
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#define N 3001 #define N 3001
typedef float afloat __attribute__ ((__aligned__(16)));
int int
main1 (float *pa) main1 (float *pa)
...@@ -42,8 +41,8 @@ main1 (float *pa) ...@@ -42,8 +41,8 @@ main1 (float *pa)
int main (void) int main (void)
{ {
int i; int i;
afloat a[N]; float a[N] __attribute__ ((__aligned__(16)));
afloat b[N]; float b[N] __attribute__ ((__aligned__(16)));
check_vect (); check_vect ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment