diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-12 14:42:08 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-12 14:42:08 +0000 |
commit | 5a2538e1f731cddd8181f231dbb1ed146b1b19bd (patch) | |
tree | 1d606e4397ee32cd9fe29b0165fe91119ff4fbc6 /gcc/config | |
parent | 8eec5c17af3db818b7ab3339ece8f71d1704ff3d (diff) | |
download | gcc-5a2538e1f731cddd8181f231dbb1ed146b1b19bd.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126591 138bc75d-0d04-0410-961f-82ee72b054a4
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. |