aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-46.c
diff options
context:
space:
mode:
authorDorit Naishlos <dorit@il.ibm.com>2004-08-17 16:17:14 +0000
committerDorit Nuzman <dorit@gcc.gnu.org>2004-08-17 16:17:14 +0000
commit79fe1b3bd07343a1be36195a9053b582198a4123 (patch)
tree49effbb8670b04dbfb66de531c733c3e4389a525 /gcc/testsuite/gcc.dg/vect/vect-46.c
parentbaeff9708eb16a669c72cdebb32062ef1f6e6abc (diff)
downloadgcc-79fe1b3bd07343a1be36195a9053b582198a4123.zip
gcc-79fe1b3bd07343a1be36195a9053b582198a4123.tar.gz
gcc-79fe1b3bd07343a1be36195a9053b582198a4123.tar.bz2
tree-vectorizer.c: New File: loop vectorization on SSAed GIMPLE trees.
* tree-vectorizer.c: New File: loop vectorization on SSAed GIMPLE trees. * tree-vectorizer.h: New File: Same. * Makefile.in (tree-vectorizer.c, tree-vectorizer.h): Add new files. * common.opt (ftree-vectorize): New flag to enable vectorization. * timevar.def (TV_TREE_VECTORIZATION): New dump file for vectorization pass. * tree-data-ref.h (init_data_ref): Additional argument. (array_base_name_differ_p): Moved to tree-data-ref.c. * tree-data-ref.c (array_base_name_differ_p): Revised. (initialize_data_dependence_relation): Call array_base_name_differ_p with an extra argument. (analyze_all_data_dependences): Same. (init_data_ref): Additional argument is_read to set DR_IS_READ. * tree-ssa-phiopt.c (empty_block_p): Expose for usage out of this file. * tree-flow.h (vectorize_loops, empty_block_p): Add declaration. * tree-optimize.c (pass_vectorize): Schedule the vectorization pass. * tree-pass.h (tree_opt_pass pass_vectorize): Declare the new vectorization pass. * tree-ssa-loop.c (tree_ssa_loop_init): Call scev_initialize. (tree_ssa_loop_done): Call scev_finalize. (tree_vectorize): Define the new vectorization pass. * defaults.h (UNITS_PER_SIMD_WORD): Allow targets to specify the size of the vector they support (until support for multiple vector sizes is added to the vectorizer). * config/i386/i386.h (UNITS_PER_SIMD_WORD): Define. * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Define. * invoke.texi (fdump-tree-vect, ftree-vectorize): Add documentation. From-SVN: r86131
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/vect-46.c')
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-46.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/vect-46.c b/gcc/testsuite/gcc.dg/vect/vect-46.c
new file mode 100644
index 0000000..1fb08a7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-46.c
@@ -0,0 +1,56 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse" { target i?86-*-* x86_64-*-* } } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+typedef float afloat __attribute__ ((__aligned__(16)));
+
+void bar (afloat *pa, afloat *pb, afloat *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort();
+ }
+
+ return;
+}
+
+
+int
+main1 (int n , afloat * __restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ return 0;
+}
+
+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};
+
+ check_vect ();
+
+ main1 (n,a,b,c);
+ bar (a,b,c);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */