aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-92.c
diff options
context:
space:
mode:
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;
}