From b4917c98f0b2659f7a1136465a9439939feb8da8 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Thu, 11 Dec 2014 23:11:03 +0000 Subject: [PATCH] aarch64-protos.h (tune_params): Add align field. 2014-12-11 Andrew Pinski * config/aarch64/aarch64-protos.h (tune_params): Add align field. * config/aarch64/aarch64.c (generic_tunings): Specify align. (cortexa53_tunings): Likewise. (cortexa57_tunings): Likewise. (thunderx_tunings): Likewise. (aarch64_override_options): Set align_loops, align_jumps, align_functions based on what the tuning struct. From-SVN: r218645 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/aarch64/aarch64-protos.h | 1 + gcc/config/aarch64/aarch64.c | 16 ++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf3fb854032..7478b0f02b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2014-12-11 Andrew Pinski + + * config/aarch64/aarch64-protos.h (tune_params): Add align field. + * config/aarch64/aarch64.c (generic_tunings): Specify align. + (cortexa53_tunings): Likewise. + (cortexa57_tunings): Likewise. + (thunderx_tunings): Likewise. + (aarch64_override_options): Set align_loops, align_jumps, + align_functions based on what the tuning struct. + 2014-12-11 Eric Botcazou * doc/md.texi (Insn Lengths): Fix description of (pc). diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index bcfe89e5c3c..234efcb3270 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -170,6 +170,7 @@ struct tune_params const struct cpu_vector_cost *const vec_costs; const int memmov_cost; const int issue_rate; + const int align; const unsigned int fuseable_ops; const int int_reassoc_width; const int fp_reassoc_width; diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index e1d1ad4b526..226a808a01a 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -323,6 +323,7 @@ static const struct tune_params generic_tunings = &generic_vector_cost, NAMED_PARAM (memmov_cost, 4), NAMED_PARAM (issue_rate, 2), + NAMED_PARAM (align, 4), NAMED_PARAM (fuseable_ops, AARCH64_FUSE_NOTHING), 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */ @@ -337,6 +338,7 @@ static const struct tune_params cortexa53_tunings = &generic_vector_cost, NAMED_PARAM (memmov_cost, 4), NAMED_PARAM (issue_rate, 2), + NAMED_PARAM (align, 8), NAMED_PARAM (fuseable_ops, (AARCH64_FUSE_MOV_MOVK | AARCH64_FUSE_ADRP_ADD | AARCH64_FUSE_MOVK_MOVK | AARCH64_FUSE_ADRP_LDR)), 2, /* int_reassoc_width. */ @@ -352,6 +354,7 @@ static const struct tune_params cortexa57_tunings = &cortexa57_vector_cost, NAMED_PARAM (memmov_cost, 4), NAMED_PARAM (issue_rate, 3), + NAMED_PARAM (align, 8), NAMED_PARAM (fuseable_ops, (AARCH64_FUSE_MOV_MOVK | AARCH64_FUSE_ADRP_ADD | AARCH64_FUSE_MOVK_MOVK)), 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */ @@ -366,6 +369,7 @@ static const struct tune_params thunderx_tunings = &generic_vector_cost, NAMED_PARAM (memmov_cost, 6), NAMED_PARAM (issue_rate, 2), + NAMED_PARAM (align, 8), NAMED_PARAM (fuseable_ops, AARCH64_FUSE_CMP_BRANCH), 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */ @@ -6762,6 +6766,18 @@ aarch64_override_options (void) #endif } + /* If not opzimizing for size, set the default + alignment to what the target wants */ + if (!optimize_size) + { + if (align_loops <= 0) + align_loops = aarch64_tune_params->align; + if (align_jumps <= 0) + align_jumps = aarch64_tune_params->align; + if (align_functions <= 0) + align_functions = aarch64_tune_params->align; + } + aarch64_override_options_after_change (); } -- 2.30.2