summaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2018-11-13 13:07:12 +0100
committerClaudiu Zissulescu <claziss@gcc.gnu.org>2018-11-13 13:07:12 +0100
commit90b480138a5492776e9fab6e7f95aae874d6a0ea (patch)
treeb009dad794b86a822eabf2473e17109b5ac96aac /gcc/common
parent8fa2c211f7852b1fe330423f4af096016bb3acbc (diff)
[ARC] Refurbish and improve prologue/epilogue functions.
Reimplement how prologue and epilogue is emitted to accomodate enter/leave instructions, as well as improving the size of the existing techinques. The following modifications are added: - millicode thunk calls can be now selected regardless of the optimization level. However they are enabled for size optimizations by default. Also, the millicode optimization is turned off when we compile for long jumps. - the compiler is able to use enter/leave instructions for prologue and epilogue. As these instructions are not ABI compatible we gurad them under a switch (i.e., -mcode-density-frame). When this option is on, the compiler will try emitting enter/leave instructions, if not, then millicode thunk calls (if enabled), and latter the regular push/pop instructions. - The prologue/epilogue is now optimized to use pointer walks, hence improving the chance to have push_s/pop_s instructions emitted. It also tries to combine the stack adjustments with load/store operations. gcc/ xxxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * common/config/arc/arc-common.c (arc_option_optimization_table): Millicode optimization is default on for size optimizations. * config/arc/arc-protos.h (arc_check_multi): New function. * config/arc/arc.c (RTX_OK_FOR_OFFSET_P): Rearange. (ENTER_LEAVE_START_REG): Define. (ENTER_LEAVE_END_REG): Likewise. (arc_override_options): Disable millicode when long calls option is on. (arc_frame_info): Change it from int to bool. (arc_compute_frame_size): Clean up. (arc_save_restore): Remove. (frame_save_reg): New function. (frame_restore_reg): Likewise. (arc_enter_leave_p): Likewise. (arc_save_callee_saves): Likewise. (arc_restore_callee_saves): Likewise. (arc_save_callee_enter): Likewise. (arc_restore_callee_leave): Likewise. (arc_save_callee_milli): Likewise. (arc_restore_callee_milli): Likewise. (arc_expand_prologue): Reimplement to emit enter/leave instructions. (arc_expand_epilogue): Likewise. (arc_check_multi): New function. * config/arc/arc.md (push_multi_fp): New pattern. (push_multi_fp_blink): Likewise. (pop_multi_fp): Likewise. (pop_multi_fp_blink): Likewise. (pop_multi_fp_ret): Likewise. (pop_multi_fp_blink_ret): Likewise. * config/arc/arc.opt (mmillicode): Update option. (mcode-density-frame): New option. * config/arc/predicates.md (push_multi_operand): New predicate. (pop_multi_operand): Likewise. * doc/invoke.texi (ARC): Update ARC options information. gcc/testsuite xxxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * gcc.target/arc/firq-1.c: Update test. * gcc.target/arc/firq-3.c: Likewise. * gcc.target/arc/firq-4.c: Likewise. * gcc.target/arc/interrupt-6.c: Likewise. From-SVN: r266065
Diffstat (limited to 'gcc/common')
-rw-r--r--gcc/common/config/arc/arc-common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/common/config/arc/arc-common.c b/gcc/common/config/arc/arc-common.c
index 578431a279d..2872388de2c 100644
--- a/gcc/common/config/arc/arc-common.c
+++ b/gcc/common/config/arc/arc-common.c
@@ -59,6 +59,7 @@ static const struct default_options arc_option_optimization_table[] =
{ OPT_LEVELS_SIZE, OPT_mq_class, NULL, 1 },
{ OPT_LEVELS_SIZE, OPT_mcase_vector_pcrel, NULL, 1 },
{ OPT_LEVELS_SIZE, OPT_msize_level_, NULL, 3 },
+ { OPT_LEVELS_SIZE, OPT_mmillicode, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
{ OPT_LEVELS_3_PLUS_SPEED_ONLY, OPT_msize_level_, NULL, 0 },
{ OPT_LEVELS_3_PLUS_SPEED_ONLY, OPT_malign_call, NULL, 1 },