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
+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
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" } } */
/* { 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);
}
/* { 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" } } */
}
/* { 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" } } */
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 { } {