Commit 4bcbfa03 by Richard Sandiford Committed by Richard Sandiford

Makefile.in (target-globals.o): Depend on $(EXPR_H) and $(OPTABS_H).

gcc/
	* Makefile.in (target-globals.o): Depend on $(EXPR_H) and $(OPTABS_H).
	* optabs.h (target_optabs): New structure.
	(default_target_optabs): Declare.
	(this_target_optabs): Declare as a variable or define as a macro.
	(optab_table, convert_optab_table, direct_optab_table): Redefine
	as macros.
	* optabs.c (default_target_optabs): New variable.
	(this_target_optabs): New conditional variable.
	(optab_table, convert_optab_table, direct_optab_table): Delete.
	* target-globals.h (this_target_optabs): Declare.
	(target_globals): Add a optabs field.
	(restore_target_globals): Copy the optabs field to
	this_target_optabs.
	* target-globals.c: Include expr.h and optabs.h.
	(default_target_globals): Initialize the optabs field.
	(save_target_globals): Likewise.

From-SVN: r162097
parent b6609375
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com> 2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
* Makefile.in (target-globals.o): Depend on $(EXPR_H) and $(OPTABS_H).
* optabs.h (target_optabs): New structure.
(default_target_optabs): Declare.
(this_target_optabs): Declare as a variable or define as a macro.
(optab_table, convert_optab_table, direct_optab_table): Redefine
as macros.
* optabs.c (default_target_optabs): New variable.
(this_target_optabs): New conditional variable.
(optab_table, convert_optab_table, direct_optab_table): Delete.
* target-globals.h (this_target_optabs): Declare.
(target_globals): Add a optabs field.
(restore_target_globals): Copy the optabs field to
this_target_optabs.
* target-globals.c: Include expr.h and optabs.h.
(default_target_globals): Initialize the optabs field.
(save_target_globals): Likewise.
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
* flags.h (target_flagstate): Add x_flag_excess_precision. * flags.h (target_flagstate): Add x_flag_excess_precision.
(flag_excess_precision): Redefine as a macro. (flag_excess_precision): Redefine as a macro.
* toplev.c (flag_excess_precision): Delete. * toplev.c (flag_excess_precision): Delete.
......
...@@ -3478,7 +3478,7 @@ lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ...@@ -3478,7 +3478,7 @@ lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(EXPR_H) $(EXCEPT_H) $(REGS_H) $(TREE_PASS_H) $(DF_H) $(EXPR_H) $(EXCEPT_H) $(REGS_H) $(TREE_PASS_H) $(DF_H)
target-globals.o : target-globals.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ target-globals.o : target-globals.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) insn-config.h $(MACHMODE_H) $(GGC_H) $(TOPLEV_H) target-globals.h \ $(TM_H) insn-config.h $(MACHMODE_H) $(GGC_H) $(TOPLEV_H) target-globals.h \
$(FLAGS_H) $(REGS_H) $(RTL_H) reload.h expmed.h $(FLAGS_H) $(REGS_H) $(RTL_H) reload.h expmed.h $(EXPR_H) $(OPTABS_H)
$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \ $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \ $(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \
......
...@@ -45,26 +45,13 @@ along with GCC; see the file COPYING3. If not see ...@@ -45,26 +45,13 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h" #include "basic-block.h"
#include "target.h" #include "target.h"
/* Each optab contains info on how this target machine struct target_optabs default_target_optabs;
can perform a particular operation #if SWITCHABLE_TARGET
for all sizes and kinds of operands. struct target_optabs *this_target_optabs = &default_target_optabs;
#endif
The operation to be performed is often specified
by passing one of these optabs as an argument.
See expr.h for documentation of these optabs. */
struct optab_d optab_table[OTI_MAX];
rtx libfunc_table[LTI_MAX]; rtx libfunc_table[LTI_MAX];
/* Tables of patterns for converting one mode to another. */
struct convert_optab_d convert_optab_table[COI_MAX];
/* Tables of patterns for direct optabs (i.e. those which cannot be
implemented using a libcall). */
struct direct_optab_d direct_optab_table[(int) DOI_MAX];
/* Contains the optab used for each rtx code. */ /* Contains the optab used for each rtx code. */
optab code_to_optab[NUM_RTX_CODE + 1]; optab code_to_optab[NUM_RTX_CODE + 1];
......
...@@ -371,8 +371,6 @@ enum optab_index ...@@ -371,8 +371,6 @@ enum optab_index
OTI_MAX OTI_MAX
}; };
extern struct optab_d optab_table[OTI_MAX];
#define ssadd_optab (&optab_table[OTI_ssadd]) #define ssadd_optab (&optab_table[OTI_ssadd])
#define usadd_optab (&optab_table[OTI_usadd]) #define usadd_optab (&optab_table[OTI_usadd])
#define sssub_optab (&optab_table[OTI_sssub]) #define sssub_optab (&optab_table[OTI_sssub])
...@@ -574,8 +572,6 @@ enum convert_optab_index ...@@ -574,8 +572,6 @@ enum convert_optab_index
COI_MAX COI_MAX
}; };
extern struct convert_optab_d convert_optab_table[COI_MAX];
#define sext_optab (&convert_optab_table[COI_sext]) #define sext_optab (&convert_optab_table[COI_sext])
#define zext_optab (&convert_optab_table[COI_zext]) #define zext_optab (&convert_optab_table[COI_zext])
#define trunc_optab (&convert_optab_table[COI_trunc]) #define trunc_optab (&convert_optab_table[COI_trunc])
...@@ -676,8 +672,6 @@ struct direct_optab_d ...@@ -676,8 +672,6 @@ struct direct_optab_d
}; };
typedef struct direct_optab_d *direct_optab; typedef struct direct_optab_d *direct_optab;
extern struct direct_optab_d direct_optab_table[(int) DOI_MAX];
#ifdef HAVE_conditional_move #ifdef HAVE_conditional_move
#define movcc_optab (&direct_optab_table[(int) DOI_movcc]) #define movcc_optab (&direct_optab_table[(int) DOI_movcc])
#endif #endif
...@@ -715,6 +709,33 @@ extern struct direct_optab_d direct_optab_table[(int) DOI_MAX]; ...@@ -715,6 +709,33 @@ extern struct direct_optab_d direct_optab_table[(int) DOI_MAX];
#define sync_lock_release_optab \ #define sync_lock_release_optab \
(&direct_optab_table[(int) DOI_sync_lock_release]) (&direct_optab_table[(int) DOI_sync_lock_release])
/* Target-dependent globals. */
struct target_optabs {
/* Tables of patterns that may have an associated libcall. */
struct optab_d x_optab_table[(int) OTI_MAX];
/* Tables of patterns for converting one mode to another. */
struct convert_optab_d x_convert_optab_table[(int) COI_MAX];
/* Tables of patterns for direct optabs (i.e. those which cannot be
implemented using a libcall). */
struct direct_optab_d x_direct_optab_table[(int) DOI_MAX];
};
extern struct target_optabs default_target_optabs;
#if SWITCHABLE_TARGET
extern struct target_optabs *this_target_optabs;
#else
#define this_target_optabs (&default_target_optabs)
#endif
#define optab_table \
(this_target_optabs->x_optab_table)
#define convert_optab_table \
(this_target_optabs->x_convert_optab_table)
#define direct_optab_table \
(this_target_optabs->x_direct_optab_table)
/* Define functions given in optabs.c. */ /* Define functions given in optabs.c. */
extern rtx expand_widen_pattern_expr (sepops ops, rtx op0, rtx op1, rtx wide_op, extern rtx expand_widen_pattern_expr (sepops ops, rtx op0, rtx op1, rtx wide_op,
......
...@@ -32,6 +32,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -32,6 +32,8 @@ along with GCC; see the file COPYING3. If not see
#include "hard-reg-set.h" #include "hard-reg-set.h"
#include "reload.h" #include "reload.h"
#include "expmed.h" #include "expmed.h"
#include "expr.h"
#include "optabs.h"
#if SWITCHABLE_TARGET #if SWITCHABLE_TARGET
struct target_globals default_target_globals = { struct target_globals default_target_globals = {
...@@ -40,7 +42,8 @@ struct target_globals default_target_globals = { ...@@ -40,7 +42,8 @@ struct target_globals default_target_globals = {
&default_target_rtl, &default_target_rtl,
&default_target_hard_regs, &default_target_hard_regs,
&default_target_reload, &default_target_reload,
&default_target_expmed &default_target_expmed,
&default_target_optabs
}; };
struct target_globals * struct target_globals *
...@@ -55,6 +58,7 @@ save_target_globals (void) ...@@ -55,6 +58,7 @@ save_target_globals (void)
g->hard_regs = XCNEW (struct target_hard_regs); g->hard_regs = XCNEW (struct target_hard_regs);
g->reload = XCNEW (struct target_reload); g->reload = XCNEW (struct target_reload);
g->expmed = XCNEW (struct target_expmed); g->expmed = XCNEW (struct target_expmed);
g->optabs = XCNEW (struct target_optabs);
restore_target_globals (g); restore_target_globals (g);
target_reinit (); target_reinit ();
return g; return g;
......
...@@ -27,6 +27,7 @@ extern struct target_rtl *this_target_rtl; ...@@ -27,6 +27,7 @@ extern struct target_rtl *this_target_rtl;
extern struct target_hard_regs *this_target_hard_regs; extern struct target_hard_regs *this_target_hard_regs;
extern struct target_reload *this_target_reload; extern struct target_reload *this_target_reload;
extern struct target_expmed *this_target_expmed; extern struct target_expmed *this_target_expmed;
extern struct target_optabs *this_target_optabs;
struct GTY(()) target_globals { struct GTY(()) target_globals {
struct target_flag_state *GTY((skip)) flag_state; struct target_flag_state *GTY((skip)) flag_state;
...@@ -35,6 +36,7 @@ struct GTY(()) target_globals { ...@@ -35,6 +36,7 @@ struct GTY(()) target_globals {
struct target_hard_regs *GTY((skip)) hard_regs; struct target_hard_regs *GTY((skip)) hard_regs;
struct target_reload *GTY((skip)) reload; struct target_reload *GTY((skip)) reload;
struct target_expmed *GTY((skip)) expmed; struct target_expmed *GTY((skip)) expmed;
struct target_optabs *GTY((skip)) optabs;
}; };
extern struct target_globals default_target_globals; extern struct target_globals default_target_globals;
...@@ -50,6 +52,7 @@ restore_target_globals (struct target_globals *g) ...@@ -50,6 +52,7 @@ restore_target_globals (struct target_globals *g)
this_target_hard_regs = g->hard_regs; this_target_hard_regs = g->hard_regs;
this_target_reload = g->reload; this_target_reload = g->reload;
this_target_expmed = g->expmed; this_target_expmed = g->expmed;
this_target_optabs = g->optabs;
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment