2010-07-12 20:53:01 +02:00
|
|
|
/* Target-dependent globals.
|
|
|
|
Copyright (C) 2010 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
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/>. */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "coretypes.h"
|
|
|
|
#include "tm.h"
|
|
|
|
#include "insn-config.h"
|
|
|
|
#include "machmode.h"
|
|
|
|
#include "ggc.h"
|
|
|
|
#include "toplev.h"
|
|
|
|
#include "target-globals.h"
|
|
|
|
#include "flags.h"
|
2010-07-12 20:53:08 +02:00
|
|
|
#include "regs.h"
|
2010-07-12 20:53:17 +02:00
|
|
|
#include "rtl.h"
|
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
|
|
|
#include "hard-reg-set.h"
|
2010-07-12 20:53:59 +02:00
|
|
|
#include "reload.h"
|
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
|
|
|
#include "expmed.h"
|
2010-07-12 20:54:35 +02:00
|
|
|
#include "expr.h"
|
|
|
|
#include "optabs.h"
|
2010-07-12 20:55:48 +02:00
|
|
|
#include "libfuncs.h"
|
2010-07-12 20:53:01 +02:00
|
|
|
|
|
|
|
#if SWITCHABLE_TARGET
|
|
|
|
struct target_globals default_target_globals = {
|
2010-07-12 20:53:08 +02:00
|
|
|
&default_target_flag_state,
|
2010-07-12 20:53:17 +02:00
|
|
|
&default_target_regs,
|
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
|
|
|
&default_target_rtl,
|
2010-07-12 20:53:59 +02:00
|
|
|
&default_target_hard_regs,
|
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
|
|
|
&default_target_reload,
|
2010-07-12 20:54:35 +02:00
|
|
|
&default_target_expmed,
|
2010-07-12 20:55:48 +02:00
|
|
|
&default_target_optabs,
|
|
|
|
&default_target_libfuncs
|
2010-07-12 20:53:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct target_globals *
|
|
|
|
save_target_globals (void)
|
|
|
|
{
|
|
|
|
struct target_globals *g;
|
|
|
|
|
|
|
|
g = ggc_alloc_target_globals ();
|
|
|
|
g->flag_state = XCNEW (struct target_flag_state);
|
2010-07-12 20:53:08 +02:00
|
|
|
g->regs = XCNEW (struct target_regs);
|
2010-07-12 20:53:17 +02:00
|
|
|
g->rtl = ggc_alloc_cleared_target_rtl ();
|
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
|
|
|
g->hard_regs = XCNEW (struct target_hard_regs);
|
2010-07-12 20:53:59 +02:00
|
|
|
g->reload = XCNEW (struct 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
|
|
|
g->expmed = XCNEW (struct target_expmed);
|
2010-07-12 20:54:35 +02:00
|
|
|
g->optabs = XCNEW (struct target_optabs);
|
2010-07-12 20:55:48 +02:00
|
|
|
g->libfuncs = ggc_alloc_cleared_target_libfuncs ();
|
2010-07-12 20:53:01 +02:00
|
|
|
restore_target_globals (g);
|
|
|
|
target_reinit ();
|
|
|
|
return g;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|