summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-27 12:45:13 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-27 12:45:13 +0000
commit268b9e9e95f56a59a8817b28ad59b53f40fc668d (patch)
tree5e9529982daf11d5b3ab800d4c58bc3fbee99d28 /gcc/testsuite/gcc.dg/vect
parente1910362719612f58bd1ea5050fa7a5175036abc (diff)
downloadgcc-268b9e9e95f56a59a8817b28ad59b53f40fc668d.tar.gz
2009-04-27 Basile Starynkevitch <basile@starynkevitch.net>
MERGED WITH TRUNK r146824:: * gcc/basilys.h: all GTY goes before the identifiers. * gcc/basilys.c: removed errors.h include. * gcc/run-basilys.h: ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@146839 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect')
-rw-r--r--gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c32
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c18
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c18
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-54.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-56.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-58.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-60.c5
8 files changed, 74 insertions, 14 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c b/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c
new file mode 100644
index 00000000000..7d6af7b82f3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 128
+
+int out[N*4], out2[N], in[N*4];
+
+void
+foo ()
+{
+ int i, a0, a1, a2, a3;
+
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*4];
+ a1 = in[i*4 + 1];
+ a2 = in[i*4 + 2];
+ a3 = in[i*4 + 3];
+
+ out[i*4] = a0;
+ out[i*4 + 1] = a1;
+ out[i*4 + 2] = a2;
+ out[i*4 + 3] = a3;
+
+ out2[i] = a0;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided_wide } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided_wide } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c
index d9bb114d416..cd7bb01a50d 100644
--- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c
@@ -76,5 +76,5 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c
index b7ef4b43017..69f79bf8823 100644
--- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c
@@ -1,6 +1,7 @@
/* { dg-require-effective-target vect_float } */
#include <stdarg.h>
+#include <string.h>
#include "tree-vect.h"
#define N 256
@@ -20,6 +21,15 @@ void bar (float *pa, float *pb, float *pc)
return;
}
+__attribute__ ((noinline))
+void foo (float *pb, float *pc)
+{
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ memcpy (pb, b, sizeof (b));
+ memcpy (pc, c, sizeof (c));
+}
+
/* Unaligned pointer read accesses with known alignment,
and an unaligned write access with unknown alignment.
The loop bound is known and divisible by the vectorization factor.
@@ -33,11 +43,13 @@ __attribute__ ((noinline)) int
main1 (float *pa)
{
int i;
- 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};
+ float b[N] __attribute__ ((__aligned__(16)));
+ float c[N] __attribute__ ((__aligned__(16)));
float *pb = b;
float *pc = c;
+ foo (pb, pc);
+
for (i = 0; i < N/2; i++)
{
pa[i] = pb[i+1] * pc[i+1];
@@ -59,5 +71,5 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c
index 39491a882e5..47b268e148b 100644
--- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c
@@ -2,6 +2,7 @@
/* { dg-require-effective-target vect_float } */
#include <stdarg.h>
+#include <string.h>
#include "tree-vect.h"
#define N 256
@@ -21,6 +22,15 @@ void bar (float *pa, float *pb, float *pc)
return;
}
+__attribute__ ((noinline))
+void foo (float *pb, float *pc)
+{
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ memcpy (pb, b, sizeof (b));
+ memcpy (pc, c, sizeof (c));
+}
+
/* Unaligned pointer read accesses with known alignment,
and an unaligned write access with unknown alignment.
The loop bound is iunknown.
@@ -34,11 +44,13 @@ __attribute__ ((noinline)) int
main1 (int n , float *pa)
{
int i;
- 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};
+ float b[N] __attribute__ ((__aligned__(16)));
+ float c[N] __attribute__ ((__aligned__(16)));
float *pb = b;
float *pc = c;
+ foo (pb, pc);
+
for (i = 0; i < n/2; i++)
{
pa[i] = pb[i+1] * pc[i+1];
@@ -61,5 +73,5 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-54.c b/gcc/testsuite/gcc.dg/vect/vect-54.c
index 6e1aa549a97..a44cdd41811 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-54.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-54.c
@@ -26,13 +26,14 @@ void bar (float *pa, float *pb, float *pc)
vect-58.c is similar to this one with one difference:
the loop bound is unknown. */
+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};
+
__attribute__ ((noinline)) int
main1 ()
{
int i;
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};
float *pa = a;
float *pb = b;
float *pc = c;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc/testsuite/gcc.dg/vect/vect-56.c
index 387bd3ab854..624a11287ea 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-56.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-56.c
@@ -30,13 +30,14 @@ void bar (float *pa, float *pb, float *pc)
vect-57.c is similar to this one with two differences:
aliasing is a problem, and the write access has unknown alignment. */
+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};
+
__attribute__ ((noinline)) int
main1 ()
{
int i;
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};
float *pa = a;
float *pb = b;
float *pc = c;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-58.c b/gcc/testsuite/gcc.dg/vect/vect-58.c
index 94cc3efa468..fe58860e000 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-58.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-58.c
@@ -26,11 +26,12 @@ void bar (float *pa, float *pb, float *pc)
vect-54.c is similar to this one with one difference:
the loop bound is known. */
+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};
+
__attribute__ ((noinline)) int
main1 (int n)
{
int i;
- 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};
float *pa = a;
float *pb = b;
float *pc = c;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc/testsuite/gcc.dg/vect/vect-60.c
index 97e614c0652..efb1d5043c4 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-60.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-60.c
@@ -30,13 +30,14 @@ void bar (float *pa, float *pb, float *pc)
vect-61.c is similar to this one with two differences:
aliasing is not a problem, and the write access has unknown alignment. */
+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};
+
__attribute__ ((noinline)) int
main1 (int n)
{
int i;
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};
float *pa = a;
float *pb = b;
float *pc = c;