2010-07-12 20:53:01 +02:00
|
|
|
/* Target-dependent globals.
|
2017-01-01 13:07:43 +01:00
|
|
|
Copyright (C) 2010-2017 Free Software Foundation, Inc.
|
2010-07-12 20:53:01 +02:00
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation; either version 3, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#ifndef TARGET_GLOBALS_H
|
|
|
|
#define TARGET_GLOBALS_H 1
|
|
|
|
|
|
|
|
#if SWITCHABLE_TARGET
|
|
|
|
extern struct target_flag_state *this_target_flag_state;
|
2010-07-12 20:53:08 +02:00
|
|
|
extern struct target_regs *this_target_regs;
|
2010-07-12 20:53:17 +02:00
|
|
|
extern struct target_rtl *this_target_rtl;
|
2014-05-27 12:06:22 +02:00
|
|
|
extern struct target_recog *this_target_recog;
|
hard-reg-set.h (target_hard_regs): New structure.
gcc/
* hard-reg-set.h (target_hard_regs): New structure.
(default_target_hard_regs): Declare.
(this_target_hard_regs): Declare as a variable or define as a macro.
(fixed_regs, fixed_reg_set, call_used_regs, call_really_used_regs)
(call_used_reg_set, call_fixed_reg_set, regs_invalidated_by_call)
(reg_alloc_order, inv_reg_alloc_order, reg_class_contents)
(reg_class_size, reg_class_subclasses, reg_class_subunion)
(reg_class_superunion, reg_names): Redefine as macros.
* reginfo.c (fixed_regs, fixed_reg_set, call_used_regs)
(call_used_reg_set, call_really_used_regs, call_fixed_reg_set)
(regs_invalidated_by_call, reg_alloc_order, inv_reg_alloc_order)
(reg_class_contents, reg_class_size, reg_class_subclasses)
(reg_class_subunion, reg_class_superunion, reg_names): Delete.
(default_target_hard_regs): New variable
(this_target_hard_regs, initial_call_really_used_regs)
(initial_reg_alloc_order): New conditional variables.
(initial_reg_names): New variable.
(init_reg_sets): Assert that initial_call_really_used_regs,
initial_reg_alloc_order and initial_reg_names
are all the same size as their variable counterparts. Use them to
initialize those counterparts.
* target-globals.h (this_target_hard_regs): Declare.
(target_globals): Add a hard_regs field.
(restore_target_globals): Copy the hard_regs field to
this_target_hard_regs.
* target-globals.c: Include hard-reg-set.h.
(default_target_globals): Initialize the hard_regs field.
(save_target_globals): Likewise.
From-SVN: r162089
2010-07-12 20:53:25 +02:00
|
|
|
extern struct target_hard_regs *this_target_hard_regs;
|
2010-07-12 20:53:59 +02:00
|
|
|
extern struct target_reload *this_target_reload;
|
Makefile.in (expmed.o, [...]): Depend on expmed.h.
gcc/
* Makefile.in (expmed.o, target-globals.o): Depend on expmed.h.
* expmed.h: New file.
* expmed.c (default_target_costs): New variable.
(this_target_costs): New conditional variable.
(sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost, neg_cost)
(shift_cost, shiftadd_cost, shiftsub0_cost, shiftsub1_cost, mul_cost)
(sdiv_cost, udiv_cost, mul_widen_cost, mul_highpart_cost): Delete.
* target-globals.h (this_target_expmed): Declare.
(target_globals): Add a expmed field.
(restore_target_globals): Copy the expmed field to
this_target_expmed.
* target-globals.c: Include expmed.h.
(default_target_globals): Initialize the expmed field.
(save_target_globals): Likewise.
From-SVN: r162094
2010-07-12 20:54:08 +02:00
|
|
|
extern struct target_expmed *this_target_expmed;
|
2010-07-12 20:54:35 +02:00
|
|
|
extern struct target_optabs *this_target_optabs;
|
2010-07-12 20:55:48 +02:00
|
|
|
extern struct target_libfuncs *this_target_libfuncs;
|
2010-07-12 21:02:55 +02:00
|
|
|
extern struct target_cfgloop *this_target_cfgloop;
|
Makefile.in (target-globals.o): Depend on $(IRA_INT_H).
gcc/
* Makefile.in (target-globals.o): Depend on $(IRA_INT_H).
* ira-int.h (ira_max_nregs, ira_important_class_nums): Delete.
(target_ira_int): New structure.
(default_target_ira_int): Declare.
(this_target_ira_int): Declare as a variable or define as a macro.
(ira_reg_mode_hard_regset, ira_register_move_cost)
(ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p)
(ira_non_ordered_class_hard_regs, ira_class_hard_reg_index)
(prohibited_class_mode_regs, ira_important_classes_num)
(ira_important_classes, ira_reg_class_intersect)
(ira_reg_classes_intersect_p, ira_reg_class_super_classes)
(ira_reg_class_union): Redefine as macros.
* ira.h (target_ira): New structure.
(default_target_ira): Declare.
(this_target_ira): Declare as a variable or define as a macro.
(ira_available_class_regs, ira_hard_regno_cover_class)
(ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate)
(ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs)
(ira_class_hard_regs_num): Redefine as macros.
* ira.c (default_target_ira, default_target_ira_int): New variables.
(this_target_ira, this_target_ira_int): New conditional variables.
(ira_reg_mode_hard_regset, ira_memory_move_cost)
(ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost)
(ira_class_subset_p): Delete.
(no_unit_alloc_regs): Redefine as a macro.
(ira_class_hard_regs, ira_non_ordered_class_hard_regs)
(ira_class_hard_regs_num, ira_class_hard_reg_index)
(ira_available_class_regs): Delete.
(alloc_reg_class_subclasses): Redefine as a macro.
(ira_reg_class_cover_size, ira_reg_class_cover)
(ira_important_classes_num, ira_important_classes)
(ira_important_class_nums, ira_class_translate): Delete.
(cover_class_order): Document the variable's lifetime.
(reorder_important_classes): Don't set ira_important_class_nums.
(ira_reg_class_intersect, ira_reg_classes_intersect_p)
(ira_reg_class_super_classes, ira_reg_class_union)
(ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs):
Delete.
(setup_reg_class_nregs): Don't set ira_max_regs.
(prohibited_class_mode_regs): Delete.
* target-globals.h (this_target_ira, this_target_ira_int): Declare.
(target_globals): Add ira and ira_int fields.
(restore_target_globals): Copy the ira field to this_target_ira
and the ira_int field to this_target_ira_int.
* target-globals.c: Include ira-int.h.
(default_target_globals): Initialize the ira and ira_int fields.
(save_target_globals): Likewise.
From-SVN: r162102
2010-07-12 21:03:06 +02:00
|
|
|
extern struct target_ira *this_target_ira;
|
|
|
|
extern struct target_ira_int *this_target_ira_int;
|
2010-07-12 21:03:35 +02:00
|
|
|
extern struct target_builtins *this_target_builtins;
|
2010-07-12 21:04:03 +02:00
|
|
|
extern struct target_gcse *this_target_gcse;
|
2010-07-12 21:04:11 +02:00
|
|
|
extern struct target_bb_reorder *this_target_bb_reorder;
|
2012-05-01 16:45:24 +02:00
|
|
|
extern struct target_lower_subreg *this_target_lower_subreg;
|
2014-01-09 19:25:19 +01:00
|
|
|
#endif
|
2010-07-12 20:53:01 +02:00
|
|
|
|
|
|
|
struct GTY(()) target_globals {
|
2014-09-09 14:12:06 +02:00
|
|
|
~target_globals ();
|
|
|
|
|
2010-07-12 20:53:01 +02:00
|
|
|
struct target_flag_state *GTY((skip)) flag_state;
|
2014-09-09 14:12:06 +02:00
|
|
|
struct target_regs *GTY((skip)) regs;
|
2010-07-12 20:53:17 +02:00
|
|
|
struct target_rtl *rtl;
|
2014-09-09 14:12:06 +02:00
|
|
|
struct target_recog *GTY((skip)) recog;
|
|
|
|
struct target_hard_regs *GTY((skip)) hard_regs;
|
|
|
|
struct target_reload *GTY((skip)) reload;
|
|
|
|
struct target_expmed *GTY((skip)) expmed;
|
2010-07-12 20:54:35 +02:00
|
|
|
struct target_optabs *GTY((skip)) optabs;
|
2010-07-12 20:55:48 +02:00
|
|
|
struct target_libfuncs *libfuncs;
|
2010-07-12 21:02:55 +02:00
|
|
|
struct target_cfgloop *GTY((skip)) cfgloop;
|
2014-09-09 14:12:06 +02:00
|
|
|
struct target_ira *GTY((skip)) ira;
|
|
|
|
struct target_ira_int *GTY((skip)) ira_int;
|
2010-07-12 21:03:35 +02:00
|
|
|
struct target_builtins *GTY((skip)) builtins;
|
2010-07-12 21:04:03 +02:00
|
|
|
struct target_gcse *GTY((skip)) gcse;
|
2010-07-12 21:04:11 +02:00
|
|
|
struct target_bb_reorder *GTY((skip)) bb_reorder;
|
2012-05-01 16:45:24 +02:00
|
|
|
struct target_lower_subreg *GTY((skip)) lower_subreg;
|
2010-07-12 20:53:01 +02:00
|
|
|
};
|
|
|
|
|
2014-01-09 19:25:19 +01:00
|
|
|
#if SWITCHABLE_TARGET
|
2010-07-12 20:53:01 +02:00
|
|
|
extern struct target_globals default_target_globals;
|
|
|
|
|
|
|
|
extern struct target_globals *save_target_globals (void);
|
2013-02-19 01:04:49 +01:00
|
|
|
extern struct target_globals *save_target_globals_default_opts (void);
|
2010-07-12 20:53:01 +02:00
|
|
|
|
|
|
|
static inline void
|
|
|
|
restore_target_globals (struct target_globals *g)
|
|
|
|
{
|
|
|
|
this_target_flag_state = g->flag_state;
|
2014-09-09 14:12:06 +02:00
|
|
|
this_target_regs = g->regs;
|
2010-07-12 20:53:17 +02:00
|
|
|
this_target_rtl = g->rtl;
|
2014-09-09 14:12:06 +02:00
|
|
|
this_target_recog = g->recog;
|
|
|
|
this_target_hard_regs = g->hard_regs;
|
|
|
|
this_target_reload = g->reload;
|
|
|
|
this_target_expmed = g->expmed;
|
2010-07-12 20:54:35 +02:00
|
|
|
this_target_optabs = g->optabs;
|
2010-07-12 20:55:48 +02:00
|
|
|
this_target_libfuncs = g->libfuncs;
|
2010-07-12 21:02:55 +02:00
|
|
|
this_target_cfgloop = g->cfgloop;
|
2014-09-09 14:12:06 +02:00
|
|
|
this_target_ira = g->ira;
|
|
|
|
this_target_ira_int = g->ira_int;
|
2010-07-12 21:03:35 +02:00
|
|
|
this_target_builtins = g->builtins;
|
2010-07-12 21:04:03 +02:00
|
|
|
this_target_gcse = g->gcse;
|
2010-07-12 21:04:11 +02:00
|
|
|
this_target_bb_reorder = g->bb_reorder;
|
2012-05-01 16:45:24 +02:00
|
|
|
this_target_lower_subreg = g->lower_subreg;
|
2010-07-12 20:53:01 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|