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
This commit is contained in:
Dorit Nuzman 2005-08-16 15:02:39 +00:00 committed by Dorit Nuzman
parent 20fe2233a7
commit d110b74089
31 changed files with 157 additions and 104 deletions

View 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.

View 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" } } */

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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 ();

View 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)

View 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)
{

View 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)
{

View 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)
{

View 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)

View 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)
{

View 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 ();

View 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 ();

View 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 ();

View File

@ -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;
}

View 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 ();