diff options
author | Dorit Nuzman <dorit@il.ibm.com> | 2007-07-12 14:42:08 +0000 |
---|---|---|
committer | Dorit Nuzman <dorit@gcc.gnu.org> | 2007-07-12 14:42:08 +0000 |
commit | 5b900a4c0ee38a66b04b4ceeecb8b194ddde7e57 (patch) | |
tree | 1d606e4397ee32cd9fe29b0165fe91119ff4fbc6 /gcc/config | |
parent | 2df6377e6e01046582d489ae59b5be1371b42d59 (diff) | |
download | gcc-5b900a4c0ee38a66b04b4ceeecb8b194ddde7e57.tar.gz |
re PR target/25413 (wrong alignment or incorrect address computation in vectorized code on Pentium 4 SSE)
2007-07-12 Dorit Nuzman <dorit@il.ibm.com>
Devang Patel <dpatel@apple.com>
PR tree-optimization/25413
* targhooks.c (default_builtin_vector_alignment_reachable): New.
* targhooks.h (default_builtin_vector_alignment_reachable): New.
* tree.h (contains_packed_reference): New.
* expr.c (contains_packed_reference): New.
* tree-vect-analyze.c (vector_alignment_reachable_p): New.
(vect_enhance_data_refs_alignment): Call
vector_alignment_reachable_p.
* target.h (vector_alignment_reachable): New builtin.
* target-def.h (TARGET_VECTOR_ALIGNMENT_REACHABLE): New.
* config/rs6000/rs6000.c (rs6000_vector_alignment_reachable): New.
(TARGET_VECTOR_ALIGNMENT_REACHABLE): Define.
Co-Authored-By: Devang Patel <dpatel@apple.com>
From-SVN: r126591
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 722a5a6c342..c9c5a19f878 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -717,6 +717,7 @@ static tree rs6000_builtin_mul_widen_odd (tree); static tree rs6000_builtin_conversion (enum tree_code, tree); static void def_builtin (int, const char *, tree, int); +static bool rs6000_vector_alignment_reachable (tree, bool); static void rs6000_init_builtins (void); static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx); static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx); @@ -984,6 +985,9 @@ static const char alt_reg_names[][8] = #undef TARGET_VECTORIZE_BUILTIN_CONVERSION #define TARGET_VECTORIZE_BUILTIN_CONVERSION rs6000_builtin_conversion +#undef TARGET_VECTOR_ALIGNMENT_REACHABLE +#define TARGET_VECTOR_ALIGNMENT_REACHABLE rs6000_vector_alignment_reachable + #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS rs6000_init_builtins @@ -1806,6 +1810,37 @@ rs6000_builtin_mul_widen_odd (tree type) } } + +/* 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 +rs6000_vector_alignment_reachable (tree type ATTRIBUTE_UNUSED, bool is_packed) +{ + if (is_packed) + return false; + + if (TARGET_32BIT) + { + if (rs6000_alignment_flags == MASK_ALIGN_NATURAL) + return true; + + if (rs6000_alignment_flags == MASK_ALIGN_POWER) + return true; + + return false; + } + else + { + if (TARGET_MACHO) + return false; + + /* Assuming that all other types are naturally aligned. CHECKME! */ + return true; + } +} + /* Handle generic options of the form -mfoo=yes/no. NAME is the option name. VALUE is the option value. |