Commit 99c9c69a by Dorit Nuzman Committed by Dorit Nuzman

2007-07-24 Dorit Nuzman <dorit@il.ibm.com>

        * lib/target-support.exp (check_effective_target_natural_alignment):
        (check_effective_target_vector_alignment_reachable): New.
        * config/spu/spu.c (spu_vector_alignment_reachable): New.
        (TARGET_VECTOR_ALIGNMENT_REACHABLE): Define.
        * * gcc.dg/vect/pr25413a.c: Use vector_alignment_reachable target
        check.
        * gcc.dg/vect/pr25413.c: Likewise.
        * gcc.dg/vect/pr31699.c: Likewise.

From-SVN: r126872
parent 376164b9
......@@ -136,6 +136,7 @@ static tree spu_builtin_mul_widen_even (tree);
static tree spu_builtin_mul_widen_odd (tree);
static tree spu_builtin_mask_for_load (void);
static int spu_builtin_vectorization_cost (bool);
static bool spu_vector_alignment_reachable (tree, bool);
extern const char *reg_names[];
rtx spu_compare_op0, spu_compare_op1;
......@@ -272,6 +273,9 @@ const struct attribute_spec spu_attribute_table[];
#undef TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST
#define TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST spu_builtin_vectorization_cost
#undef TARGET_VECTOR_ALIGNMENT_REACHABLE
#define TARGET_VECTOR_ALIGNMENT_REACHABLE spu_vector_alignment_reachable
struct gcc_target targetm = TARGET_INITIALIZER;
void
......@@ -5477,6 +5481,20 @@ spu_builtin_vectorization_cost (bool runtime_test)
return 0;
}
/* Return true iff, data reference of TYPE can reach vector alignment (16)
after applying N number of iterations. This routine does not determine
how may iterations are required to reach desired alignment. */
static bool
spu_vector_alignment_reachable (tree type ATTRIBUTE_UNUSED, bool is_packed)
{
if (is_packed)
return false;
/* All other types are naturally aligned. */
return true;
}
void
spu_init_expanders (void)
{
......
2007-07-24 Dorit Nuzman <dorit@il.ibm.com>
* lib/target-support.exp (check_effective_target_natural_alignment):
(check_effective_target_vector_alignment_reachable): New.
* config/spu/spu.c (spu_vector_alignment_reachable): New.
(TARGET_VECTOR_ALIGNMENT_REACHABLE): Define.
* * gcc.dg/vect/pr25413a.c: Use vector_alignment_reachable target
check.
* gcc.dg/vect/pr25413.c: Likewise.
* gcc.dg/vect/pr31699.c: Likewise.
2007-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/30814
......@@ -31,8 +31,8 @@ int main (void)
return 0;
}
/* { 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 { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vector_alignment_reachable } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 1 "vect" { target { ! vector_alignment_reachable } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
......@@ -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" { target { ! vect_aligned_arrays } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vect_aligned_arrays } } } } */
/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
......@@ -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" { target { ! vect_aligned_arrays } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vect_aligned_arrays } } } } */
/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
......@@ -2031,6 +2031,47 @@ proc check_effective_target_vect_aligned_arrays { } {
return $et_vect_aligned_arrays_saved
}
# Return 1 if types are naturally aligned (aligned to their type-size),
# 0 otherwise.
#
# This won't change for different subtargets so cache the result.
proc check_effective_target_natural_alignment { } {
global et_natural_alignment
if [info exists et_natural_alignment_saved] {
verbose "check_effective_target_natural_alignment: using cached result" 2
} else {
set et_natural_alignment_saved 0
if { [istarget spu-*-*] } {
set et_natural_alignment_saved 1
}
}
verbose "check_effective_target_natural_alignment: returning $et_natural_alignment_saved" 2
return $et_natural_alignment_saved
}
# Return 1 if vector alignment is reachable, 0 otherwise.
#
# This won't change for different subtargets so cache the result.
proc check_effective_target_vector_alignment_reachable { } {
global et_vector_alignment_reachable
if [info exists et_vector_alignment_reachable_saved] {
verbose "check_effective_target_vector_alignment_reachable: using cached result" 2
} else {
if { [check_effective_target_vect_aligned_arrays]
|| [check_effective_target_natural_alignment] } {
set et_vector_alignment_reachable_saved 1
} else {
set et_vector_alignment_reachable_saved 0
}
}
verbose "check_effective_target_vector_alignment_reachable: returning $et_vector_alignment_reachable_saved" 2
return $et_vector_alignment_reachable_saved
}
# Return 1 if the target supports vector conditional operations, 0 otherwise.
proc check_effective_target_vect_condition { } {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment