aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2001-08-13 15:56:51 +0000
committerZack Weinberg <zack@gcc.gnu.org>2001-08-13 15:56:51 +0000
commite78d8e5137ccd2a55617befdc052d1860e7f09f1 (patch)
tree0bf63396b6452b6ba1bd93f734ade1e7f708db6a
parent050e4ca284c3028c7df662ba953be93f5b8fb47b (diff)
downloadgcc-e78d8e5137ccd2a55617befdc052d1860e7f09f1.zip
gcc-e78d8e5137ccd2a55617befdc052d1860e7f09f1.tar.gz
gcc-e78d8e5137ccd2a55617befdc052d1860e7f09f1.tar.bz2
expr.h: Split out optab- and libfunc-related code to...
* expr.h: Split out optab- and libfunc-related code to... * optabs.h, libfuncs.h: ... these new headers. * Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h. (OPTABS_H): New. (various .o rules): Add $(OPTABS_H) and/or libfuncs.h to dependencies. * mkconfig.sh: Don't include insn-codes.h from config.h. * reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether enum insn_code is available. Move reload_in_optab and reload_out_optab array declarations to optabs.h. * regmove.c (gen_add3_insn): Move to optabs.c, export from there, prototype in expr.h. * gencodes.c: Cleanup: zap global variables, don't use printf where puts will do, don't bother defining MAX_INSN_CODE which nothing uses, let CODE_FOR_nothing get its value implicitly. * genemit.c, genopinit.c: Include optabs.h in generated file. * genoutput.c: Include insn-codes.h in generated file. * builtins.c, caller-save.c, combine.c, doloop.c, explow.c, expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c, reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c, config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c, config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c, config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c: Include optabs.h. * builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c, optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c, config/m88k/m88k.c, config/sparc/sparc.c: Include libfuncs.h. * reload.c: Include expr.h and optabs.h before reload.h. * config/alpha/alpha.c: Include tree.h before reload.h. * config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h, and reload.h in that order. * config/sparc/sparc.c: Include debug.h. * recog.c: Include insn-codes.h. cp: * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies. * except.c: Include libfuncs.h. java: * Make-lang.in (java/decl.o): Update dependencies. * decl.c: Include libfuncs.h, don't include toplev.h. From-SVN: r44858
-rw-r--r--gcc/ChangeLog40
-rw-r--r--gcc/Makefile.in68
-rw-r--r--gcc/builtins.c2
-rw-r--r--gcc/caller-save.c1
-rw-r--r--gcc/calls.c1
-rw-r--r--gcc/combine.c1
-rw-r--r--gcc/config/alpha/alpha.c5
-rw-r--r--gcc/config/arm/arm.c1
-rw-r--r--gcc/config/c4x/c4x.c2
-rw-r--r--gcc/config/clipper/clipper.c2
-rw-r--r--gcc/config/i386/i386.c1
-rw-r--r--gcc/config/ia64/ia64.c1
-rw-r--r--gcc/config/m88k/m88k.c1
-rw-r--r--gcc/config/mn10300/mn10300.c1
-rw-r--r--gcc/config/pa/pa.c4
-rw-r--r--gcc/config/pj/pj.c1
-rw-r--r--gcc/config/sh/sh.c1
-rw-r--r--gcc/config/sparc/sparc.c3
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/except.c1
-rw-r--r--gcc/doloop.c1
-rw-r--r--gcc/dwarf2out.c1
-rw-r--r--gcc/except.c1
-rw-r--r--gcc/explow.c1
-rw-r--r--gcc/expmed.c1
-rw-r--r--gcc/expr.c2
-rw-r--r--gcc/expr.h615
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/gencodes.c41
-rw-r--r--gcc/genemit.c1
-rw-r--r--gcc/genopinit.c1
-rw-r--r--gcc/genoutput.c1
-rw-r--r--gcc/ifcvt.c1
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/Make-lang.in7
-rw-r--r--gcc/java/decl.c2
-rw-r--r--gcc/libfuncs.h284
-rw-r--r--gcc/loop.c1
-rw-r--r--gcc/mkconfig.sh6
-rw-r--r--gcc/optabs.c24
-rw-r--r--gcc/optabs.h355
-rw-r--r--gcc/profile.c1
-rw-r--r--gcc/recog.c1
-rw-r--r--gcc/regmove.c22
-rw-r--r--gcc/reload.c3
-rw-r--r--gcc/reload.h10
-rw-r--r--gcc/reload1.c1
-rw-r--r--gcc/simplify-rtx.c1
-rw-r--r--gcc/stmt.c2
-rw-r--r--gcc/unroll.c1
51 files changed, 844 insertions, 695 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 61ef47e..e5bc416 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,43 @@
+2001-08-13 Zack Weinberg <zackw@panix.com>
+
+ * expr.h: Split out optab- and libfunc-related code to...
+ * optabs.h, libfuncs.h: ... these new headers.
+
+ * Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h.
+ (OPTABS_H): New.
+ (various .o rules): Add $(OPTABS_H) and/or libfuncs.h to
+ dependencies.
+ * mkconfig.sh: Don't include insn-codes.h from config.h.
+
+ * reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether
+ enum insn_code is available. Move reload_in_optab and
+ reload_out_optab array declarations to optabs.h.
+ * regmove.c (gen_add3_insn): Move to optabs.c, export from
+ there, prototype in expr.h.
+ * gencodes.c: Cleanup: zap global variables, don't use
+ printf where puts will do, don't bother defining MAX_INSN_CODE
+ which nothing uses, let CODE_FOR_nothing get its value implicitly.
+
+ * genemit.c, genopinit.c: Include optabs.h in generated file.
+ * genoutput.c: Include insn-codes.h in generated file.
+ * builtins.c, caller-save.c, combine.c, doloop.c, explow.c,
+ expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c,
+ reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c,
+ config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c,
+ config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c,
+ config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c:
+ Include optabs.h.
+ * builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c,
+ optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c,
+ config/m88k/m88k.c, config/sparc/sparc.c:
+ Include libfuncs.h.
+ * reload.c: Include expr.h and optabs.h before reload.h.
+ * config/alpha/alpha.c: Include tree.h before reload.h.
+ * config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h,
+ and reload.h in that order.
+ * config/sparc/sparc.c: Include debug.h.
+ * recog.c: Include insn-codes.h.
+
2001-08-13 Andreas Jaeger <aj@suse.de>
* config.gcc: Use t-slibgcc-elf to build shared libgcc_s on
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 8ff0dd3..ba8ca46 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -547,7 +547,7 @@ all: all.indirect
# several files generated by those generators.
GCONFIG_H = config.h $(host_xm_file_list)
HCONFIG_H = hconfig.h $(build_xm_file_list)
-CONFIG_H = $(GCONFIG_H) insn-constants.h insn-codes.h insn-flags.h
+CONFIG_H = $(GCONFIG_H) insn-constants.h insn-flags.h
TCONFIG_H = tconfig.h $(xm_file_list)
TARGET_H = target.h
TARGET_DEF_H = target-def.h
@@ -561,7 +561,8 @@ TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.de
BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h
DEMANGLE_H = $(srcdir)/../include/demangle.h
RECOG_H = recog.h
-EXPR_H = expr.h insn-codes.h
+EXPR_H = expr.h
+OPTABS_H = optabs.h insn-codes.h
REGS_H = regs.h varray.h $(MACHMODE_H)
INTEGRATE_H = integrate.h varray.h
LOOP_H = loop.h varray.h bitmap.h
@@ -1376,33 +1377,33 @@ varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
output.h c-pragma.h toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
$(HASHTAB_H) $(TARGET_H)
function.o : function.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- function.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
+ function.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h \
insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H) $(TM_P_H)
stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
- insn-config.h hard-reg-set.h $(EXPR_H) except.h \
+ insn-config.h hard-reg-set.h $(EXPR_H) $(OPTABS_H) libfuncs.h except.h \
$(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H)
except.o : except.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- except.h function.h $(EXPR_H) integrate.h \
+ except.h function.h $(EXPR_H) libfuncs.h integrate.h \
insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H)
expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
- $(REGS_H) $(EXPR_H) insn-config.h $(RECOG_H) \
+ $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h insn-config.h $(RECOG_H) \
output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \
reload.h $(GGC_H) intl.h $(TM_P_H)
builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- $(TARGET_H) function.h $(REGS_H) $(EXPR_H) insn-config.h \
+ $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
- except.h $(TM_P_H) $(PREDICT_H)
+ except.h $(TM_P_H) $(PREDICT_H) libfuncs.h
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
- $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H)
+ libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H)
expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- insn-config.h $(EXPR_H) $(RECOG_H) real.h \
+ insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
toplev.h $(TM_P_H)
explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- hard-reg-set.h insn-config.h $(EXPR_H) $(RECOG_H) \
+ hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
toplev.h function.h $(TM_P_H)
optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- insn-config.h $(EXPR_H) $(RECOG_H) reload.h \
+ insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \
toplev.h $(GGC_H) real.h $(TM_P_H) except.h
dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
$(REGS_H) debug.h $(TM_P_H) $(TARGET_H) \
@@ -1417,7 +1418,7 @@ dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf.h \
debug.h
dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf2.h \
debug.h flags.h insn-config.h reload.h output.h diagnostic.h \
- hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h varray.h \
+ hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \
$(GGC_H) except.h dwarf2asm.h $(TM_P_H)
dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
output.h dwarf2asm.h $(TM_P_H)
@@ -1438,7 +1439,7 @@ jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h $(REGS_H
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
- output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H)
+ $(OPTABS_H) output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H)
cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
output.h function.h cselib.h $(GGC_H) $(OBSTACK_H) $(TM_P_H)
@@ -1469,23 +1470,24 @@ df.o : df.c $(CONFIG_H) system.h $(RTL_H) insn-config.h $(RECOG_H) \
conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H) $(HASHTAB_H) \
$(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
+ insn-config.h output.h $(REGS_H) $(EXPR_H) $(OPTABS_H) function.h \
gcov-io.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TARGET_H)
-loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) insn-config.h \
- $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h $(PREDICT_H) \
- $(BASIC_BLOCK_H) function.h toplev.h varray.h except.h cselib.h $(TM_P_H)
+loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \
+ insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
+ $(OPTABS_H) real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h \
+ toplev.h varray.h except.h cselib.h $(TM_P_H)
doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \
- $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h
+ $(EXPR_H) $(OPTABS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h
unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h function.h \
$(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \
- hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H)
+ hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H) $(OPTABS_H)
flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h insn-config.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H)
dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h \
$(BASIC_BLOCK_H)
combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h function.h \
- insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
+ insn-config.h $(INSN_ATTR_H) $(OPTABS_H) $(REGS_H) $(EXPR_H) \
$(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h flags.h \
$(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \
@@ -1501,16 +1503,16 @@ global.o : global.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h reload.h function.h
$(TM_P_H)
varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) varray.h $(RTL_H) $(TREE_H) bitmap.h \
errors.h
-reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h output.h $(EXPR_H) \
- reload.h $(RECOG_H) hard-reg-set.h insn-config.h $(REGS_H) \
- function.h real.h toplev.h $(TM_P_H)
-reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) real.h flags.h $(EXPR_H) \
- reload.h $(REGS_H) hard-reg-set.h insn-config.h \
+reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h output.h \
+ $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \
+ $(REGS_H) function.h real.h toplev.h $(TM_P_H)
+reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) real.h flags.h \
+ $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \
except.h
caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
$(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
- $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
+ $(RECOG_H) reload.h $(EXPR_H) $(OPTABS_H) toplev.h $(TM_P_H)
reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) conditions.h hard-reg-set.h \
$(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) \
$(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H)
@@ -1540,7 +1542,7 @@ final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \
toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H)
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) function.h $(BASIC_BLOCK_H) \
$(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
- $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
+ $(INSN_ATTR_H) insn-codes.h real.h toplev.h output.h reload.h $(TM_P_H)
reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) $(RECOG_H) \
$(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
varray.h function.h $(TM_P_H)
@@ -1557,15 +1559,15 @@ regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
resource.h $(OBSTACK_H) flags.h $(TM_P_H)
ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) toplev.h \
flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
- output.h $(TM_P_H)
+ $(OPTABS_H) output.h $(TM_P_H)
dependence.o : dependence.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
$(C_COMMON_H) flags.h varray.h $(EXPR_H)
params.o : params.c $(CONFIG_H) $(SYSTEM_H) $(PARAMS_H) toplev.h
$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
- output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) \
- $(TARGET_DEF_H) function.h sched-int.h $(TM_P_H)
+ output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \
+ $(TARGET_DEF_H) function.h sched-int.h $(TM_P_H) $(EXPR_H) $(OPTABS_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(out_file) $(OUTPUT_OPTION)
@@ -1635,7 +1637,7 @@ s-constants : $(md_file) genconstants$(build_exeext) $(srcdir)/move-if-change
$(STAMP) s-constants
insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
- insn-config.h $(SYSTEM_H) reload.h $(RECOG_H) toplev.h \
+ insn-config.h $(OPTABS_H) $(SYSTEM_H) reload.h $(RECOG_H) toplev.h \
function.h flags.h hard-reg-set.h resource.h $(TM_P_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
@@ -1657,7 +1659,7 @@ s-recog : $(md_file) genrecog$(build_exeext) $(srcdir)/move-if-change
$(STAMP) s-recog
insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) \
- insn-config.h flags.h $(RECOG_H) $(EXPR_H) reload.h $(SYSTEM_H)
+ insn-config.h flags.h $(RECOG_H) $(EXPR_H) $(OPTABS_H) reload.h $(SYSTEM_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
insn-opinit.c: s-opinit ; @true
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 08d2bb7..c427f57 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -32,6 +32,8 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "insn-config.h"
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
#include "recog.h"
#include "output.h"
#include "typeclass.h"
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 0d36f30..48153d0 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "reload.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
#include "toplev.h"
#include "tm_p.h"
diff --git a/gcc/calls.c b/gcc/calls.c
index 60178d7..8a20333 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "flags.h"
#include "expr.h"
+#include "libfuncs.h"
#include "function.h"
#include "regs.h"
#include "toplev.h"
diff --git a/gcc/combine.c b/gcc/combine.c
index a1ae2d0..b6ea18b 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -86,6 +86,7 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
/* Include expr.h after insn-config.h so we get HAVE_conditional_move. */
#include "expr.h"
+#include "optabs.h"
#include "insn-attr.h"
#include "recog.h"
#include "real.h"
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index ef65d72..aa2f979 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "rtl.h"
+#include "tree.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "real.h"
@@ -33,9 +34,9 @@ Boston, MA 02111-1307, USA. */
#include "insn-attr.h"
#include "flags.h"
#include "recog.h"
-#include "reload.h"
-#include "tree.h"
#include "expr.h"
+#include "optabs.h"
+#include "reload.h"
#include "obstack.h"
#include "except.h"
#include "function.h"
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index b79a92b..265a79b 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */
#include "reload.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
#include "toplev.h"
#include "recog.h"
#include "ggc.h"
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index add05c7..f6c987b 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -37,6 +37,8 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
#include "flags.h"
#include "loop.h"
#include "recog.h"
diff --git a/gcc/config/clipper/clipper.c b/gcc/config/clipper/clipper.c
index d92030d..8104b85 100644
--- a/gcc/config/clipper/clipper.c
+++ b/gcc/config/clipper/clipper.c
@@ -32,6 +32,8 @@ Boston, MA 02111-1307, USA. */
#include "insn-attr.h"
#include "tree.h"
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
#include "c-tree.h"
#include "function.h"
#include "flags.h"
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a557d05..b182de4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "recog.h"
#include "expr.h"
+#include "optabs.h"
#include "toplev.h"
#include "basic-block.h"
#include "ggc.h"
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index ce17c91..d7474ac 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "recog.h"
#include "expr.h"
+#include "optabs.h"
#include "obstack.h"
#include "except.h"
#include "function.h"
diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c
index b10eab0..c1b9a6b 100644
--- a/gcc/config/m88k/m88k.c
+++ b/gcc/config/m88k/m88k.c
@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "function.h"
#include "expr.h"
+#include "libfuncs.h"
#include "c-tree.h"
#include "flags.h"
#include "recog.h"
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 7ea66d8..66c8e8d 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "recog.h"
#include "expr.h"
+#include "optabs.h"
#include "function.h"
#include "obstack.h"
#include "toplev.h"
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 8d9a891..d4fe968 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -32,8 +32,10 @@ Boston, MA 02111-1307, USA. */
#include "insn-attr.h"
#include "flags.h"
#include "tree.h"
-#include "reload.h"
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
+#include "reload.h"
#include "c-tree.h"
#include "integrate.h"
#include "function.h"
diff --git a/gcc/config/pj/pj.c b/gcc/config/pj/pj.c
index b867179..870960b 100644
--- a/gcc/config/pj/pj.c
+++ b/gcc/config/pj/pj.c
@@ -95,6 +95,7 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "recog.h"
#include "expr.h"
+#include "optabs.h"
#include "toplev.h"
#include "basic-block.h"
#include "ggc.h"
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index c67ce81..d643d92 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "flags.h"
#include "expr.h"
+#include "optabs.h"
#include "function.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 2693f73..d47b985 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -36,10 +36,13 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
#include "recog.h"
#include "toplev.h"
#include "ggc.h"
#include "tm_p.h"
+#include "debug.h"
#include "target.h"
#include "target-def.h"
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e8d045f..b5f90a0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-13 Zack Weinberg <zackw@panix.com>
+
+ * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies.
+ * except.c: Include libfuncs.h.
+
2001-08-11 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
* decl.c (grokdeclarator): Clarify diagnostic message.
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 50190d3..b479414 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -264,7 +264,7 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(SYSTEM_H)
cp/rtti.o: cp/rtti.c $(CXX_TREE_H) flags.h toplev.h
cp/except.o: cp/except.c $(CXX_TREE_H) flags.h $(RTL_H) except.h toplev.h \
- cp/cfns.h $(EXPR_H) cp/decl.h $(OBSTACK_H)
+ cp/cfns.h $(EXPR_H) libfuncs.h cp/decl.h $(OBSTACK_H)
cp/expr.o: cp/expr.c $(CXX_TREE_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \
except.h $(TM_P_H)
cp/xref.o: cp/xref.c $(CXX_TREE_H) input.h toplev.h
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index fef5b53..003c3e6 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "rtl.h"
#include "expr.h"
+#include "libfuncs.h"
#include "cp-tree.h"
#include "flags.h"
#include "obstack.h"
diff --git a/gcc/doloop.c b/gcc/doloop.c
index 1cd6197..6ccc539 100644
--- a/gcc/doloop.c
+++ b/gcc/doloop.c
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "flags.h"
#include "expr.h"
+#include "optabs.h"
#include "loop.h"
#include "hard-reg-set.h"
#include "basic-block.h"
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 740df26..711b1e3 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "output.h"
#include "expr.h"
+#include "libfuncs.h"
#include "except.h"
#include "dwarf2.h"
#include "dwarf2out.h"
diff --git a/gcc/except.c b/gcc/except.c
index 3058e10..b480f5f 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -54,6 +54,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "function.h"
#include "expr.h"
+#include "libfuncs.h"
#include "insn-config.h"
#include "except.h"
#include "integrate.h"
diff --git a/gcc/explow.c b/gcc/explow.c
index cf1faf8..0900a3f 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
#include "hard-reg-set.h"
#include "insn-config.h"
#include "recog.h"
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 68efa79..830ef9e 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "insn-config.h"
#include "expr.h"
+#include "optabs.h"
#include "real.h"
#include "recog.h"
diff --git a/gcc/expr.c b/gcc/expr.c
index 5920852..27ad3f6 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -33,6 +33,8 @@ Boston, MA 02111-1307, USA. */
#include "insn-config.h"
/* Include expr.h after insn-config.h so we get HAVE_conditional_move. */
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
#include "recog.h"
#include "reload.h"
#include "output.h"
diff --git a/gcc/expr.h b/gcc/expr.h
index 07b1a81..3a651b0 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -253,549 +253,22 @@ enum direction {none, upward, downward}; /* Value has this type. */
#define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100)
#endif
-/* Optabs are tables saying how to generate insn bodies
- for various machine modes and numbers of operands.
- Each optab applies to one operation.
- For example, add_optab applies to addition.
-
- The insn_code slot is the enum insn_code that says how to
- generate an insn for this operation on a particular machine mode.
- It is CODE_FOR_nothing if there is no such insn on the target machine.
-
- The `lib_call' slot is the name of the library function that
- can be used to perform the operation.
-
- A few optabs, such as move_optab and cmp_optab, are used
- by special code. */
-
-typedef struct optab
-{
- enum rtx_code code;
- struct {
- enum insn_code insn_code;
- rtx libfunc;
- } handlers [NUM_MACHINE_MODES];
-} * optab;
-
-/* Given an enum insn_code, access the function to construct
- the body of that kind of insn. */
-#define GEN_FCN(CODE) (*insn_data[(int) (CODE)].genfun)
-
-/* Enumeration of valid indexes into optab_table. */
-enum optab_index
-{
- OTI_add,
- OTI_addv,
- OTI_sub,
- OTI_subv,
-
- /* Signed and fp multiply */
- OTI_smul,
- OTI_smulv,
- /* Signed multiply, return high word */
- OTI_smul_highpart,
- OTI_umul_highpart,
- /* Signed multiply with result one machine mode wider than args */
- OTI_smul_widen,
- OTI_umul_widen,
-
- /* Signed divide */
- OTI_sdiv,
- OTI_sdivv,
- /* Signed divide-and-remainder in one */
- OTI_sdivmod,
- OTI_udiv,
- OTI_udivmod,
- /* Signed remainder */
- OTI_smod,
- OTI_umod,
- /* Optab for floating divide. */
- OTI_flodiv,
- /* Convert float to integer in float fmt */
- OTI_ftrunc,
-
- /* Logical and */
- OTI_and,
- /* Logical or */
- OTI_ior,
- /* Logical xor */
- OTI_xor,
-
- /* Arithmetic shift left */
- OTI_ashl,
- /* Logical shift right */
- OTI_lshr,
- /* Arithmetic shift right */
- OTI_ashr,
- /* Rotate left */
- OTI_rotl,
- /* Rotate right */
- OTI_rotr,
- /* Signed and floating-point minimum value */
- OTI_smin,
- /* Signed and floating-point maximum value */
- OTI_smax,
- /* Unsigned minimum value */
- OTI_umin,
- /* Unsigned maximum value */
- OTI_umax,
-
- /* Move instruction. */
- OTI_mov,
- /* Move, preserving high part of register. */
- OTI_movstrict,
-
- /* Unary operations */
- /* Negation */
- OTI_neg,
- OTI_negv,
- /* Abs value */
- OTI_abs,
- OTI_absv,
- /* Bitwise not */
- OTI_one_cmpl,
- /* Find first bit set */
- OTI_ffs,
- /* Square root */
- OTI_sqrt,
- /* Sine */
- OTI_sin,
- /* Cosine */
- OTI_cos,
-
- /* Compare insn; two operands. */
- OTI_cmp,
- /* Used only for libcalls for unsigned comparisons. */
- OTI_ucmp,
- /* tst insn; compare one operand against 0 */
- OTI_tst,
-
- /* String length */
- OTI_strlen,
-
- /* Combined compare & jump/store flags/move operations. */
- OTI_cbranch,
- OTI_cmov,
- OTI_cstore,
-
- /* Push instruction. */
- OTI_push,
-
- OTI_MAX
-};
-
-extern optab optab_table[OTI_MAX];
-
-#define add_optab (optab_table[OTI_add])
-#define sub_optab (optab_table[OTI_sub])
-#define smul_optab (optab_table[OTI_smul])
-#define addv_optab (optab_table[OTI_addv])
-#define subv_optab (optab_table[OTI_subv])
-#define smul_highpart_optab (optab_table[OTI_smul_highpart])
-#define umul_highpart_optab (optab_table[OTI_umul_highpart])
-#define smul_widen_optab (optab_table[OTI_smul_widen])
-#define umul_widen_optab (optab_table[OTI_umul_widen])
-#define sdiv_optab (optab_table[OTI_sdiv])
-#define smulv_optab (optab_table[OTI_smulv])
-#define sdivv_optab (optab_table[OTI_sdivv])
-#define sdivmod_optab (optab_table[OTI_sdivmod])
-#define udiv_optab (optab_table[OTI_udiv])
-#define udivmod_optab (optab_table[OTI_udivmod])
-#define smod_optab (optab_table[OTI_smod])
-#define umod_optab (optab_table[OTI_umod])
-#define flodiv_optab (optab_table[OTI_flodiv])
-#define ftrunc_optab (optab_table[OTI_ftrunc])
-#define and_optab (optab_table[OTI_and])
-#define ior_optab (optab_table[OTI_ior])
-#define xor_optab (optab_table[OTI_xor])
-#define ashl_optab (optab_table[OTI_ashl])
-#define lshr_optab (optab_table[OTI_lshr])
-#define ashr_optab (optab_table[OTI_ashr])
-#define rotl_optab (optab_table[OTI_rotl])
-#define rotr_optab (optab_table[OTI_rotr])
-#define smin_optab (optab_table[OTI_smin])
-#define smax_optab (optab_table[OTI_smax])
-#define umin_optab (optab_table[OTI_umin])
-#define umax_optab (optab_table[OTI_umax])
-
-#define mov_optab (optab_table[OTI_mov])
-#define movstrict_optab (optab_table[OTI_movstrict])
-
-#define neg_optab (optab_table[OTI_neg])
-#define negv_optab (optab_table[OTI_negv])
-#define abs_optab (optab_table[OTI_abs])
-#define absv_optab (optab_table[OTI_absv])
-#define one_cmpl_optab (optab_table[OTI_one_cmpl])
-#define ffs_optab (optab_table[OTI_ffs])
-#define sqrt_optab (optab_table[OTI_sqrt])
-#define sin_optab (optab_table[OTI_sin])
-#define cos_optab (optab_table[OTI_cos])
-
-#define cmp_optab (optab_table[OTI_cmp])
-#define ucmp_optab (optab_table[OTI_ucmp])
-#define tst_optab (optab_table[OTI_tst])
-
-#define strlen_optab (optab_table[OTI_strlen])
-
-#define cbranch_optab (optab_table[OTI_cbranch])
-#define cmov_optab (optab_table[OTI_cmov])
-#define cstore_optab (optab_table[OTI_cstore])
-#define push_optab (optab_table[OTI_push])
-
-/* Tables of patterns for extending one integer mode to another. */
-extern enum insn_code extendtab[MAX_MACHINE_MODE][MAX_MACHINE_MODE][2];
-
-/* Tables of patterns for converting between fixed and floating point. */
-extern enum insn_code fixtab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
-extern enum insn_code fixtrunctab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
-extern enum insn_code floattab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
-
-/* Contains the optab used for each rtx code. */
-extern optab code_to_optab[NUM_RTX_CODE + 1];
-
-/* Passed to expand_binop and expand_unop to say which options to try to use
- if the requested operation can't be open-coded on the requisite mode.
- Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using a library call.
- Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try using a wider mode.
- OPTAB_MUST_WIDEN says try widening and don't try anything else. */
-
-enum optab_methods
-{
- OPTAB_DIRECT,
- OPTAB_LIB,
- OPTAB_WIDEN,
- OPTAB_LIB_WIDEN,
- OPTAB_MUST_WIDEN
-};
-
-/* Enumeration of indexes into libfunc_table. */
-enum libfunc_index
-{
- LTI_extendsfdf2,
- LTI_extendsfxf2,
- LTI_extendsftf2,
- LTI_extenddfxf2,
- LTI_extenddftf2,
-
- LTI_truncdfsf2,
- LTI_truncxfsf2,
- LTI_trunctfsf2,
- LTI_truncxfdf2,
- LTI_trunctfdf2,
-
- LTI_memcpy,
- LTI_memmove,
- LTI_bcopy,
- LTI_memcmp,
- LTI_bcmp,
- LTI_memset,
- LTI_bzero,
-
- LTI_unwind_resume,
- LTI_eh_personality,
- LTI_setjmp,
- LTI_longjmp,
- LTI_unwind_sjlj_register,
- LTI_unwind_sjlj_unregister,
-
- LTI_eqhf2,
- LTI_nehf2,
- LTI_gthf2,
- LTI_gehf2,
- LTI_lthf2,
- LTI_lehf2,
- LTI_unordhf2,
-
- LTI_eqsf2,
- LTI_nesf2,
- LTI_gtsf2,
- LTI_gesf2,
- LTI_ltsf2,
- LTI_lesf2,
- LTI_unordsf2,
-
- LTI_eqdf2,
- LTI_nedf2,
- LTI_gtdf2,
- LTI_gedf2,
- LTI_ltdf2,
- LTI_ledf2,
- LTI_unorddf2,
-
- LTI_eqxf2,
- LTI_nexf2,
- LTI_gtxf2,
- LTI_gexf2,
- LTI_ltxf2,
- LTI_lexf2,
- LTI_unordxf2,
-
- LTI_eqtf2,
- LTI_netf2,
- LTI_gttf2,
- LTI_getf2,
- LTI_lttf2,
- LTI_letf2,
- LTI_unordtf2,
-
- LTI_floatsisf,
- LTI_floatdisf,
- LTI_floattisf,
-
- LTI_floatsidf,
- LTI_floatdidf,
- LTI_floattidf,
-
- LTI_floatsixf,
- LTI_floatdixf,
- LTI_floattixf,
-
- LTI_floatsitf,
- LTI_floatditf,
- LTI_floattitf,
-
- LTI_fixsfsi,
- LTI_fixsfdi,
- LTI_fixsfti,
-
- LTI_fixdfsi,
- LTI_fixdfdi,
- LTI_fixdfti,
-
- LTI_fixxfsi,
- LTI_fixxfdi,
- LTI_fixxfti,
-
- LTI_fixtfsi,
- LTI_fixtfdi,
- LTI_fixtfti,
-
- LTI_fixunssfsi,
- LTI_fixunssfdi,
- LTI_fixunssfti,
-
- LTI_fixunsdfsi,
- LTI_fixunsdfdi,
- LTI_fixunsdfti,
-
- LTI_fixunsxfsi,
- LTI_fixunsxfdi,
- LTI_fixunsxfti,
-
- LTI_fixunstfsi,
- LTI_fixunstfdi,
- LTI_fixunstfti,
-
- LTI_chkr_check_addr,
- LTI_chkr_set_right,
- LTI_chkr_copy_bitmap,
- LTI_chkr_check_exec,
- LTI_chkr_check_str,
-
- LTI_profile_function_entry,
- LTI_profile_function_exit,
-
- LTI_MAX
-};
-
-/* SYMBOL_REF rtx's for the library functions that are called
- implicitly and not via optabs. */
-extern rtx libfunc_table[LTI_MAX];
-
-/* Accessor macros for libfunc_table. */
-#define extendsfdf2_libfunc (libfunc_table[LTI_extendsfdf2])
-#define extendsfxf2_libfunc (libfunc_table[LTI_extendsfxf2])
-#define extendsftf2_libfunc (libfunc_table[LTI_extendsftf2])
-#define extenddfxf2_libfunc (libfunc_table[LTI_extenddfxf2])
-#define extenddftf2_libfunc (libfunc_table[LTI_extenddftf2])
-
-#define truncdfsf2_libfunc (libfunc_table[LTI_truncdfsf2])
-#define truncxfsf2_libfunc (libfunc_table[LTI_truncxfsf2])
-#define trunctfsf2_libfunc (libfunc_table[LTI_trunctfsf2])
-#define truncxfdf2_libfunc (libfunc_table[LTI_truncxfdf2])
-#define trunctfdf2_libfunc (libfunc_table[LTI_trunctfdf2])
-
-#define memcpy_libfunc (libfunc_table[LTI_memcpy])
-#define memmove_libfunc (libfunc_table[LTI_memmove])
-#define bcopy_libfunc (libfunc_table[LTI_bcopy])
-#define memcmp_libfunc (libfunc_table[LTI_memcmp])
-#define bcmp_libfunc (libfunc_table[LTI_bcmp])
-#define memset_libfunc (libfunc_table[LTI_memset])
-#define bzero_libfunc (libfunc_table[LTI_bzero])
-
-#define unwind_resume_libfunc (libfunc_table[LTI_unwind_resume])
-#define eh_personality_libfunc (libfunc_table[LTI_eh_personality])
-#define setjmp_libfunc (libfunc_table[LTI_setjmp])
-#define longjmp_libfunc (libfunc_table[LTI_longjmp])
-#define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register])
-#define unwind_sjlj_unregister_libfunc \
- (libfunc_table[LTI_unwind_sjlj_unregister])
-
-#define eqhf2_libfunc (libfunc_table[LTI_eqhf2])
-#define nehf2_libfunc (libfunc_table[LTI_nehf2])
-#define gthf2_libfunc (libfunc_table[LTI_gthf2])
-#define gehf2_libfunc (libfunc_table[LTI_gehf2])
-#define lthf2_libfunc (libfunc_table[LTI_lthf2])
-#define lehf2_libfunc (libfunc_table[LTI_lehf2])
-#define unordhf2_libfunc (libfunc_table[LTI_unordhf2])
-
-#define eqsf2_libfunc (libfunc_table[LTI_eqsf2])
-#define nesf2_libfunc (libfunc_table[LTI_nesf2])
-#define gtsf2_libfunc (libfunc_table[LTI_gtsf2])
-#define gesf2_libfunc (libfunc_table[LTI_gesf2])
-#define ltsf2_libfunc (libfunc_table[LTI_ltsf2])
-#define lesf2_libfunc (libfunc_table[LTI_lesf2])
-#define unordsf2_libfunc (libfunc_table[LTI_unordsf2])
-
-#define eqdf2_libfunc (libfunc_table[LTI_eqdf2])
-#define nedf2_libfunc (libfunc_table[LTI_nedf2])
-#define gtdf2_libfunc (libfunc_table[LTI_gtdf2])
-#define gedf2_libfunc (libfunc_table[LTI_gedf2])
-#define ltdf2_libfunc (libfunc_table[LTI_ltdf2])
-#define ledf2_libfunc (libfunc_table[LTI_ledf2])
-#define unorddf2_libfunc (libfunc_table[LTI_unorddf2])
-
-#define eqxf2_libfunc (libfunc_table[LTI_eqxf2])
-#define nexf2_libfunc (libfunc_table[LTI_nexf2])
-#define gtxf2_libfunc (libfunc_table[LTI_gtxf2])
-#define gexf2_libfunc (libfunc_table[LTI_gexf2])
-#define ltxf2_libfunc (libfunc_table[LTI_ltxf2])
-#define lexf2_libfunc (libfunc_table[LTI_lexf2])
-#define unordxf2_libfunc (libfunc_table[LTI_unordxf2])
-
-#define eqtf2_libfunc (libfunc_table[LTI_eqtf2])
-#define netf2_libfunc (libfunc_table[LTI_netf2])
-#define gttf2_libfunc (libfunc_table[LTI_gttf2])
-#define getf2_libfunc (libfunc_table[LTI_getf2])
-#define lttf2_libfunc (libfunc_table[LTI_lttf2])
-#define letf2_libfunc (libfunc_table[LTI_letf2])
-#define unordtf2_libfunc (libfunc_table[LTI_unordtf2])
-
-#define floatsisf_libfunc (libfunc_table[LTI_floatsisf])
-#define floatdisf_libfunc (libfunc_table[LTI_floatdisf])
-#define floattisf_libfunc (libfunc_table[LTI_floattisf])
-
-#define floatsidf_libfunc (libfunc_table[LTI_floatsidf])
-#define floatdidf_libfunc (libfunc_table[LTI_floatdidf])
-#define floattidf_libfunc (libfunc_table[LTI_floattidf])
-
-#define floatsixf_libfunc (libfunc_table[LTI_floatsixf])
-#define floatdixf_libfunc (libfunc_table[LTI_floatdixf])
-#define floattixf_libfunc (libfunc_table[LTI_floattixf])
-
-#define floatsitf_libfunc (libfunc_table[LTI_floatsitf])
-#define floatditf_libfunc (libfunc_table[LTI_floatditf])
-#define floattitf_libfunc (libfunc_table[LTI_floattitf])
-
-#define fixsfsi_libfunc (libfunc_table[LTI_fixsfsi])
-#define fixsfdi_libfunc (libfunc_table[LTI_fixsfdi])
-#define fixsfti_libfunc (libfunc_table[LTI_fixsfti])
-
-#define fixdfsi_libfunc (libfunc_table[LTI_fixdfsi])
-#define fixdfdi_libfunc (libfunc_table[LTI_fixdfdi])
-#define fixdfti_libfunc (libfunc_table[LTI_fixdfti])
-
-#define fixxfsi_libfunc (libfunc_table[LTI_fixxfsi])
-#define fixxfdi_libfunc (libfunc_table[LTI_fixxfdi])
-#define fixxfti_libfunc (libfunc_table[LTI_fixxfti])
-
-#define fixtfsi_libfunc (libfunc_table[LTI_fixtfsi])
-#define fixtfdi_libfunc (libfunc_table[LTI_fixtfdi])
-#define fixtfti_libfunc (libfunc_table[LTI_fixtfti])
-
-#define fixunssfsi_libfunc (libfunc_table[LTI_fixunssfsi])
-#define fixunssfdi_libfunc (libfunc_table[LTI_fixunssfdi])
-#define fixunssfti_libfunc (libfunc_table[LTI_fixunssfti])
-
-#define fixunsdfsi_libfunc (libfunc_table[LTI_fixunsdfsi])
-#define fixunsdfdi_libfunc (libfunc_table[LTI_fixunsdfdi])
-#define fixunsdfti_libfunc (libfunc_table[LTI_fixunsdfti])
-
-#define fixunsxfsi_libfunc (libfunc_table[LTI_fixunsxfsi])
-#define fixunsxfdi_libfunc (libfunc_table[LTI_fixunsxfdi])
-#define fixunsxfti_libfunc (libfunc_table[LTI_fixunsxfti])
-
-#define fixunstfsi_libfunc (libfunc_table[LTI_fixunstfsi])
-#define fixunstfdi_libfunc (libfunc_table[LTI_fixunstfdi])
-#define fixunstfti_libfunc (libfunc_table[LTI_fixunstfti])
-
-#define chkr_check_addr_libfunc (libfunc_table[LTI_chkr_check_addr])
-#define chkr_set_right_libfunc (libfunc_table[LTI_chkr_set_right])
-#define chkr_copy_bitmap_libfunc (libfunc_table[LTI_chkr_copy_bitmap])
-#define chkr_check_exec_libfunc (libfunc_table[LTI_chkr_check_exec])
-#define chkr_check_str_libfunc (libfunc_table[LTI_chkr_check_str])
-
-#define profile_function_entry_libfunc (libfunc_table[LTI_profile_function_entry])
-#define profile_function_exit_libfunc (libfunc_table[LTI_profile_function_exit])
-
-typedef rtx (*rtxfun) PARAMS ((rtx));
-
-/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
- gives the gen_function to make a branch to test that condition. */
-
-extern rtxfun bcc_gen_fctn[NUM_RTX_CODE];
-
-/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
- gives the insn code to make a store-condition insn
- to test that condition. */
-
-extern enum insn_code setcc_gen_code[NUM_RTX_CODE];
-
-#ifdef HAVE_conditional_move
-/* Indexed by the machine mode, gives the insn code to make a conditional
- move insn. */
-
-extern enum insn_code movcc_gen_code[NUM_MACHINE_MODES];
-#endif
-
-/* This array records the insn_code of insns to perform block moves. */
-extern enum insn_code movstr_optab[NUM_MACHINE_MODES];
-
-/* This array records the insn_code of insns to perform block clears. */
-extern enum insn_code clrstr_optab[NUM_MACHINE_MODES];
-
-/* Define functions given in optabs.c. */
-
-/* Expand a binary operation given optab and rtx operands. */
-extern rtx expand_binop PARAMS ((enum machine_mode, optab, rtx, rtx, rtx,
- int, enum optab_methods));
-
-/* Expand a binary operation with both signed and unsigned forms. */
-extern rtx sign_expand_binop PARAMS ((enum machine_mode, optab, optab, rtx,
- rtx, rtx, int, enum optab_methods));
-
-/* Generate code to perform an operation on two operands with two results. */
-extern int expand_twoval_binop PARAMS ((optab, rtx, rtx, rtx, rtx, int));
-
-/* Expand a unary arithmetic operation given optab rtx operand. */
-extern rtx expand_unop PARAMS ((enum machine_mode, optab, rtx, rtx, int));
-
-/* Expand the absolute value operation. */
-extern rtx expand_abs PARAMS ((enum machine_mode, rtx, rtx, int, int));
-
-/* Expand the complex absolute value operation. */
-extern rtx expand_complex_abs PARAMS ((enum machine_mode, rtx, rtx, int));
-
-/* Generate an instruction with a given INSN_CODE with an output and
- an input. */
-extern void emit_unop_insn PARAMS ((int, rtx, rtx, enum rtx_code));
-
-/* Emit code to perform a series of operations on a multi-word quantity, one
- word at a time. */
-extern rtx emit_no_conflict_block PARAMS ((rtx, rtx, rtx, rtx, rtx));
+/* Functions from optabs.c, commonly used, and without need for the optabs
+ tables: */
/* Emit code to make a call to a constant function or a library call. */
extern void emit_libcall_block PARAMS ((rtx, rtx, rtx, rtx));
-/* Emit one rtl instruction to store zero in specified rtx. */
-extern void emit_clr_insn PARAMS ((rtx));
-
-/* Emit one rtl insn to store 1 in specified rtx assuming it contains 0. */
-extern void emit_0_to_1_insn PARAMS ((rtx));
-
-/* Emit one rtl insn to compare two rtx's. */
-extern void emit_cmp_insn PARAMS ((rtx, rtx, enum rtx_code, rtx,
- enum machine_mode, int, unsigned int));
+/* Create but don't emit one rtl instruction to perform certain operations.
+ Modes must match; operands must meet the operation's predicates.
+ Likewise for subtraction and for just copying.
+ These do not call protect_from_queue; caller must do so. */
+extern rtx gen_add2_insn PARAMS ((rtx, rtx));
+extern rtx gen_add3_insn PARAMS ((rtx, rtx, rtx));
+extern rtx gen_sub2_insn PARAMS ((rtx, rtx));
+extern rtx gen_move_insn PARAMS ((rtx, rtx));
+extern int have_add2_insn PARAMS ((rtx, rtx));
+extern int have_sub2_insn PARAMS ((rtx, rtx));
/* Emit a pair of rtl insns to compare two rtx's and to jump
to a label if the comparison is true. */
@@ -803,27 +276,6 @@ extern void emit_cmp_and_jump_insns PARAMS ((rtx, rtx, enum rtx_code, rtx,
enum machine_mode, int,
unsigned int, rtx));
-/* The various uses that a comparison can have; used by can_compare_p:
- jumps, conditional moves, store flag operations. */
-enum can_compare_purpose
-{
- ccp_jump,
- ccp_cmov,
- ccp_store_flag
-};
-
-/* Nonzero if a compare of mode MODE can be done straightforwardly
- (without splitting it into pieces). */
-extern int can_compare_p PARAMS ((enum rtx_code, enum machine_mode,
- enum can_compare_purpose));
-
-extern void prepare_cmp_insn PARAMS ((rtx *, rtx *, enum rtx_code *, rtx,
- enum machine_mode *, int *, int,
- enum can_compare_purpose));
-
-extern rtx prepare_operand PARAMS ((int, rtx, int, enum machine_mode,
- enum machine_mode, int));
-
/* Generate code to indirectly jump to a location given in the rtx LOC. */
extern void emit_indirect_jump PARAMS ((rtx));
@@ -838,42 +290,6 @@ int can_conditionally_move_p PARAMS ((enum machine_mode mode));
#endif
-/* Create but don't emit one rtl instruction to add one rtx into another.
- Modes must match; operands must meet the operation's predicates.
- Likewise for subtraction and for just copying.
- These do not call protect_from_queue; caller must do so. */
-extern rtx gen_add2_insn PARAMS ((rtx, rtx));
-extern rtx gen_sub2_insn PARAMS ((rtx, rtx));
-extern rtx gen_move_insn PARAMS ((rtx, rtx));
-extern int have_add2_insn PARAMS ((rtx, rtx));
-extern int have_sub2_insn PARAMS ((rtx, rtx));
-
-/* Return the INSN_CODE to use for an extend operation. */
-extern enum insn_code can_extend_p PARAMS ((enum machine_mode,
- enum machine_mode, int));
-
-/* Generate the body of an insn to extend Y (with mode MFROM)
- into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero. */
-extern rtx gen_extend_insn PARAMS ((rtx, rtx, enum machine_mode,
- enum machine_mode, int));
-
-/* Initialize the tables that control conversion between fixed and
- floating values. */
-extern void init_fixtab PARAMS ((void));
-extern void init_floattab PARAMS ((void));
-
-/* Generate code for a FLOAT_EXPR. */
-extern void expand_float PARAMS ((rtx, rtx, int));
-
-/* Generate code for a FIX_EXPR. */
-extern void expand_fix PARAMS ((rtx, rtx, int));
-
-/* Call this to initialize an optab function entry. */
-extern rtx init_one_libfunc PARAMS ((const char *));
-
-/* Call this once to initialize the contents of the optabs
- appropriately for the current target machine. */
-extern void init_optabs PARAMS ((void));
/* Functions from expmed.c: */
@@ -1304,7 +720,14 @@ extern int safe_from_p PARAMS ((rtx, tree, int));
extern int (*lang_safe_from_p) PARAMS ((rtx, tree));
#endif
+/* Call this once to initialize the contents of the optabs
+ appropriately for the current target machine. */
+extern void init_optabs PARAMS ((void));
extern void init_all_optabs PARAMS ((void));
+
+/* Call this to initialize an optab function entry. */
+extern rtx init_one_libfunc PARAMS ((const char *));
+
extern void do_jump_by_parts_equality_rtx PARAMS ((rtx, rtx, rtx));
extern void do_jump_by_parts_greater_rtx PARAMS ((enum machine_mode,
int, rtx, rtx, rtx,
diff --git a/gcc/function.c b/gcc/function.c
index 7a03d9c..450c400 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -46,6 +46,8 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "insn-config.h"
diff --git a/gcc/gencodes.c b/gcc/gencodes.c
index 2610a12..ffcd187 100644
--- a/gcc/gencodes.c
+++ b/gcc/gencodes.c
@@ -28,20 +28,18 @@ Boston, MA 02111-1307, USA. */
#include "errors.h"
#include "gensupport.h"
-static int insn_code_number;
-
-static void gen_insn PARAMS ((rtx));
+static void gen_insn PARAMS ((const char *, int));
static void
-gen_insn (insn)
- rtx insn;
+gen_insn (name, code)
+ const char *name;
+ int code;
{
/* Don't mention instructions whose names are the null string
or begin with '*'. They are in the machine description just
to be recognized. */
- if (XSTR (insn, 0)[0] != 0 && XSTR (insn, 0)[0] != '*')
- printf (" CODE_FOR_%s = %d,\n", XSTR (insn, 0),
- insn_code_number);
+ if (name[0] != 0 && name[0] != '*')
+ printf (" CODE_FOR_%s = %d,\n", name, code);
}
extern int main PARAMS ((int, char **));
@@ -61,33 +59,34 @@ main (argc, argv)
if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
return (FATAL_EXIT_CODE);
- puts ("/* Generated automatically by the program `gencodes'");
- puts (" from the machine description file `md'. */\n");
- puts ("#ifndef GCC_INSN_CODES_H");
- puts ("#define GCC_INSN_CODES_H\n");
+ puts ("\
+/* Generated automatically by the program `gencodes'\n\
+ from the machine description file `md'. */\n\
+\n\
+#ifndef GCC_INSN_CODES_H\n\
+#define GCC_INSN_CODES_H\n\
+\n\
+enum insn_code {");
/* Read the machine description. */
- insn_code_number = 0;
- printf ("enum insn_code {\n");
-
while (1)
{
int line_no;
+ int insn_code_number;
desc = read_md_rtx (&line_no, &insn_code_number);
if (desc == NULL)
break;
if (GET_CODE (desc) == DEFINE_INSN || GET_CODE (desc) == DEFINE_EXPAND)
- gen_insn (desc);
+ gen_insn (XSTR (desc, 0), insn_code_number);
}
- printf (" CODE_FOR_nothing = %d };\n", insn_code_number + 1);
-
- printf ("\n#define MAX_INSN_CODE ((int) CODE_FOR_nothing)\n\n");
-
- puts("\n#endif /* GCC_INSN_CODES_H */");
+ puts ("CODE_FOR_nothing\n\
+};\n\
+\n\
+#endif /* GCC_INSN_CODES_H */");
if (ferror (stdout) || fflush (stdout) || fclose (stdout))
return FATAL_EXIT_CODE;
diff --git a/gcc/genemit.c b/gcc/genemit.c
index b7985ba..45a102e 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -809,6 +809,7 @@ from the machine description file `md'. */\n\n");
printf ("#include \"tm_p.h\"\n");
printf ("#include \"function.h\"\n");
printf ("#include \"expr.h\"\n");
+ printf ("#include \"optabs.h\"\n");
printf ("#include \"real.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"output.h\"\n");
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index 8e00718..ee4dbf2 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -330,6 +330,7 @@ from the machine description file `md'. */\n\n");
printf ("#include \"insn-config.h\"\n");
printf ("#include \"recog.h\"\n");
printf ("#include \"expr.h\"\n");
+ printf ("#include \"optabs.h\"\n");
printf ("#include \"reload.h\"\n\n");
printf ("void\ninit_all_optabs ()\n{\n");
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index bca9a62..f443605 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -223,6 +223,7 @@ output_prologue ()
printf ("#include \"ggc.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"expr.h\"\n");
+ printf ("#include \"insn-codes.h\"\n");
printf ("#include \"tm_p.h\"\n");
printf ("#include \"function.h\"\n");
printf ("#include \"regs.h\"\n");
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index ce13599..77d585c 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -30,6 +30,7 @@
#include "hard-reg-set.h"
#include "basic-block.h"
#include "expr.h"
+#include "optabs.h"
#include "real.h"
#include "output.h"
#include "toplev.h"
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 4dd5132..c4589c3 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-13 Zack Weinberg <zackw@panix.com>
+
+ * Make-lang.in (java/decl.o): Update dependencies.
+ * decl.c: Include libfuncs.h, don't include toplev.h.
+
2001-08-12 David Edelsohn <edelsohn@gnu.org>
Revert:
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index d0ae26c..67ae036 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -248,11 +248,12 @@ java/class.o: java/class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
java/parse.h toplev.h $(SYSTEM_H) output.h $(GGC_H) $(TARGET_H) function.h
java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
toplev.h $(SYSTEM_H) $(GGC_H)
-java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
- toplev.h $(SYSTEM_H) function.h gcc.h
+java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
+ toplev.h flags.h $(SYSTEM_H) function.h expr.h libfuncs.h except.h \
+ java/java-except.h $(GGC_H)
java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
$(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \
- toplev.h $(SYSTEM_H) function.h
+ toplev.h $(SYSTEM_H) function.h
java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
$(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \
java/java-except.h java/java-except.h java/parse.h toplev.h \
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 4eb0739..abb49fa 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -34,9 +34,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "flags.h"
#include "java-tree.h"
#include "jcf.h"
-#include "toplev.h"
#include "function.h"
#include "expr.h"
+#include "libfuncs.h"
#include "except.h"
#include "java-except.h"
#include "ggc.h"
diff --git a/gcc/libfuncs.h b/gcc/libfuncs.h
new file mode 100644
index 0000000..c1e7eb1
--- /dev/null
+++ b/gcc/libfuncs.h
@@ -0,0 +1,284 @@
+/* Definitions for code generation pass of GNU compiler.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC 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 2, or (at your option)
+any later version.
+
+GNU CC 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 GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef GCC_LIBFUNCS_H
+#define GCC_LIBFUNCS_H
+
+/* Enumeration of indexes into libfunc_table. */
+enum libfunc_index
+{
+ LTI_extendsfdf2,
+ LTI_extendsfxf2,
+ LTI_extendsftf2,
+ LTI_extenddfxf2,
+ LTI_extenddftf2,
+
+ LTI_truncdfsf2,
+ LTI_truncxfsf2,
+ LTI_trunctfsf2,
+ LTI_truncxfdf2,
+ LTI_trunctfdf2,
+
+ LTI_memcpy,
+ LTI_memmove,
+ LTI_bcopy,
+ LTI_memcmp,
+ LTI_bcmp,
+ LTI_memset,
+ LTI_bzero,
+
+ LTI_unwind_resume,
+ LTI_eh_personality,
+ LTI_setjmp,
+ LTI_longjmp,
+ LTI_unwind_sjlj_register,
+ LTI_unwind_sjlj_unregister,
+
+ LTI_eqhf2,
+ LTI_nehf2,
+ LTI_gthf2,
+ LTI_gehf2,
+ LTI_lthf2,
+ LTI_lehf2,
+ LTI_unordhf2,
+
+ LTI_eqsf2,
+ LTI_nesf2,
+ LTI_gtsf2,
+ LTI_gesf2,
+ LTI_ltsf2,
+ LTI_lesf2,
+ LTI_unordsf2,
+
+ LTI_eqdf2,
+ LTI_nedf2,
+ LTI_gtdf2,
+ LTI_gedf2,
+ LTI_ltdf2,
+ LTI_ledf2,
+ LTI_unorddf2,
+
+ LTI_eqxf2,
+ LTI_nexf2,
+ LTI_gtxf2,
+ LTI_gexf2,
+ LTI_ltxf2,
+ LTI_lexf2,
+ LTI_unordxf2,
+
+ LTI_eqtf2,
+ LTI_netf2,
+ LTI_gttf2,
+ LTI_getf2,
+ LTI_lttf2,
+ LTI_letf2,
+ LTI_unordtf2,
+
+ LTI_floatsisf,
+ LTI_floatdisf,
+ LTI_floattisf,
+
+ LTI_floatsidf,
+ LTI_floatdidf,
+ LTI_floattidf,
+
+ LTI_floatsixf,
+ LTI_floatdixf,
+ LTI_floattixf,
+
+ LTI_floatsitf,
+ LTI_floatditf,
+ LTI_floattitf,
+
+ LTI_fixsfsi,
+ LTI_fixsfdi,
+ LTI_fixsfti,
+
+ LTI_fixdfsi,
+ LTI_fixdfdi,
+ LTI_fixdfti,
+
+ LTI_fixxfsi,
+ LTI_fixxfdi,
+ LTI_fixxfti,
+
+ LTI_fixtfsi,
+ LTI_fixtfdi,
+ LTI_fixtfti,
+
+ LTI_fixunssfsi,
+ LTI_fixunssfdi,
+ LTI_fixunssfti,
+
+ LTI_fixunsdfsi,
+ LTI_fixunsdfdi,
+ LTI_fixunsdfti,
+
+ LTI_fixunsxfsi,
+ LTI_fixunsxfdi,
+ LTI_fixunsxfti,
+
+ LTI_fixunstfsi,
+ LTI_fixunstfdi,
+ LTI_fixunstfti,
+
+ LTI_chkr_check_addr,
+ LTI_chkr_set_right,
+ LTI_chkr_copy_bitmap,
+ LTI_chkr_check_exec,
+ LTI_chkr_check_str,
+
+ LTI_profile_function_entry,
+ LTI_profile_function_exit,
+
+ LTI_MAX
+};
+
+/* SYMBOL_REF rtx's for the library functions that are called
+ implicitly and not via optabs. */
+extern rtx libfunc_table[LTI_MAX];
+
+/* Accessor macros for libfunc_table. */
+#define extendsfdf2_libfunc (libfunc_table[LTI_extendsfdf2])
+#define extendsfxf2_libfunc (libfunc_table[LTI_extendsfxf2])
+#define extendsftf2_libfunc (libfunc_table[LTI_extendsftf2])
+#define extenddfxf2_libfunc (libfunc_table[LTI_extenddfxf2])
+#define extenddftf2_libfunc (libfunc_table[LTI_extenddftf2])
+
+#define truncdfsf2_libfunc (libfunc_table[LTI_truncdfsf2])
+#define truncxfsf2_libfunc (libfunc_table[LTI_truncxfsf2])
+#define trunctfsf2_libfunc (libfunc_table[LTI_trunctfsf2])
+#define truncxfdf2_libfunc (libfunc_table[LTI_truncxfdf2])
+#define trunctfdf2_libfunc (libfunc_table[LTI_trunctfdf2])
+
+#define memcpy_libfunc (libfunc_table[LTI_memcpy])
+#define memmove_libfunc (libfunc_table[LTI_memmove])
+#define bcopy_libfunc (libfunc_table[LTI_bcopy])
+#define memcmp_libfunc (libfunc_table[LTI_memcmp])
+#define bcmp_libfunc (libfunc_table[LTI_bcmp])
+#define memset_libfunc (libfunc_table[LTI_memset])
+#define bzero_libfunc (libfunc_table[LTI_bzero])
+
+#define unwind_resume_libfunc (libfunc_table[LTI_unwind_resume])
+#define eh_personality_libfunc (libfunc_table[LTI_eh_personality])
+#define setjmp_libfunc (libfunc_table[LTI_setjmp])
+#define longjmp_libfunc (libfunc_table[LTI_longjmp])
+#define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register])
+#define unwind_sjlj_unregister_libfunc \
+ (libfunc_table[LTI_unwind_sjlj_unregister])
+
+#define eqhf2_libfunc (libfunc_table[LTI_eqhf2])
+#define nehf2_libfunc (libfunc_table[LTI_nehf2])
+#define gthf2_libfunc (libfunc_table[LTI_gthf2])
+#define gehf2_libfunc (libfunc_table[LTI_gehf2])
+#define lthf2_libfunc (libfunc_table[LTI_lthf2])
+#define lehf2_libfunc (libfunc_table[LTI_lehf2])
+#define unordhf2_libfunc (libfunc_table[LTI_unordhf2])
+
+#define eqsf2_libfunc (libfunc_table[LTI_eqsf2])
+#define nesf2_libfunc (libfunc_table[LTI_nesf2])
+#define gtsf2_libfunc (libfunc_table[LTI_gtsf2])
+#define gesf2_libfunc (libfunc_table[LTI_gesf2])
+#define ltsf2_libfunc (libfunc_table[LTI_ltsf2])
+#define lesf2_libfunc (libfunc_table[LTI_lesf2])
+#define unordsf2_libfunc (libfunc_table[LTI_unordsf2])
+
+#define eqdf2_libfunc (libfunc_table[LTI_eqdf2])
+#define nedf2_libfunc (libfunc_table[LTI_nedf2])
+#define gtdf2_libfunc (libfunc_table[LTI_gtdf2])
+#define gedf2_libfunc (libfunc_table[LTI_gedf2])
+#define ltdf2_libfunc (libfunc_table[LTI_ltdf2])
+#define ledf2_libfunc (libfunc_table[LTI_ledf2])
+#define unorddf2_libfunc (libfunc_table[LTI_unorddf2])
+
+#define eqxf2_libfunc (libfunc_table[LTI_eqxf2])
+#define nexf2_libfunc (libfunc_table[LTI_nexf2])
+#define gtxf2_libfunc (libfunc_table[LTI_gtxf2])
+#define gexf2_libfunc (libfunc_table[LTI_gexf2])
+#define ltxf2_libfunc (libfunc_table[LTI_ltxf2])
+#define lexf2_libfunc (libfunc_table[LTI_lexf2])
+#define unordxf2_libfunc (libfunc_table[LTI_unordxf2])
+
+#define eqtf2_libfunc (libfunc_table[LTI_eqtf2])
+#define netf2_libfunc (libfunc_table[LTI_netf2])
+#define gttf2_libfunc (libfunc_table[LTI_gttf2])
+#define getf2_libfunc (libfunc_table[LTI_getf2])
+#define lttf2_libfunc (libfunc_table[LTI_lttf2])
+#define letf2_libfunc (libfunc_table[LTI_letf2])
+#define unordtf2_libfunc (libfunc_table[LTI_unordtf2])
+
+#define floatsisf_libfunc (libfunc_table[LTI_floatsisf])
+#define floatdisf_libfunc (libfunc_table[LTI_floatdisf])
+#define floattisf_libfunc (libfunc_table[LTI_floattisf])
+
+#define floatsidf_libfunc (libfunc_table[LTI_floatsidf])
+#define floatdidf_libfunc (libfunc_table[LTI_floatdidf])
+#define floattidf_libfunc (libfunc_table[LTI_floattidf])
+
+#define floatsixf_libfunc (libfunc_table[LTI_floatsixf])
+#define floatdixf_libfunc (libfunc_table[LTI_floatdixf])
+#define floattixf_libfunc (libfunc_table[LTI_floattixf])
+
+#define floatsitf_libfunc (libfunc_table[LTI_floatsitf])
+#define floatditf_libfunc (libfunc_table[LTI_floatditf])
+#define floattitf_libfunc (libfunc_table[LTI_floattitf])
+
+#define fixsfsi_libfunc (libfunc_table[LTI_fixsfsi])
+#define fixsfdi_libfunc (libfunc_table[LTI_fixsfdi])
+#define fixsfti_libfunc (libfunc_table[LTI_fixsfti])
+
+#define fixdfsi_libfunc (libfunc_table[LTI_fixdfsi])
+#define fixdfdi_libfunc (libfunc_table[LTI_fixdfdi])
+#define fixdfti_libfunc (libfunc_table[LTI_fixdfti])
+
+#define fixxfsi_libfunc (libfunc_table[LTI_fixxfsi])
+#define fixxfdi_libfunc (libfunc_table[LTI_fixxfdi])
+#define fixxfti_libfunc (libfunc_table[LTI_fixxfti])
+
+#define fixtfsi_libfunc (libfunc_table[LTI_fixtfsi])
+#define fixtfdi_libfunc (libfunc_table[LTI_fixtfdi])
+#define fixtfti_libfunc (libfunc_table[LTI_fixtfti])
+
+#define fixunssfsi_libfunc (libfunc_table[LTI_fixunssfsi])
+#define fixunssfdi_libfunc (libfunc_table[LTI_fixunssfdi])
+#define fixunssfti_libfunc (libfunc_table[LTI_fixunssfti])
+
+#define fixunsdfsi_libfunc (libfunc_table[LTI_fixunsdfsi])
+#define fixunsdfdi_libfunc (libfunc_table[LTI_fixunsdfdi])
+#define fixunsdfti_libfunc (libfunc_table[LTI_fixunsdfti])
+
+#define fixunsxfsi_libfunc (libfunc_table[LTI_fixunsxfsi])
+#define fixunsxfdi_libfunc (libfunc_table[LTI_fixunsxfdi])
+#define fixunsxfti_libfunc (libfunc_table[LTI_fixunsxfti])
+
+#define fixunstfsi_libfunc (libfunc_table[LTI_fixunstfsi])
+#define fixunstfdi_libfunc (libfunc_table[LTI_fixunstfdi])
+#define fixunstfti_libfunc (libfunc_table[LTI_fixunstfti])
+
+#define chkr_check_addr_libfunc (libfunc_table[LTI_chkr_check_addr])
+#define chkr_set_right_libfunc (libfunc_table[LTI_chkr_set_right])
+#define chkr_copy_bitmap_libfunc (libfunc_table[LTI_chkr_copy_bitmap])
+#define chkr_check_exec_libfunc (libfunc_table[LTI_chkr_check_exec])
+#define chkr_check_str_libfunc (libfunc_table[LTI_chkr_check_str])
+
+#define profile_function_entry_libfunc (libfunc_table[LTI_profile_function_entry])
+#define profile_function_exit_libfunc (libfunc_table[LTI_profile_function_exit])
+
+#endif /* GCC_LIBFUNCS_H */
diff --git a/gcc/loop.c b/gcc/loop.c
index 5e5fa13..55fa912 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "insn-config.h"
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
index d43bc98..7de903c 100644
--- a/gcc/mkconfig.sh
+++ b/gcc/mkconfig.sh
@@ -51,9 +51,8 @@ done
# If this is tm_p.h, include tm-preds.h unconditionally.
# If this is tconfig.h or hconfig.h, include no more files.
-# Otherwise, include insn-constants.h, insn-flags.h, and insn-codes.h,
-# but only if GENERATOR_FILE is not defined. (The last of those is
-# slated to be removed.)
+# Otherwise, include insn-constants.h and insn-flags.h,
+# but only if GENERATOR_FILE is not defined.
case $output in
*tm_p.h)
echo "#include \"tm-preds.h\""
@@ -63,7 +62,6 @@ case $output in
*)
echo "#ifndef GENERATOR_FILE"
echo "# include \"insn-constants.h\""
- echo "# include \"insn-codes.h\""
echo "# include \"insn-flags.h\""
echo "#endif"
;;
diff --git a/gcc/optabs.c b/gcc/optabs.c
index fd75ba1..2855553 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -34,6 +34,8 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "except.h"
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
#include "recog.h"
#include "reload.h"
#include "ggc.h"
@@ -3738,7 +3740,7 @@ can_conditionally_move_p (mode)
#endif /* HAVE_conditional_move */
-/* These three functions generate an insn body and return it
+/* These functions generate an insn body and return it
rather than emitting the insn.
They do not protect from queued increments,
@@ -3764,6 +3766,26 @@ gen_add2_insn (x, y)
return (GEN_FCN (icode) (x, x, y));
}
+/* Generate and return an insn body to add r1 and c,
+ storing the result in r0. */
+rtx
+gen_add3_insn (r0, r1, c)
+ rtx r0, r1, c;
+{
+ int icode = (int) add_optab->handlers[(int) GET_MODE (r0)].insn_code;
+
+ if (icode == CODE_FOR_nothing
+ || ! ((*insn_data[icode].operand[0].predicate)
+ (r0, insn_data[icode].operand[0].mode))
+ || ! ((*insn_data[icode].operand[1].predicate)
+ (r1, insn_data[icode].operand[1].mode))
+ || ! ((*insn_data[icode].operand[2].predicate)
+ (c, insn_data[icode].operand[2].mode)))
+ return NULL_RTX;
+
+ return (GEN_FCN (icode) (r0, r1, c));
+}
+
int
have_add2_insn (x, y)
rtx x, y;
diff --git a/gcc/optabs.h b/gcc/optabs.h
new file mode 100644
index 0000000..2f249c1
--- /dev/null
+++ b/gcc/optabs.h
@@ -0,0 +1,355 @@
+/* Definitions for code generation pass of GNU compiler.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC 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 2, or (at your option)
+any later version.
+
+GNU CC 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 GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef GCC_OPTABS_H
+#define GCC_OPTABS_H
+
+#include "insn-codes.h"
+
+/* Optabs are tables saying how to generate insn bodies
+ for various machine modes and numbers of operands.
+ Each optab applies to one operation.
+ For example, add_optab applies to addition.
+
+ The insn_code slot is the enum insn_code that says how to
+ generate an insn for this operation on a particular machine mode.
+ It is CODE_FOR_nothing if there is no such insn on the target machine.
+
+ The `lib_call' slot is the name of the library function that
+ can be used to perform the operation.
+
+ A few optabs, such as move_optab and cmp_optab, are used
+ by special code. */
+
+typedef struct optab
+{
+ enum rtx_code code;
+ struct {
+ enum insn_code insn_code;
+ rtx libfunc;
+ } handlers [NUM_MACHINE_MODES];
+} * optab;
+
+/* Given an enum insn_code, access the function to construct
+ the body of that kind of insn. */
+#define GEN_FCN(CODE) (*insn_data[(int) (CODE)].genfun)
+
+/* Enumeration of valid indexes into optab_table. */
+enum optab_index
+{
+ OTI_add,
+ OTI_addv,
+ OTI_sub,
+ OTI_subv,
+
+ /* Signed and fp multiply */
+ OTI_smul,
+ OTI_smulv,
+ /* Signed multiply, return high word */
+ OTI_smul_highpart,
+ OTI_umul_highpart,
+ /* Signed multiply with result one machine mode wider than args */
+ OTI_smul_widen,
+ OTI_umul_widen,
+
+ /* Signed divide */
+ OTI_sdiv,
+ OTI_sdivv,
+ /* Signed divide-and-remainder in one */
+ OTI_sdivmod,
+ OTI_udiv,
+ OTI_udivmod,
+ /* Signed remainder */
+ OTI_smod,
+ OTI_umod,
+ /* Optab for floating divide. */
+ OTI_flodiv,
+ /* Convert float to integer in float fmt */
+ OTI_ftrunc,
+
+ /* Logical and */
+ OTI_and,
+ /* Logical or */
+ OTI_ior,
+ /* Logical xor */
+ OTI_xor,
+
+ /* Arithmetic shift left */
+ OTI_ashl,
+ /* Logical shift right */
+ OTI_lshr,
+ /* Arithmetic shift right */
+ OTI_ashr,
+ /* Rotate left */
+ OTI_rotl,
+ /* Rotate right */
+ OTI_rotr,
+ /* Signed and floating-point minimum value */
+ OTI_smin,
+ /* Signed and floating-point maximum value */
+ OTI_smax,
+ /* Unsigned minimum value */
+ OTI_umin,
+ /* Unsigned maximum value */
+ OTI_umax,
+
+ /* Move instruction. */
+ OTI_mov,
+ /* Move, preserving high part of register. */
+ OTI_movstrict,
+
+ /* Unary operations */
+ /* Negation */
+ OTI_neg,
+ OTI_negv,
+ /* Abs value */
+ OTI_abs,
+ OTI_absv,
+ /* Bitwise not */
+ OTI_one_cmpl,
+ /* Find first bit set */
+ OTI_ffs,
+ /* Square root */
+ OTI_sqrt,
+ /* Sine */
+ OTI_sin,
+ /* Cosine */
+ OTI_cos,
+
+ /* Compare insn; two operands. */
+ OTI_cmp,
+ /* Used only for libcalls for unsigned comparisons. */
+ OTI_ucmp,
+ /* tst insn; compare one operand against 0 */
+ OTI_tst,
+
+ /* String length */
+ OTI_strlen,
+
+ /* Combined compare & jump/store flags/move operations. */
+ OTI_cbranch,
+ OTI_cmov,
+ OTI_cstore,
+
+ /* Push instruction. */
+ OTI_push,
+
+ OTI_MAX
+};
+
+extern optab optab_table[OTI_MAX];
+
+#define add_optab (optab_table[OTI_add])
+#define sub_optab (optab_table[OTI_sub])
+#define smul_optab (optab_table[OTI_smul])
+#define addv_optab (optab_table[OTI_addv])
+#define subv_optab (optab_table[OTI_subv])
+#define smul_highpart_optab (optab_table[OTI_smul_highpart])
+#define umul_highpart_optab (optab_table[OTI_umul_highpart])
+#define smul_widen_optab (optab_table[OTI_smul_widen])
+#define umul_widen_optab (optab_table[OTI_umul_widen])
+#define sdiv_optab (optab_table[OTI_sdiv])
+#define smulv_optab (optab_table[OTI_smulv])
+#define sdivv_optab (optab_table[OTI_sdivv])
+#define sdivmod_optab (optab_table[OTI_sdivmod])
+#define udiv_optab (optab_table[OTI_udiv])
+#define udivmod_optab (optab_table[OTI_udivmod])
+#define smod_optab (optab_table[OTI_smod])
+#define umod_optab (optab_table[OTI_umod])
+#define flodiv_optab (optab_table[OTI_flodiv])
+#define ftrunc_optab (optab_table[OTI_ftrunc])
+#define and_optab (optab_table[OTI_and])
+#define ior_optab (optab_table[OTI_ior])
+#define xor_optab (optab_table[OTI_xor])
+#define ashl_optab (optab_table[OTI_ashl])
+#define lshr_optab (optab_table[OTI_lshr])
+#define ashr_optab (optab_table[OTI_ashr])
+#define rotl_optab (optab_table[OTI_rotl])
+#define rotr_optab (optab_table[OTI_rotr])
+#define smin_optab (optab_table[OTI_smin])
+#define smax_optab (optab_table[OTI_smax])
+#define umin_optab (optab_table[OTI_umin])
+#define umax_optab (optab_table[OTI_umax])
+
+#define mov_optab (optab_table[OTI_mov])
+#define movstrict_optab (optab_table[OTI_movstrict])
+
+#define neg_optab (optab_table[OTI_neg])
+#define negv_optab (optab_table[OTI_negv])
+#define abs_optab (optab_table[OTI_abs])
+#define absv_optab (optab_table[OTI_absv])
+#define one_cmpl_optab (optab_table[OTI_one_cmpl])
+#define ffs_optab (optab_table[OTI_ffs])
+#define sqrt_optab (optab_table[OTI_sqrt])
+#define sin_optab (optab_table[OTI_sin])
+#define cos_optab (optab_table[OTI_cos])
+
+#define cmp_optab (optab_table[OTI_cmp])
+#define ucmp_optab (optab_table[OTI_ucmp])
+#define tst_optab (optab_table[OTI_tst])
+
+#define strlen_optab (optab_table[OTI_strlen])
+
+#define cbranch_optab (optab_table[OTI_cbranch])
+#define cmov_optab (optab_table[OTI_cmov])
+#define cstore_optab (optab_table[OTI_cstore])
+#define push_optab (optab_table[OTI_push])
+
+/* Tables of patterns for extending one integer mode to another. */
+extern enum insn_code extendtab[MAX_MACHINE_MODE][MAX_MACHINE_MODE][2];
+
+/* Tables of patterns for converting between fixed and floating point. */
+extern enum insn_code fixtab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
+extern enum insn_code fixtrunctab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
+extern enum insn_code floattab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
+
+/* These arrays record the insn_code of insns that may be needed to
+ perform input and output reloads of special objects. They provide a
+ place to pass a scratch register. */
+extern enum insn_code reload_in_optab[NUM_MACHINE_MODES];
+extern enum insn_code reload_out_optab[NUM_MACHINE_MODES];
+
+/* Contains the optab used for each rtx code. */
+extern optab code_to_optab[NUM_RTX_CODE + 1];
+
+/* Passed to expand_binop and expand_unop to say which options to try to use
+ if the requested operation can't be open-coded on the requisite mode.
+ Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using a library call.
+ Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try using a wider mode.
+ OPTAB_MUST_WIDEN says try widening and don't try anything else. */
+
+enum optab_methods
+{
+ OPTAB_DIRECT,
+ OPTAB_LIB,
+ OPTAB_WIDEN,
+ OPTAB_LIB_WIDEN,
+ OPTAB_MUST_WIDEN
+};
+
+
+typedef rtx (*rtxfun) PARAMS ((rtx));
+
+/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
+ gives the gen_function to make a branch to test that condition. */
+
+extern rtxfun bcc_gen_fctn[NUM_RTX_CODE];
+
+/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
+ gives the insn code to make a store-condition insn
+ to test that condition. */
+
+extern enum insn_code setcc_gen_code[NUM_RTX_CODE];
+
+#ifdef HAVE_conditional_move
+/* Indexed by the machine mode, gives the insn code to make a conditional
+ move insn. */
+
+extern enum insn_code movcc_gen_code[NUM_MACHINE_MODES];
+#endif
+
+/* This array records the insn_code of insns to perform block moves. */
+extern enum insn_code movstr_optab[NUM_MACHINE_MODES];
+
+/* This array records the insn_code of insns to perform block clears. */
+extern enum insn_code clrstr_optab[NUM_MACHINE_MODES];
+
+/* Define functions given in optabs.c. */
+
+/* Expand a binary operation given optab and rtx operands. */
+extern rtx expand_binop PARAMS ((enum machine_mode, optab, rtx, rtx, rtx,
+ int, enum optab_methods));
+
+/* Expand a binary operation with both signed and unsigned forms. */
+extern rtx sign_expand_binop PARAMS ((enum machine_mode, optab, optab, rtx,
+ rtx, rtx, int, enum optab_methods));
+
+/* Generate code to perform an operation on two operands with two results. */
+extern int expand_twoval_binop PARAMS ((optab, rtx, rtx, rtx, rtx, int));
+
+/* Expand a unary arithmetic operation given optab rtx operand. */
+extern rtx expand_unop PARAMS ((enum machine_mode, optab, rtx, rtx, int));
+
+/* Expand the absolute value operation. */
+extern rtx expand_abs PARAMS ((enum machine_mode, rtx, rtx, int, int));
+
+/* Expand the complex absolute value operation. */
+extern rtx expand_complex_abs PARAMS ((enum machine_mode, rtx, rtx, int));
+
+/* Generate an instruction with a given INSN_CODE with an output and
+ an input. */
+extern void emit_unop_insn PARAMS ((int, rtx, rtx, enum rtx_code));
+
+/* Emit code to perform a series of operations on a multi-word quantity, one
+ word at a time. */
+extern rtx emit_no_conflict_block PARAMS ((rtx, rtx, rtx, rtx, rtx));
+
+/* Emit one rtl instruction to store zero in specified rtx. */
+extern void emit_clr_insn PARAMS ((rtx));
+
+/* Emit one rtl insn to store 1 in specified rtx assuming it contains 0. */
+extern void emit_0_to_1_insn PARAMS ((rtx));
+
+/* Emit one rtl insn to compare two rtx's. */
+extern void emit_cmp_insn PARAMS ((rtx, rtx, enum rtx_code, rtx,
+ enum machine_mode, int, unsigned int));
+
+/* The various uses that a comparison can have; used by can_compare_p:
+ jumps, conditional moves, store flag operations. */
+enum can_compare_purpose
+{
+ ccp_jump,
+ ccp_cmov,
+ ccp_store_flag
+};
+
+/* Nonzero if a compare of mode MODE can be done straightforwardly
+ (without splitting it into pieces). */
+extern int can_compare_p PARAMS ((enum rtx_code, enum machine_mode,
+ enum can_compare_purpose));
+
+extern void prepare_cmp_insn PARAMS ((rtx *, rtx *, enum rtx_code *, rtx,
+ enum machine_mode *, int *, int,
+ enum can_compare_purpose));
+
+extern rtx prepare_operand PARAMS ((int, rtx, int, enum machine_mode,
+ enum machine_mode, int));
+
+/* Return the INSN_CODE to use for an extend operation. */
+extern enum insn_code can_extend_p PARAMS ((enum machine_mode,
+ enum machine_mode, int));
+
+/* Generate the body of an insn to extend Y (with mode MFROM)
+ into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero. */
+extern rtx gen_extend_insn PARAMS ((rtx, rtx, enum machine_mode,
+ enum machine_mode, int));
+
+/* Initialize the tables that control conversion between fixed and
+ floating values. */
+extern void init_fixtab PARAMS ((void));
+extern void init_floattab PARAMS ((void));
+
+/* Generate code for a FLOAT_EXPR. */
+extern void expand_float PARAMS ((rtx, rtx, int));
+
+/* Generate code for a FIX_EXPR. */
+extern void expand_fix PARAMS ((rtx, rtx, int));
+
+#endif /* GCC_OPTABS_H */
diff --git a/gcc/profile.c b/gcc/profile.c
index 90327ca..39b259f 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -42,6 +42,7 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "regs.h"
#include "expr.h"
+#include "optabs.h"
#include "function.h"
#include "toplev.h"
#include "ggc.h"
diff --git a/gcc/recog.c b/gcc/recog.c
index 283713b..f2e046f 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. */
#include "recog.h"
#include "regs.h"
#include "expr.h"
+#include "insn-codes.h"
#include "function.h"
#include "flags.h"
#include "real.h"
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 484c391..de8e3e4 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -55,7 +55,6 @@ static int perhaps_ends_bb_p PARAMS ((rtx));
static int optimize_reg_copy_1 PARAMS ((rtx, rtx, rtx));
static void optimize_reg_copy_2 PARAMS ((rtx, rtx, rtx));
static void optimize_reg_copy_3 PARAMS ((rtx, rtx, rtx));
-static rtx gen_add3_insn PARAMS ((rtx, rtx, rtx));
static void copy_src_to_dest PARAMS ((rtx, rtx, rtx, int));
static int *regmove_bb_head;
@@ -94,27 +93,6 @@ regclass_compatible_p (class0, class1)
&& ! CLASS_LIKELY_SPILLED_P (class1)));
}
-/* Generate and return an insn body to add r1 and c,
- storing the result in r0. */
-static rtx
-gen_add3_insn (r0, r1, c)
- rtx r0, r1, c;
-{
- int icode = (int) add_optab->handlers[(int) GET_MODE (r0)].insn_code;
-
- if (icode == CODE_FOR_nothing
- || ! ((*insn_data[icode].operand[0].predicate)
- (r0, insn_data[icode].operand[0].mode))
- || ! ((*insn_data[icode].operand[1].predicate)
- (r1, insn_data[icode].operand[1].mode))
- || ! ((*insn_data[icode].operand[2].predicate)
- (c, insn_data[icode].operand[2].mode)))
- return NULL_RTX;
-
- return (GEN_FCN (icode) (r0, r1, c));
-}
-
-
/* INC_INSN is an instruction that adds INCREMENT to REG.
Try to fold INC_INSN as a post/pre in/decrement into INSN.
Iff INC_INSN_SET is nonzero, inc_insn has a destination different from src.
diff --git a/gcc/reload.c b/gcc/reload.c
index a569ab8..989c224 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -91,6 +91,8 @@ a register with any other reload. */
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
+#include "expr.h"
+#include "optabs.h"
#include "recog.h"
#include "reload.h"
#include "regs.h"
@@ -99,7 +101,6 @@ a register with any other reload. */
#include "real.h"
#include "output.h"
#include "function.h"
-#include "expr.h"
#include "toplev.h"
#ifndef REGISTER_MOVE_COST
diff --git a/gcc/reload.h b/gcc/reload.h
index 40af087..32ddfe5 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -82,7 +82,7 @@ enum reload_type
RELOAD_OTHER, RELOAD_FOR_OTHER_ADDRESS
};
-#ifdef MAX_INSN_CODE
+#ifdef GCC_INSN_CODES_H
/* Each reload is recorded with a structure like this. */
struct reload
{
@@ -192,14 +192,6 @@ extern char double_reg_address_ok;
extern int num_not_at_initial_offset;
-#ifdef MAX_INSN_CODE
-/* These arrays record the insn_code of insns that may be needed to
- perform input and output reloads of special objects. They provide a
- place to pass a scratch register. */
-extern enum insn_code reload_in_optab[];
-extern enum insn_code reload_out_optab[];
-#endif
-
struct needs
{
/* [0] is normal, [1] is nongroup. */
diff --git a/gcc/reload1.c b/gcc/reload1.c
index ded6943..02f4aa5 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
#include "regs.h"
#include "basic-block.h"
#include "reload.h"
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 08adde2..a29e485 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA. */
#include "recog.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
#include "toplev.h"
#include "output.h"
#include "ggc.h"
diff --git a/gcc/stmt.c b/gcc/stmt.c
index e9f044a..593fe4d 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -44,6 +44,8 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "insn-config.h"
#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
#include "hard-reg-set.h"
#include "obstack.h"
#include "loop.h"
diff --git a/gcc/unroll.c b/gcc/unroll.c
index c26a297..f888089 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -163,6 +163,7 @@ enum unroll_types
#include "flags.h"
#include "function.h"
#include "expr.h"
+#include "optabs.h"
#include "loop.h"
#include "toplev.h"
#include "hard-reg-set.h"