target-supports.exp (check_effective_target_vect_aligned_arrays): New procedure to check if arrays are naturally aligned to the vector alignment...

* 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
This commit is contained in:
Uros Bizjak 2007-07-14 07:50:06 +02:00 committed by Uros Bizjak
parent e6343c8d29
commit 5de7f07cb4
5 changed files with 44 additions and 10 deletions

View 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

View 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" } } */

View 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" } } */

View 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" } } */

View 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 { } {