aboutsummaryrefslogtreecommitdiff
path: root/gcc/genopinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/genopinit.c')
-rw-r--r--gcc/genopinit.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index b8a2827..2d14d12 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -398,6 +398,68 @@ main (int argc, char **argv)
fprintf (h_file, "#define NUM_OPTAB_PATTERNS %u\n",
(unsigned) patterns.length ());
+ fprintf (h_file,
+ "typedef enum optab_tag optab;\n"
+ "typedef enum optab_tag convert_optab;\n"
+ "typedef enum optab_tag direct_optab;\n"
+ "\n"
+ "struct optab_libcall_d\n"
+ "{\n"
+ " char libcall_suffix;\n"
+ " const char *libcall_basename;\n"
+ " void (*libcall_gen) (optab, const char *name,\n"
+ " char suffix, machine_mode);\n"
+ "};\n"
+ "\n"
+ "struct convert_optab_libcall_d\n"
+ "{\n"
+ " const char *libcall_basename;\n"
+ " void (*libcall_gen) (convert_optab, const char *name,\n"
+ " machine_mode, machine_mode);\n"
+ "};\n"
+ "\n"
+ "/* Given an enum insn_code, access the function to construct\n"
+ " the body of that kind of insn. */\n"
+ "#define GEN_FCN(CODE) (insn_data[CODE].genfun)\n"
+ "\n"
+ "/* Contains the optab used for each rtx code, and vice-versa. */\n"
+ "extern const optab code_to_optab_[NUM_RTX_CODE];\n"
+ "extern const enum rtx_code optab_to_code_[NUM_OPTABS];\n"
+ "\n"
+ "static inline optab\n"
+ "code_to_optab (enum rtx_code code)\n"
+ "{\n"
+ " return code_to_optab_[code];\n"
+ "}\n"
+ "\n"
+ "static inline enum rtx_code\n"
+ "optab_to_code (optab op)\n"
+ "{\n"
+ " return optab_to_code_[op];\n"
+ "}\n"
+ "\n"
+ "extern const struct convert_optab_libcall_d convlib_def[NUM_CONVLIB_OPTABS];\n"
+ "extern const struct optab_libcall_d normlib_def[NUM_NORMLIB_OPTABS];\n"
+ "\n"
+ "/* Returns the active icode for the given (encoded) optab. */\n"
+ "extern enum insn_code raw_optab_handler (unsigned);\n"
+ "extern bool swap_optab_enable (optab, machine_mode, bool);\n"
+ "\n"
+ "/* Target-dependent globals. */\n"
+ "struct target_optabs {\n"
+ " /* Patterns that are used by optabs that are enabled for this target. */\n"
+ " bool pat_enable[NUM_OPTAB_PATTERNS];\n"
+ "};\n"
+ "extern void init_all_optabs (struct target_optabs *);\n"
+ "\n"
+ "extern struct target_optabs default_target_optabs;\n"
+ "extern struct target_optabs *this_fn_optabs;\n"
+ "#if SWITCHABLE_TARGET\n"
+ "extern struct target_optabs *this_target_optabs;\n"
+ "#else\n"
+ "#define this_target_optabs (&default_target_optabs)\n"
+ "#endif\n");
+
fprintf (s_file,
"#include \"config.h\"\n"
"#include \"system.h\"\n"
@@ -413,6 +475,7 @@ main (int argc, char **argv)
"#include \"flags.h\"\n"
"#include \"insn-config.h\"\n"
"#include \"expr.h\"\n"
+ "#include \"insn-codes.h\"\n"
"#include \"optabs.h\"\n"
"\n"
"struct optab_pat {\n"