target-supports.exp (check_effective_target_vect_aligned_arrays): New procedure to...
authorUros Bizjak <ubizjak@gmail.com>
Sat, 14 Jul 2007 05:50:06 +0000 (07:50 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sat, 14 Jul 2007 05:50:06 +0000 (07:50 +0200)
        * 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.

From-SVN: r126636

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 8a309c6f816275766f580efaa67e6bc2d3d11d04..f84bffc47e67f888158da6f583bddcd6e39c8aaa 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 a171249ff3ce830254ac6a11e059ecec900b71ae..744472518ebfef6fbe8d381c739c82088895b7a1 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 730920a16daecfa3cd81b516e59530367a493e04..89291c6dc3059dd5736dbd52d04d693d13ac4a31 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 1ea8121691b8afb0ebd2a24957afc814a7e71357..d1e396ed7dc6d5f8be8986ba1293c7550616b234 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 cdcb456414b8f76756071f6b83d39b752fc40835..212995b949cb5571ab8aa35ce1d57b2990c148e6 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 { } {