summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-18.c
diff options
context:
space:
mode:
authordorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-17 16:17:14 +0000
committerdorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-17 16:17:14 +0000
commitc91e822398d80d51e7b0e0884fa3e8c7c32d6ae7 (patch)
tree49effbb8670b04dbfb66de531c733c3e4389a525 /gcc/testsuite/gcc.dg/vect/vect-18.c
parent867fd9060f9bdfef84dbea3354f5747c94d60a13 (diff)
downloadgcc-c91e822398d80d51e7b0e0884fa3e8c7c32d6ae7.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86131 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/vect-18.c')
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-18.c129
1 files changed, 129 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/vect-18.c b/gcc/testsuite/gcc.dg/vect/vect-18.c
new file mode 100644
index 00000000000..88b0fc020c2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-18.c
@@ -0,0 +1,129 @@
+/* { 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 -msse2" { target i?86-*-* x86_64-*-* } } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+int
+main1 ()
+{
+ int i;
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+ int ic[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char ca[N];
+ char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char cc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = (ib[i] | ic[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != (ib[i] | ic[i]))
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = (cb[i] | cc[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != (cb[i] | cc[i]))
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = (sb[i] | sc[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != (sb[i] | sc[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {xfail i?86-*-* x86_64-*-*} } } */