diff options
author | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-27 09:12:05 +0000 |
---|---|---|
committer | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-27 09:12:05 +0000 |
commit | a0d5cf71be5e2fba5ab4418deb60d2ccf6363872 (patch) | |
tree | e30fc63fb8514b4f3b004d75368766b03aee6866 /gcc/testsuite/gcc.dg | |
parent | c5c17bcafb0278f31d2b183e630a8db6fa8a5ad9 (diff) | |
download | gcc-a0d5cf71be5e2fba5ab4418deb60d2ccf6363872.tar.gz |
gcc:
2004-04-27 Paolo Bonzini <bonzini@gnu.org>
* tree-complex.c (expand_vector_operation): New, extracted from
expand_vector_operations_1.
(tree_vec_extract): Build a NOP_EXPR.
(expand_vec_parallel): Do not care about returning the correct type.
(expand_vector_operations_1): Call expand_vector_operation.
Build the VIEW_CONVERT_EXPR on the left side of MODIFY_EXPRs.
* tree-complex.c (gate_expand_vector_operations): New.
(pass_lower_vector_ssa): Use it.
* tree-optimize.c (init_tree_optimization_passes): Include
pass_lower_vector_ssa.
* tree-vect-transform.c (vect_min_worthwhile_factor): New.
(vectorizable_operation): Use it.
* tree-vectorizer.c (get_vectype_for_scalar_type): Accept
integer modes for the vector type.
* defaults.h (UNITS_PER_SIMD_WORD): Default to UNITS_PER_WORD.
* tree-vect-analyze.c (vect_enhance_data_refs_alignment):
Do not cope with UNITS_PER_SIMD_WORD == 0.
* tree-vectorizer.c (get_vectype_for_scalar_type): Check
if the scalar type is not bigger than UNITS_PER_SIMD_WORD.
(vectorize_loops): Do not check that UNITS_PER_SIMD_WORD > 0.
* config/i386/i386.h (UNITS_PER_SIMD_WORD): Default to UNITS_PER_WORD.
* config/mips/mips.h (UNITS_PER_SIMD_WORD): Likewise.
* config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Likewise.
* config/sparc/sparc.h (UNITS_PER_SIMD_WORD): Likewise.
* config/alpha/alpha.h (UNITS_PER_SIMD_WORD): Remove.
* config/bfin/bfin.h (UNITS_PER_SIMD_WORD): Remove.
* config/ia64/ia64.h (UNITS_PER_SIMD_WORD): Remove.
* doc/tm.texi (UNITS_PER_WORD): Rephrase more accurately.
(UNITS_PER_SIMD_WORD): New.
gcc/testsuite:
2004-04-27 Paolo Bonzini <bonzini@gnu.org>
* gcc.dg/tree-ssa/gen-vect-11.c, gcc.dg/tree-ssa/gen-vect-11a.c,
gcc.dg/tree-ssa/gen-vect-11b.c, gcc.dg/tree-ssa/gen-vect-11c.c,
gcc.dg/tree-ssa/gen-vect-2.c, gcc.dg/tree-ssa/gen-vect-25.c,
gcc.dg/tree-ssa/gen-vect-26.c, gcc.dg/tree-ssa/gen-vect-28.c,
gcc.dg/tree-ssa/gen-vect-32.c: New.
* gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Fix dg-final.
* gcc.dg/vect/vect-82_64.c, gcc.dg/vect/vect-83_64.c: Remove xfail,
don't run on PPC32.
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: tree-complex.c tree-optimize.c tree-vect-analyze.c defaults.h
CVS: tree-vect-transform.c tree-vectorizer.c ChangeLog
CVS: testsuite/ChangeLog config/alpha/alpha.h config/bfin/bfin.h
CVS: config/i386/i386.h config/ia64/ia64.h config/mips/mips.h
CVS: config/rs6000/rs6000.h
CVS: config/sparc/sparc.h doc/tm.texi
CVS: testsuite/gcc.dg/vect/vect-82.c
CVS: testsuite/gcc.dg/vect/vect-82_64.c
CVS: testsuite/gcc.dg/vect/vect-83.c
CVS: testsuite/gcc.dg/vect/vect-83_64.c
CVS: Added Files:
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-11.c
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-11b.c
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-11c.c
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-2.c
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-25.c
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-26.c
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-28.c
CVS: testsuite/gcc.dg/tree-ssa/gen-vect-32.c
CVS: ----------------------------------------------------------------------
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c | 32 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c | 38 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c | 33 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c | 39 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c | 37 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c | 52 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c | 34 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c | 35 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c | 33 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-82.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-82_64.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-83.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-83_64.c | 5 |
13 files changed, 341 insertions, 6 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c new file mode 100644 index 00000000000..bc6c2869d75 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 16 + +int main () +{ + int i; + char ia[N]; + char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + + 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 (); + } + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c new file mode 100644 index 00000000000..75ec7ce8863 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 16 + +#if __LONG_MAX__ == 2147483647 +typedef short half_word; +#else +typedef int half_word; +#endif + +int main () +{ + int i; + half_word ia[N]; + half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + + 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 (); + } + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c new file mode 100644 index 00000000000..20833533468 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 16 + +int main () +{ + int i; + char ia[N]; + char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + + /* Not vectorizable, multiplication */ + for (i = 0; i < N; i++) + { + ia[i] = ib[i] * ic[i]; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (ia[i] != (char) (ib[i] * ic[i])) + abort (); + } + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c new file mode 100644 index 00000000000..8632ae42b3a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 16 + +#if LONG_MAX == 2147483647 +typedef short half_word; +#else +typedef int half_word; +#endif + +int main () +{ + int i; + half_word ia[N]; + half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + + /* Not worthwhile, only 2 parts per int */ + 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 (); + } + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c new file mode 100644 index 00000000000..be89c268258 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 16 + +#if __LONG_MAX__ == 2147483647 +typedef short half_word; +#else +typedef int half_word; +#endif + +int main () +{ + half_word cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + half_word ca[N]; + int i; + + for (i = 0; i < N; i++) + { + ca[i] = cb[i]; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (ca[i] != cb[i]) + abort (); + } + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c new file mode 100644 index 00000000000..1e0c2c11cf8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c @@ -0,0 +1,52 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 128 + +#if __LONG_MAX__ == 2147483647 +typedef short half_word; +#else +typedef int half_word; +#endif + +int main (int n, int *p) +{ + int i; + half_word ib[N]; + half_word ia[N]; + int k; + + for (i = 0; i < N; i++) + { + ia[i] = n; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (ia[i] != n) + abort (); + } + + k = *p; + for (i = 0; i < N; i++) + { + ib[i] = k; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (ib[i] != k) + abort (); + } + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c new file mode 100644 index 00000000000..b90413aa4bf --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 128 + +/* unaligned store. */ + +int main () +{ + int i; + char ia[N+1]; + + for (i = 1; i <= N; i++) + { + ia[i] = 5; + } + + /* check results: */ + for (i = 1; i <= N; i++) + { + if (ia[i] != 5) + abort (); + } + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c new file mode 100644 index 00000000000..0d017529357 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 128 +#define OFF 3 + +/* unaligned store. */ + +int main (int off) +{ + int i; + char ia[N+OFF]; + + for (i = 0; i < N; i++) + { + ia[i+off] = 5; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (ia[i+off] != 5) + abort (); + } + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c new file mode 100644 index 00000000000..681c7071685 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */ + +#include <stdlib.h> + +#define N 16 + +int main () +{ + struct { + char ca[N]; + } s; + int i; + + for (i = 0; i < N; i++) + { + s.ca[i] = 5; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (s.ca[i] != 5) + abort (); + } + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-82.c b/gcc/testsuite/gcc.dg/vect/vect-82.c index ac682c7997b..aecd61970d5 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-82.c +++ b/gcc/testsuite/gcc.dg/vect/vect-82.c @@ -32,5 +32,5 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-82_64.c b/gcc/testsuite/gcc.dg/vect/vect-82_64.c index d6e97523695..a21ed1281fe 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-82_64.c +++ b/gcc/testsuite/gcc.dg/vect/vect-82_64.c @@ -1,4 +1,5 @@ -/* { dg-do run { target powerpc*-*-* } } */ +/* { dg-do run { target { powerpc*-*-* && lp64 } } } */ +/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */ /* { dg-options "-O2 -ftree-vectorize -mpowerpc64 -fdump-tree-vect-stats -maltivec" } */ #include <stdarg.h> @@ -33,5 +34,5 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-83.c b/gcc/testsuite/gcc.dg/vect/vect-83.c index 7a23f5b4908..5c21cbbe341 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-83.c +++ b/gcc/testsuite/gcc.dg/vect/vect-83.c @@ -32,5 +32,5 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-83_64.c b/gcc/testsuite/gcc.dg/vect/vect-83_64.c index ea99a9e21be..b5f6f6f08a5 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-83_64.c +++ b/gcc/testsuite/gcc.dg/vect/vect-83_64.c @@ -1,4 +1,5 @@ -/* { dg-do run { target powerpc*-*-* } } */ +/* { dg-do run { target { powerpc*-*-* && lp64 } } } */ +/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */ /* { dg-options "-O2 -ftree-vectorize -mpowerpc64 -fdump-tree-vect-stats -maltivec" } */ #include <stdarg.h> @@ -33,5 +34,5 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ |