From d110b74089c5edde21dd46fbcf35659cbc1f98d0 Mon Sep 17 00:00:00 2001 From: Dorit Nuzman Date: Tue, 16 Aug 2005 15:02:39 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 37 +++++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/vect/vect-35.c | 16 ++++++------- gcc/testsuite/gcc.dg/vect/vect-40.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-41.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-42.c | 10 ++++---- gcc/testsuite/gcc.dg/vect/vect-43.c | 10 ++++---- gcc/testsuite/gcc.dg/vect/vect-44.c | 9 +++---- gcc/testsuite/gcc.dg/vect/vect-46.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-47.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-48.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-52.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-53.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-54.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-55.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-56.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-57.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-58.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-59.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-60.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-61.c | 6 ++--- gcc/testsuite/gcc.dg/vect/vect-74.c | 10 +++++--- gcc/testsuite/gcc.dg/vect/vect-75.c | 6 ++++- gcc/testsuite/gcc.dg/vect/vect-76.c | 6 ++++- gcc/testsuite/gcc.dg/vect/vect-77.c | 6 ++++- gcc/testsuite/gcc.dg/vect/vect-78.c | 6 ++++- gcc/testsuite/gcc.dg/vect/vect-80.c | 11 +++++---- gcc/testsuite/gcc.dg/vect/vect-85.c | 4 +--- gcc/testsuite/gcc.dg/vect/vect-87.c | 4 +--- gcc/testsuite/gcc.dg/vect/vect-88.c | 4 +--- gcc/testsuite/gcc.dg/vect/vect-92.c | 27 ++++++++++++--------- gcc/testsuite/gcc.dg/vect/vect-93.c | 5 ++-- 31 files changed, 157 insertions(+), 104 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 407be8cd0ce..a38b71071a7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,40 @@ +2005-08-16 Dorit Nuzman + + * 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 * 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 897868daeda..ef36d1ca6e8 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-35.c +++ b/gcc/testsuite/gcc.dg/vect/vect-35.c @@ -3,24 +3,24 @@ #include #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 89fc88e2879..7abacd65903 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 21591b6af61..ee2ccdf4b87 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 4cab6311314..714596891d3 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 12db333b39b..e47bdaaeb81 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 46eb2a6d0e9..0bd2d22e006 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 4ced75a4642..687393400a9 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 12a7a5afb8c..4f21ffc88c8 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 b4da6d01f47..83ec09a37ca 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 d321dcfdee6..a1cb82c92ad 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 ff3c1037467..1fd7c9305e3 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 b68c61badc3..197e6d12680 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 6d130df0c5c..6601b2fc7f1 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 de53a2ad595..fe4c7b6482e 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 950cdaeb13b..f197eb4b69d 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 5d282d47f41..67bce93cc90 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 568dc0e662c..c061a3a28e5 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 188fa15aeba..3021ee4436c 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 2911048f723..5b0f5d95432 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 86e09c9098d..d4593cbb891 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 121eddd54dc..d923a83e28d 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 1c3eba95a58..b8312780f5b 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 8557b298bf8..0e456797ff0 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 a059f308b9c..f231e0dc73a 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 e05ff04fb52..25ca6d638c7 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 7d193999a2a..4c242626427 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 959a466a8e9..6b74a0d5109 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 884b3b2c5fc..478a142bfb0 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 a2c57407ed1..b47d859548d 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))); +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}; -/* known misalignment: same alignment */ +/* 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 87650ab440b..af2f1663a22 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 ();