summaryrefslogtreecommitdiff
path: root/gcc/optabs.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 18:54:35 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 18:54:35 +0000
commit2770cb33340b033d1054004319818af09ad93d2c (patch)
treec920ed4d7946023638d154dfa81c2b963b87076a /gcc/optabs.h
parent0f60a83499ddae594222a3a8763a09a24cfe5959 (diff)
downloadgcc-2770cb33340b033d1054004319818af09ad93d2c.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162097 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.h')
-rw-r--r--gcc/optabs.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 1c518e56fd5..547339bcee6 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -371,8 +371,6 @@ enum optab_index
OTI_MAX
};
-extern struct optab_d optab_table[OTI_MAX];
-
#define ssadd_optab (&optab_table[OTI_ssadd])
#define usadd_optab (&optab_table[OTI_usadd])
#define sssub_optab (&optab_table[OTI_sssub])
@@ -574,8 +572,6 @@ enum convert_optab_index
COI_MAX
};
-extern struct convert_optab_d convert_optab_table[COI_MAX];
-
#define sext_optab (&convert_optab_table[COI_sext])
#define zext_optab (&convert_optab_table[COI_zext])
#define trunc_optab (&convert_optab_table[COI_trunc])
@@ -676,8 +672,6 @@ struct direct_optab_d
};
typedef struct direct_optab_d *direct_optab;
-extern struct direct_optab_d direct_optab_table[(int) DOI_MAX];
-
#ifdef HAVE_conditional_move
#define movcc_optab (&direct_optab_table[(int) DOI_movcc])
#endif
@@ -715,6 +709,33 @@ extern struct direct_optab_d direct_optab_table[(int) DOI_MAX];
#define sync_lock_release_optab \
(&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. */
extern rtx expand_widen_pattern_expr (sepops ops, rtx op0, rtx op1, rtx wide_op,