diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-14 05:50:06 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-14 05:50:06 +0000 |
commit | 5090788d21347c75b5041a179c29e21344a457b2 (patch) | |
tree | cd0a7e94f83630d0ea64e01a97e6f591bfea68bb | |
parent | 88c59a4f1fe4217be0f0035a2c075d8cc0eba155 (diff) | |
download | gcc-5090788d21347c75b5041a179c29e21344a457b2.tar.gz |
* lib/target-supports.exp (check_effective_target_vect_aligned_arrays):
New procedure to check if arrays are naturally aligned to the vector
alignment boundary.
* gcc.dg/vect/pr25413a.c: Do not include stdarg.h. Use __SIZE_TYPE__
in size_t typedef. Adjust tree dump scan results according to
vect_aligned_arrays target check.
* gcc.dg/vect/pr25413.c: Adjust tree dump scan results according to
vect_aligned_arrays target check.
* gcc.dg/vect/pr31699.c: Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126636 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr25413.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr25413a.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr31699.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 21 |
5 files changed, 44 insertions, 10 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8a309c6f816..f84bffc47e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2007-07-14 Uros Bizjak <ubizjak@gmail.com> + + * lib/target-supports.exp (check_effective_target_vect_aligned_arrays): + New procedure to check if arrays are naturally aligned to the vector + alignment boundary. + * gcc.dg/vect/pr25413a.c: Do not include stdarg.h. Use __SIZE_TYPE__ + in size_t typedef. Adjust tree dump scan results according to + vect_aligned_arrays target check. + * gcc.dg/vect/pr25413.c: Adjust tree dump scan results according to + vect_aligned_arrays target check. + * gcc.dg/vect/pr31699.c: Ditto. + 2007-07-13 Sa Liu <saliu@de.ibm.com> * gcc.dg/vect/fast-math-vect-reduc-7.c: Switch on test diff --git a/gcc/testsuite/gcc.dg/vect/pr25413.c b/gcc/testsuite/gcc.dg/vect/pr25413.c index a171249ff3c..744472518eb 100644 --- a/gcc/testsuite/gcc.dg/vect/pr25413.c +++ b/gcc/testsuite/gcc.dg/vect/pr25413.c @@ -31,7 +31,8 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_aligned_arrays } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_aligned_arrays } } } } */ +/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vect_aligned_arrays } } } } */ +/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 1 "vect" { target { ! vect_aligned_arrays } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr25413a.c b/gcc/testsuite/gcc.dg/vect/pr25413a.c index 730920a16da..89291c6dc30 100644 --- a/gcc/testsuite/gcc.dg/vect/pr25413a.c +++ b/gcc/testsuite/gcc.dg/vect/pr25413a.c @@ -1,13 +1,13 @@ /* { dg-require-effective-target vect_double } */ -#include <stdarg.h> #include "tree-vect.h" #define N 8 -typedef unsigned int size_t; +typedef __SIZE_TYPE__ size_t; -extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); +extern void *malloc (size_t __size) __attribute__ ((__nothrow__, + __malloc__)); typedef double num_t; static const num_t num__infty = ((num_t)1.0)/((num_t)0.0); @@ -124,6 +124,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vect_aligned_arrays } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vect_aligned_arrays } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr31699.c b/gcc/testsuite/gcc.dg/vect/pr31699.c index 1ea8121691b..d1e396ed7dc 100644 --- a/gcc/testsuite/gcc.dg/vect/pr31699.c +++ b/gcc/testsuite/gcc.dg/vect/pr31699.c @@ -31,6 +31,6 @@ int main() } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_intfloat_cvt } } } */ -/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vect_aligned_arrays } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vect_aligned_arrays } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index cdcb456414b..212995b949c 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2010,6 +2010,27 @@ proc check_effective_target_vect_no_align { } { return $et_vect_no_align_saved } +# Return 1 if arrays are naturally aligned to the vector +# alignment boundary, 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_vect_aligned_arrays { } { + global et_vect_aligned_arrays + + if [info exists et_vect_aligned_arrays_saved] { + verbose "check_effective_target_vect_aligned_arrays: using cached result" 2 + } else { + set et_vect_aligned_arrays_saved 0 + if { ([istarget x86_64-*-*] + || [istarget i?86-*-*]) && [is-effective-target lp64] } { + set et_vect_aligned_arrays_saved 1 + } + } + verbose "check_effective_target_vect_aligned_arrays: returning $et_vect_aligned_arrays_saved" 2 + return $et_vect_aligned_arrays_saved +} + # Return 1 if the target supports vector conditional operations, 0 otherwise. proc check_effective_target_vect_condition { } { |