aboutsummaryrefslogtreecommitdiff
path: root/gcc/targhooks.c
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@linaro.org>2012-07-30 14:39:32 +0000
committerUlrich Weigand <ulrich.weigand@linaro.org>2012-07-30 14:39:32 +0000
commitfc7bdb91a1ca1003e443a552ee2fc831b2d09dd1 (patch)
treedc5799dbc1af4d3d79e2dbe5b4f3915b5afa6052 /gcc/targhooks.c
parent3ff7a3042b47a5afc5235d94bc117cc851718c13 (diff)
ChangeLog:
* target.def (vector_alignment): New target hook. * doc/tm.texi.in (TARGET_VECTOR_ALIGNMENT): Document new hook. * doc/tm.texi: Regenerate. * targhooks.c (default_vector_alignment): New function. * targhooks.h (default_vector_alignment): Add prototype. * stor-layout.c (layout_type): Use targetm.vector_alignment. * config/arm/arm.c (arm_vector_alignment): New function. (TARGET_VECTOR_ALIGNMENT): Define. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Use vector type alignment instead of size. * tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): Use element type size directly instead of computing it from alignment. Fix variable naming and comment. testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_vect_natural_alignment): New function. * gcc.dg/align-2.c: Only run on targets with natural alignment of vector types. * gcc.dg/vect/slp-25.c: Adjust tests for targets without natural alignment of vector types. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@189974 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r--gcc/targhooks.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 8993659a9ec..1703aad9c96 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -945,6 +945,13 @@ tree default_mangle_decl_assembler_name (tree decl ATTRIBUTE_UNUSED,
return id;
}
+/* Default to natural alignment for vector types. */
+HOST_WIDE_INT
+default_vector_alignment (const_tree type)
+{
+ return tree_low_cst (TYPE_SIZE (type), 0);
+}
+
bool
default_builtin_vector_alignment_reachable (const_tree type, bool is_packed)
{