summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-92.c
diff options
context:
space:
mode:
authordorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-16 15:02:39 +0000
committerdorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-16 15:02:39 +0000
commit0351488c362b816a67c073de9898c20239ccf3d3 (patch)
treeeb986f4c63313c2d95433b7ac6166cd8defb1989 /gcc/testsuite/gcc.dg/vect/vect-92.c
parent7f0345dce76a348011c1352789eed8f69867317a (diff)
downloadgcc-0351488c362b816a67c073de9898c20239ccf3d3.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103158 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/vect-92.c')
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-92.c29
1 files changed, 17 insertions, 12 deletions
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)));
-
-/* 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;
}