OSDN Git Service

* lib/target-supports.exp (check_effective_target_vect_aligned_arrays):
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 14 Jul 2007 05:50:06 +0000 (05:50 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 14 Jul 2007 05:50:06 +0000 (05:50 +0000)
        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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr25413.c
gcc/testsuite/gcc.dg/vect/pr25413a.c
gcc/testsuite/gcc.dg/vect/pr31699.c
gcc/testsuite/lib/target-supports.exp

index 8a309c6..f84bffc 100644 (file)
@@ -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
index a171249..7444725 100644 (file)
@@ -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" } } */
index 730920a..89291c6 100644 (file)
@@ -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" } } */
index 1ea8121..d1e396e 100644 (file)
@@ -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" } } */
index cdcb456..212995b 100644 (file)
@@ -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 { } {