1991-11-24 20:57:16 +01:00
|
|
|
|
/* Generate code from machine description to recognize rtl as insns.
|
2000-02-26 14:55:09 +01:00
|
|
|
|
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1997, 1998,
|
2005-03-05 15:01:02 +01:00
|
|
|
|
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
This file is part of GCC.
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
GCC is free software; you can redistribute it and/or modify it
|
|
|
|
|
under the terms of the GNU General Public License as published by
|
1999-10-05 07:18:54 +02:00
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
|
|
|
License for more details.
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
2005-06-25 04:02:01 +02:00
|
|
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
|
02110-1301, USA. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* This program is used to produce insn-recog.c, which contains a
|
|
|
|
|
function called `recog' plus its subroutines. These functions
|
|
|
|
|
contain a decision tree that recognizes whether an rtx, the
|
|
|
|
|
argument given to recog, is a valid instruction.
|
|
|
|
|
|
|
|
|
|
recog returns -1 if the rtx is not valid. If the rtx is valid,
|
|
|
|
|
recog returns a nonnegative number which is the insn code number
|
|
|
|
|
for the pattern that matched. This is the same as the order in the
|
|
|
|
|
machine description of the entry that matched. This number can be
|
|
|
|
|
used as an index into various insn_* tables, such as insn_template,
|
|
|
|
|
insn_outfun, and insn_n_operands (found in insn-output.c).
|
|
|
|
|
|
|
|
|
|
The third argument to recog is an optional pointer to an int. If
|
|
|
|
|
present, recog will accept a pattern if it matches except for
|
1991-11-24 20:57:16 +01:00
|
|
|
|
missing CLOBBER expressions at the end. In that case, the value
|
|
|
|
|
pointed to by the optional pointer will be set to the number of
|
|
|
|
|
CLOBBERs that need to be added (it should be initialized to zero by
|
|
|
|
|
the caller). If it is set nonzero, the caller should allocate a
|
1999-10-05 07:18:54 +02:00
|
|
|
|
PARALLEL of the appropriate size, copy the initial entries, and
|
|
|
|
|
call add_clobbers (found in insn-emit.c) to fill in the CLOBBERs.
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
This program also generates the function `split_insns', which
|
|
|
|
|
returns 0 if the rtl could not be split, or it returns the split
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
rtl as an INSN list.
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
This program also generates the function `peephole2_insns', which
|
|
|
|
|
returns 0 if the rtl could not be matched. If there was a match,
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
the new rtl is returned in an INSN list, and LAST_INSN will point
|
1999-10-05 07:18:54 +02:00
|
|
|
|
to the last recognized insn in the old sequence. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
|
#include "bconfig.h"
|
Cutover various gen*.c files to using system.h:
* Makefile.in (genconfig.o, genflags.o, gencodes.o, genemit.o,
genopinit.o, genrecog.o, genextract.o, genpeep.o, genattr.o,
genattrtab.o, genoutput.o): Depend on system.h.
* genattr.c: Include system.h. Add arguments to various function
prototypes. Remove redundant prototype of read_rtx().
* genattrtab.c: Likewise.
* gencodes.c: Likewise.
* genconfig.c: Likewise.
* genemit.c: Likewise.
* genextract.c: Likewise.
* genflags.c: Likewise.
* genopinit.c: Likewise.
* genoutput.c: Likewise.
* genpeep.c: Likewise.
* genrecog.c: Likewise.
From-SVN: r18794
1998-03-24 11:16:53 +01:00
|
|
|
|
#include "system.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
|
#include "coretypes.h"
|
|
|
|
|
#include "tm.h"
|
1991-11-24 20:57:16 +01:00
|
|
|
|
#include "rtl.h"
|
errors.c: New file...
1999-08-27 00:27 -0700 Zack Weinberg <zack@bitmover.com>
* errors.c: New file; defines functions error, warning, and
fatal, variables have_error and progname.
* errors.h: New file; prototypes and decls for stuff in errors.c.
* Makefile: Add rules to build errors.o and
$(HOST_PREFIX)errors.o. Link genconfig, gencodes, genemit,
genopinit, genrecog, genextract, genpeep, genattr, and
genoutput with errors.o. Add errors.h to deps of genconfig.o,
gencodes.o, genemit.o, genopinit.o, genrecog.o, genextract.o,
genpeep.o, genattr.o, and genoutput.o.
* genconfig.c, gencodes.c, genemit.c, genopinit.c, genrecog.c,
genextract.c, genpeep.c, genattr.c: Include errors.h. Don't
define or prototype fatal. Set progname at beginning of main.
* genoutput.c: Likewise, and don't define or prototype error
either.
From-SVN: r28925
1999-08-27 09:47:17 +02:00
|
|
|
|
#include "errors.h"
|
2000-05-03 19:45:26 +02:00
|
|
|
|
#include "gensupport.h"
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-01-04 08:48:37 +01:00
|
|
|
|
#define OUTPUT_LABEL(INDENT_STRING, LABEL_NUMBER) \
|
|
|
|
|
printf("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (INDENT_STRING), (LABEL_NUMBER))
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* A listhead of decision trees. The alternatives to a node are kept
|
2003-01-17 15:24:24 +01:00
|
|
|
|
in a doubly-linked list so we can easily add nodes to the proper
|
1999-10-05 07:18:54 +02:00
|
|
|
|
place when merging. */
|
|
|
|
|
|
|
|
|
|
struct decision_head
|
|
|
|
|
{
|
|
|
|
|
struct decision *first;
|
|
|
|
|
struct decision *last;
|
|
|
|
|
};
|
2001-07-03 08:22:01 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* A single test. The two accept types aren't tests per-se, but
|
|
|
|
|
their equality (or lack thereof) does affect tree merging so
|
|
|
|
|
it is convenient to keep them here. */
|
|
|
|
|
|
|
|
|
|
struct decision_test
|
|
|
|
|
{
|
|
|
|
|
/* A linked list through the tests attached to a node. */
|
|
|
|
|
struct decision_test *next;
|
|
|
|
|
|
|
|
|
|
/* These types are roughly in the order in which we'd like to test them. */
|
2001-05-18 22:53:55 +02:00
|
|
|
|
enum decision_type
|
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
DT_num_insns,
|
2001-05-18 22:53:55 +02:00
|
|
|
|
DT_mode, DT_code, DT_veclen,
|
|
|
|
|
DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe,
|
2004-02-01 00:08:52 +01:00
|
|
|
|
DT_const_int,
|
2001-07-03 08:22:01 +02:00
|
|
|
|
DT_veclen_ge, DT_dup, DT_pred, DT_c_test,
|
2001-05-18 22:53:55 +02:00
|
|
|
|
DT_accept_op, DT_accept_insn
|
|
|
|
|
} type;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
int num_insns; /* Number if insn in a define_peephole2. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
enum machine_mode mode; /* Machine mode of node. */
|
|
|
|
|
RTX_CODE code; /* Code to test. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct
|
|
|
|
|
{
|
|
|
|
|
const char *name; /* Predicate to call. */
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
const struct pred_data *data;
|
|
|
|
|
/* Optimization hints for this predicate. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
enum machine_mode mode; /* Machine mode for node. */
|
|
|
|
|
} pred;
|
|
|
|
|
|
|
|
|
|
const char *c_test; /* Additional test to perform. */
|
|
|
|
|
int veclen; /* Length of vector. */
|
|
|
|
|
int dup; /* Number of operand to compare against. */
|
|
|
|
|
HOST_WIDE_INT intval; /* Value for XINT for XWINT. */
|
|
|
|
|
int opno; /* Operand number matched. */
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
int code_number; /* Insn number matched. */
|
1999-10-14 05:43:49 +02:00
|
|
|
|
int lineno; /* Line number of the insn. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
int num_clobbers_to_add; /* Number of CLOBBERs to be added. */
|
|
|
|
|
} insn;
|
|
|
|
|
} u;
|
|
|
|
|
};
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Data structure for decision tree for recognizing legitimate insns. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
struct decision
|
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision_head success; /* Nodes to test on success. */
|
|
|
|
|
struct decision *next; /* Node to test on failure. */
|
|
|
|
|
struct decision *prev; /* Node whose failure tests us. */
|
|
|
|
|
struct decision *afterward; /* Node to test on success,
|
|
|
|
|
but failure of successor nodes. */
|
|
|
|
|
|
|
|
|
|
const char *position; /* String denoting position in pattern. */
|
|
|
|
|
|
|
|
|
|
struct decision_test *tests; /* The tests for this node. */
|
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
int number; /* Node number, used for labels */
|
|
|
|
|
int subroutine_number; /* Number of subroutine this node starts */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
int need_label; /* Label needs to be output. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
};
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
#define SUBROUTINE_THRESHOLD 100
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
static int next_subroutine_number;
|
|
|
|
|
|
1999-08-31 22:37:09 +02:00
|
|
|
|
/* We can write three types of subroutines: One for insn recognition,
|
|
|
|
|
one to split insns, and one for peephole-type optimizations. This
|
|
|
|
|
defines which type is being written. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
enum routine_type {
|
|
|
|
|
RECOG, SPLIT, PEEPHOLE2
|
|
|
|
|
};
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
#define IS_SPLIT(X) ((X) != RECOG)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
/* Next available node number for tree nodes. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
static int next_number;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
/* Next number to use as an insn_code. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
static int next_insn_code;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
/* Record the highest depth we ever have so we know how many variables to
|
|
|
|
|
allocate in each subroutine we make. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
static int max_depth;
|
1999-10-14 05:43:49 +02:00
|
|
|
|
|
|
|
|
|
/* The line number of the start of the pattern currently being processed. */
|
|
|
|
|
static int pattern_lineno;
|
|
|
|
|
|
|
|
|
|
/* Count of errors. */
|
|
|
|
|
static int error_count;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
/* Predicate handling.
|
|
|
|
|
|
|
|
|
|
We construct from the machine description a table mapping each
|
|
|
|
|
predicate to a list of the rtl codes it can possibly match. The
|
|
|
|
|
function 'maybe_both_true' uses it to deduce that there are no
|
|
|
|
|
expressions that can be matches by certain pairs of tree nodes.
|
|
|
|
|
Also, if a predicate can match only one code, we can hardwire that
|
|
|
|
|
code into the node testing the predicate.
|
|
|
|
|
|
|
|
|
|
Some predicates are flagged as special. validate_pattern will not
|
|
|
|
|
warn about modeless match_operand expressions if they have a
|
|
|
|
|
special predicate. Predicates that allow only constants are also
|
|
|
|
|
treated as special, for this purpose.
|
|
|
|
|
|
|
|
|
|
validate_pattern will warn about predicates that allow non-lvalues
|
|
|
|
|
when they appear in destination operands.
|
|
|
|
|
|
|
|
|
|
Calculating the set of rtx codes that can possibly be accepted by a
|
|
|
|
|
predicate expression EXP requires a three-state logic: any given
|
|
|
|
|
subexpression may definitively accept a code C (Y), definitively
|
|
|
|
|
reject a code C (N), or may have an indeterminate effect (I). N
|
|
|
|
|
and I is N; Y or I is Y; Y and I, N or I are both I. Here are full
|
|
|
|
|
truth tables.
|
|
|
|
|
|
|
|
|
|
a b a&b a|b
|
|
|
|
|
Y Y Y Y
|
|
|
|
|
N Y N Y
|
|
|
|
|
N N N N
|
|
|
|
|
I Y I Y
|
|
|
|
|
I N N I
|
|
|
|
|
I I I I
|
|
|
|
|
|
|
|
|
|
We represent Y with 1, N with 0, I with 2. If any code is left in
|
|
|
|
|
an I state by the complete expression, we must assume that that
|
|
|
|
|
code can be accepted. */
|
|
|
|
|
|
|
|
|
|
#define N 0
|
|
|
|
|
#define Y 1
|
|
|
|
|
#define I 2
|
|
|
|
|
|
|
|
|
|
#define TRISTATE_AND(a,b) \
|
|
|
|
|
((a) == I ? ((b) == N ? N : I) : \
|
|
|
|
|
(b) == I ? ((a) == N ? N : I) : \
|
|
|
|
|
(a) && (b))
|
|
|
|
|
|
|
|
|
|
#define TRISTATE_OR(a,b) \
|
|
|
|
|
((a) == I ? ((b) == Y ? Y : I) : \
|
|
|
|
|
(b) == I ? ((a) == Y ? Y : I) : \
|
|
|
|
|
(a) || (b))
|
|
|
|
|
|
|
|
|
|
#define TRISTATE_NOT(a) \
|
|
|
|
|
((a) == I ? I : !(a))
|
|
|
|
|
|
2004-12-23 21:21:08 +01:00
|
|
|
|
/* 0 means no warning about that code yet, 1 means warned. */
|
|
|
|
|
static char did_you_mean_codes[NUM_RTX_CODE];
|
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
/* Recursively calculate the set of rtx codes accepted by the
|
|
|
|
|
predicate expression EXP, writing the result to CODES. */
|
|
|
|
|
static void
|
|
|
|
|
compute_predicate_codes (rtx exp, char codes[NUM_RTX_CODE])
|
|
|
|
|
{
|
|
|
|
|
char op0_codes[NUM_RTX_CODE];
|
|
|
|
|
char op1_codes[NUM_RTX_CODE];
|
|
|
|
|
char op2_codes[NUM_RTX_CODE];
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
switch (GET_CODE (exp))
|
|
|
|
|
{
|
|
|
|
|
case AND:
|
|
|
|
|
compute_predicate_codes (XEXP (exp, 0), op0_codes);
|
|
|
|
|
compute_predicate_codes (XEXP (exp, 1), op1_codes);
|
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
|
|
|
|
codes[i] = TRISTATE_AND (op0_codes[i], op1_codes[i]);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case IOR:
|
|
|
|
|
compute_predicate_codes (XEXP (exp, 0), op0_codes);
|
|
|
|
|
compute_predicate_codes (XEXP (exp, 1), op1_codes);
|
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
|
|
|
|
codes[i] = TRISTATE_OR (op0_codes[i], op1_codes[i]);
|
|
|
|
|
break;
|
|
|
|
|
case NOT:
|
|
|
|
|
compute_predicate_codes (XEXP (exp, 0), op0_codes);
|
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
2004-09-10 00:29:56 +02:00
|
|
|
|
codes[i] = TRISTATE_NOT (op0_codes[i]);
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case IF_THEN_ELSE:
|
|
|
|
|
/* a ? b : c accepts the same codes as (a & b) | (!a & c). */
|
|
|
|
|
compute_predicate_codes (XEXP (exp, 0), op0_codes);
|
|
|
|
|
compute_predicate_codes (XEXP (exp, 1), op1_codes);
|
|
|
|
|
compute_predicate_codes (XEXP (exp, 2), op2_codes);
|
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
|
|
|
|
codes[i] = TRISTATE_OR (TRISTATE_AND (op0_codes[i], op1_codes[i]),
|
|
|
|
|
TRISTATE_AND (TRISTATE_NOT (op0_codes[i]),
|
|
|
|
|
op2_codes[i]));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MATCH_CODE:
|
2006-01-23 16:16:19 +01:00
|
|
|
|
/* MATCH_CODE allows a specified list of codes. However, if it
|
|
|
|
|
does not apply to the top level of the expression, it does not
|
|
|
|
|
constrain the set of codes for the top level. */
|
|
|
|
|
if (XSTR (exp, 1)[0] != '\0')
|
|
|
|
|
{
|
|
|
|
|
memset (codes, Y, NUM_RTX_CODE);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
memset (codes, N, NUM_RTX_CODE);
|
|
|
|
|
{
|
|
|
|
|
const char *next_code = XSTR (exp, 0);
|
|
|
|
|
const char *code;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
if (*next_code == '\0')
|
|
|
|
|
{
|
|
|
|
|
message_with_line (pattern_lineno, "empty match_code expression");
|
|
|
|
|
error_count++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while ((code = scan_comma_elt (&next_code)) != 0)
|
|
|
|
|
{
|
|
|
|
|
size_t n = next_code - code;
|
2004-12-23 21:21:08 +01:00
|
|
|
|
int found_it = 0;
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
|
|
|
|
if (!strncmp (code, GET_RTX_NAME (i), n)
|
|
|
|
|
&& GET_RTX_NAME (i)[n] == '\0')
|
|
|
|
|
{
|
|
|
|
|
codes[i] = Y;
|
2004-12-23 21:21:08 +01:00
|
|
|
|
found_it = 1;
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
2004-12-23 21:21:08 +01:00
|
|
|
|
if (!found_it)
|
|
|
|
|
{
|
2004-12-28 08:56:09 +01:00
|
|
|
|
message_with_line (pattern_lineno, "match_code \"%.*s\" matches nothing",
|
|
|
|
|
(int) n, code);
|
2004-12-23 21:21:08 +01:00
|
|
|
|
error_count ++;
|
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
|
|
|
|
if (!strncasecmp (code, GET_RTX_NAME (i), n)
|
|
|
|
|
&& GET_RTX_NAME (i)[n] == '\0'
|
|
|
|
|
&& !did_you_mean_codes[i])
|
|
|
|
|
{
|
|
|
|
|
did_you_mean_codes[i] = 1;
|
|
|
|
|
message_with_line (pattern_lineno, "(did you mean \"%s\"?)", GET_RTX_NAME (i));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MATCH_OPERAND:
|
|
|
|
|
/* MATCH_OPERAND disallows the set of codes that the named predicate
|
|
|
|
|
disallows, and is indeterminate for the codes that it does allow. */
|
|
|
|
|
{
|
|
|
|
|
struct pred_data *p = lookup_predicate (XSTR (exp, 1));
|
|
|
|
|
if (!p)
|
|
|
|
|
{
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"reference to unknown predicate '%s'",
|
|
|
|
|
XSTR (exp, 1));
|
|
|
|
|
error_count++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
|
|
|
|
codes[i] = p->codes[i] ? I : N;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case MATCH_TEST:
|
|
|
|
|
/* (match_test WHATEVER) is completely indeterminate. */
|
|
|
|
|
memset (codes, I, NUM_RTX_CODE);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"'%s' cannot be used in a define_predicate expression",
|
|
|
|
|
GET_RTX_NAME (GET_CODE (exp)));
|
|
|
|
|
error_count++;
|
|
|
|
|
memset (codes, I, NUM_RTX_CODE);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef TRISTATE_OR
|
|
|
|
|
#undef TRISTATE_AND
|
|
|
|
|
#undef TRISTATE_NOT
|
|
|
|
|
|
|
|
|
|
/* Process a define_predicate expression: compute the set of predicates
|
|
|
|
|
that can be matched, and record this as a known predicate. */
|
|
|
|
|
static void
|
|
|
|
|
process_define_predicate (rtx desc)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
struct pred_data *pred = xcalloc (sizeof (struct pred_data), 1);
|
|
|
|
|
char codes[NUM_RTX_CODE];
|
|
|
|
|
bool seen_one = false;
|
|
|
|
|
int i;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
pred->name = XSTR (desc, 0);
|
|
|
|
|
if (GET_CODE (desc) == DEFINE_SPECIAL_PREDICATE)
|
|
|
|
|
pred->special = 1;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
compute_predicate_codes (XEXP (desc, 1), codes);
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
|
|
|
|
if (codes[i] != N)
|
|
|
|
|
{
|
|
|
|
|
pred->codes[i] = true;
|
|
|
|
|
if (GET_RTX_CLASS (i) != RTX_CONST_OBJ)
|
|
|
|
|
pred->allows_non_const = true;
|
|
|
|
|
if (i != REG
|
|
|
|
|
&& i != SUBREG
|
|
|
|
|
&& i != MEM
|
|
|
|
|
&& i != CONCAT
|
|
|
|
|
&& i != PARALLEL
|
|
|
|
|
&& i != STRICT_LOW_PART)
|
|
|
|
|
pred->allows_non_lvalue = true;
|
|
|
|
|
|
|
|
|
|
if (seen_one)
|
|
|
|
|
pred->singleton = UNKNOWN;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pred->singleton = i;
|
|
|
|
|
seen_one = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
add_predicate (pred);
|
|
|
|
|
}
|
|
|
|
|
#undef I
|
|
|
|
|
#undef N
|
|
|
|
|
#undef Y
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static struct decision *new_decision
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(const char *, struct decision_head *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static struct decision_test *new_decision_test
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(enum decision_type, struct decision_test ***);
|
1999-10-14 11:37:31 +02:00
|
|
|
|
static rtx find_operand
|
2004-02-07 18:53:44 +01:00
|
|
|
|
(rtx, int, rtx);
|
2000-12-10 20:50:53 +01:00
|
|
|
|
static rtx find_matching_operand
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(rtx, int);
|
1999-10-14 11:37:31 +02:00
|
|
|
|
static void validate_pattern
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(rtx, rtx, rtx, int);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static struct decision *add_to_sequence
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(rtx, struct decision_head *, const char *, enum routine_type, int);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
static int maybe_both_true_2
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_test *, struct decision_test *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static int maybe_both_true_1
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_test *, struct decision_test *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static int maybe_both_true
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, struct decision *, int);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
static int nodes_identical_1
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_test *, struct decision_test *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static int nodes_identical
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, struct decision *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void merge_accept_insn
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, struct decision *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void merge_trees
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *, struct decision_head *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
static void factor_tests
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void simplify_tests
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static int break_out_subroutines
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *, int);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void find_afterward
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *, struct decision *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
static void change_state
|
2005-08-27 04:08:29 +02:00
|
|
|
|
(const char *, const char *, const char *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void print_code
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(enum rtx_code);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void write_afterward
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, struct decision *, const char *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static struct decision *write_switch
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, int);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void write_cond
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_test *, int, enum routine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void write_action
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, struct decision_test *, int, int,
|
|
|
|
|
struct decision *, enum routine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static int is_unconditional
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_test *, enum routine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static int write_node
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, int, enum routine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void write_tree_1
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *, int, enum routine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void write_tree
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *, const char *, enum routine_type, int);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void write_subroutine
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *, enum routine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void write_subroutines
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *, enum routine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void write_header
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(void);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
static struct decision_head make_insn_sequence
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(rtx, enum routine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void process_tree
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_head *, enum routine_type);
|
2001-07-03 08:22:01 +02:00
|
|
|
|
|
1999-10-24 21:23:11 +02:00
|
|
|
|
static void debug_decision_0
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, int, int);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void debug_decision_1
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *, int);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void debug_decision_2
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision_test *);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
extern void debug_decision
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *);
|
1999-10-24 21:23:11 +02:00
|
|
|
|
extern void debug_decision_list
|
2003-06-01 17:59:10 +02:00
|
|
|
|
(struct decision *);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Create a new node in sequence after LAST. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static struct decision *
|
2003-06-01 17:59:10 +02:00
|
|
|
|
new_decision (const char *position, struct decision_head *last)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
2003-08-11 23:47:39 +02:00
|
|
|
|
struct decision *new = xcalloc (1, sizeof (struct decision));
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
new->success = *last;
|
|
|
|
|
new->position = xstrdup (position);
|
|
|
|
|
new->number = next_number++;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
last->first = last->last = new;
|
|
|
|
|
return new;
|
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Create a new test and link it in at PLACE. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static struct decision_test *
|
2003-06-01 17:59:10 +02:00
|
|
|
|
new_decision_test (enum decision_type type, struct decision_test ***pplace)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
struct decision_test **place = *pplace;
|
|
|
|
|
struct decision_test *test;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2006-01-31 20:56:55 +01:00
|
|
|
|
test = XNEW (struct decision_test);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test->next = *place;
|
|
|
|
|
test->type = type;
|
|
|
|
|
*place = test;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
place = &test->next;
|
|
|
|
|
*pplace = place;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return test;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
2004-02-07 18:53:44 +01:00
|
|
|
|
/* Search for and return operand N, stop when reaching node STOP. */
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
|
|
|
|
static rtx
|
2004-02-07 18:53:44 +01:00
|
|
|
|
find_operand (rtx pattern, int n, rtx stop)
|
1999-10-14 11:37:31 +02:00
|
|
|
|
{
|
|
|
|
|
const char *fmt;
|
|
|
|
|
RTX_CODE code;
|
|
|
|
|
int i, j, len;
|
|
|
|
|
rtx r;
|
|
|
|
|
|
2004-02-07 18:53:44 +01:00
|
|
|
|
if (pattern == stop)
|
|
|
|
|
return stop;
|
|
|
|
|
|
1999-10-14 11:37:31 +02:00
|
|
|
|
code = GET_CODE (pattern);
|
|
|
|
|
if ((code == MATCH_SCRATCH
|
|
|
|
|
|| code == MATCH_OPERAND
|
|
|
|
|
|| code == MATCH_OPERATOR
|
|
|
|
|
|| code == MATCH_PARALLEL)
|
|
|
|
|
&& XINT (pattern, 0) == n)
|
|
|
|
|
return pattern;
|
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
len = GET_RTX_LENGTH (code);
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
switch (fmt[i])
|
|
|
|
|
{
|
|
|
|
|
case 'e': case 'u':
|
2004-02-07 18:53:44 +01:00
|
|
|
|
if ((r = find_operand (XEXP (pattern, i), n, stop)) != NULL_RTX)
|
1999-10-14 11:37:31 +02:00
|
|
|
|
return r;
|
|
|
|
|
break;
|
|
|
|
|
|
2000-12-10 20:50:53 +01:00
|
|
|
|
case 'V':
|
|
|
|
|
if (! XVEC (pattern, i))
|
|
|
|
|
break;
|
2004-01-06 17:51:21 +01:00
|
|
|
|
/* Fall through. */
|
2000-12-10 20:50:53 +01:00
|
|
|
|
|
1999-10-14 11:37:31 +02:00
|
|
|
|
case 'E':
|
|
|
|
|
for (j = 0; j < XVECLEN (pattern, i); j++)
|
2004-02-07 18:53:44 +01:00
|
|
|
|
if ((r = find_operand (XVECEXP (pattern, i, j), n, stop))
|
|
|
|
|
!= NULL_RTX)
|
1999-10-14 11:37:31 +02:00
|
|
|
|
return r;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'i': case 'w': case '0': case 's':
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1999-10-14 11:37:31 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-10 20:50:53 +01:00
|
|
|
|
/* Search for and return operand M, such that it has a matching
|
|
|
|
|
constraint for operand N. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 17:59:10 +02:00
|
|
|
|
find_matching_operand (rtx pattern, int n)
|
2000-12-10 20:50:53 +01:00
|
|
|
|
{
|
|
|
|
|
const char *fmt;
|
|
|
|
|
RTX_CODE code;
|
|
|
|
|
int i, j, len;
|
|
|
|
|
rtx r;
|
|
|
|
|
|
|
|
|
|
code = GET_CODE (pattern);
|
|
|
|
|
if (code == MATCH_OPERAND
|
|
|
|
|
&& (XSTR (pattern, 2)[0] == '0' + n
|
|
|
|
|
|| (XSTR (pattern, 2)[0] == '%'
|
|
|
|
|
&& XSTR (pattern, 2)[1] == '0' + n)))
|
|
|
|
|
return pattern;
|
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
len = GET_RTX_LENGTH (code);
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
switch (fmt[i])
|
|
|
|
|
{
|
|
|
|
|
case 'e': case 'u':
|
|
|
|
|
if ((r = find_matching_operand (XEXP (pattern, i), n)))
|
|
|
|
|
return r;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'V':
|
|
|
|
|
if (! XVEC (pattern, i))
|
|
|
|
|
break;
|
2004-01-06 17:51:21 +01:00
|
|
|
|
/* Fall through. */
|
2000-12-10 20:50:53 +01:00
|
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
|
for (j = 0; j < XVECLEN (pattern, i); j++)
|
|
|
|
|
if ((r = find_matching_operand (XVECEXP (pattern, i, j), n)))
|
|
|
|
|
return r;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'i': case 'w': case '0': case 's':
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
2000-12-10 20:50:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1999-10-15 08:56:28 +02:00
|
|
|
|
/* Check for various errors in patterns. SET is nonnull for a destination,
|
2000-12-09 23:06:52 +01:00
|
|
|
|
and is the complete set pattern. SET_CODE is '=' for normal sets, and
|
|
|
|
|
'+' within a context that requires in-out constraints. */
|
1999-10-14 05:43:49 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
|
1999-10-14 05:43:49 +02:00
|
|
|
|
{
|
|
|
|
|
const char *fmt;
|
|
|
|
|
RTX_CODE code;
|
1999-10-14 11:37:31 +02:00
|
|
|
|
size_t i, len;
|
|
|
|
|
int j;
|
1999-10-14 05:43:49 +02:00
|
|
|
|
|
|
|
|
|
code = GET_CODE (pattern);
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case MATCH_SCRATCH:
|
|
|
|
|
return;
|
2004-02-07 18:53:44 +01:00
|
|
|
|
case MATCH_DUP:
|
|
|
|
|
case MATCH_OP_DUP:
|
|
|
|
|
case MATCH_PAR_DUP:
|
|
|
|
|
if (find_operand (insn, XINT (pattern, 0), pattern) == pattern)
|
|
|
|
|
{
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"operand %i duplicated before defined",
|
|
|
|
|
XINT (pattern, 0));
|
|
|
|
|
error_count++;
|
|
|
|
|
}
|
|
|
|
|
break;
|
1999-10-14 05:43:49 +02:00
|
|
|
|
case MATCH_OPERAND:
|
1999-10-14 11:37:31 +02:00
|
|
|
|
case MATCH_OPERATOR:
|
1999-10-14 05:43:49 +02:00
|
|
|
|
{
|
|
|
|
|
const char *pred_name = XSTR (pattern, 1);
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
const struct pred_data *pred;
|
1999-10-14 11:37:31 +02:00
|
|
|
|
const char *c_test;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (insn) == DEFINE_INSN)
|
|
|
|
|
c_test = XSTR (insn, 2);
|
|
|
|
|
else
|
|
|
|
|
c_test = XSTR (insn, 1);
|
1999-10-14 05:43:49 +02:00
|
|
|
|
|
|
|
|
|
if (pred_name[0] != 0)
|
|
|
|
|
{
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
pred = lookup_predicate (pred_name);
|
|
|
|
|
if (!pred)
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"warning: unknown predicate '%s'",
|
|
|
|
|
pred_name);
|
1999-10-14 11:37:31 +02:00
|
|
|
|
}
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
else
|
|
|
|
|
pred = 0;
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
2001-07-06 22:39:56 +02:00
|
|
|
|
if (code == MATCH_OPERAND)
|
1999-10-15 08:56:28 +02:00
|
|
|
|
{
|
2001-07-06 22:39:56 +02:00
|
|
|
|
const char constraints0 = XSTR (pattern, 2)[0];
|
|
|
|
|
|
2003-06-01 17:59:10 +02:00
|
|
|
|
/* In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we
|
2001-07-06 22:39:56 +02:00
|
|
|
|
don't use the MATCH_OPERAND constraint, only the predicate.
|
|
|
|
|
This is confusing to folks doing new ports, so help them
|
|
|
|
|
not make the mistake. */
|
|
|
|
|
if (GET_CODE (insn) == DEFINE_EXPAND
|
|
|
|
|
|| GET_CODE (insn) == DEFINE_SPLIT
|
|
|
|
|
|| GET_CODE (insn) == DEFINE_PEEPHOLE2)
|
2000-12-09 23:06:52 +01:00
|
|
|
|
{
|
2001-07-06 22:39:56 +02:00
|
|
|
|
if (constraints0)
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"warning: constraints not supported in %s",
|
|
|
|
|
rtx_name[GET_CODE (insn)]);
|
|
|
|
|
}
|
2003-06-01 17:59:10 +02:00
|
|
|
|
|
2001-07-06 22:39:56 +02:00
|
|
|
|
/* A MATCH_OPERAND that is a SET should have an output reload. */
|
|
|
|
|
else if (set && constraints0)
|
|
|
|
|
{
|
|
|
|
|
if (set_code == '+')
|
|
|
|
|
{
|
|
|
|
|
if (constraints0 == '+')
|
|
|
|
|
;
|
|
|
|
|
/* If we've only got an output reload for this operand,
|
|
|
|
|
we'd better have a matching input operand. */
|
|
|
|
|
else if (constraints0 == '='
|
|
|
|
|
&& find_matching_operand (insn, XINT (pattern, 0)))
|
|
|
|
|
;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"operand %d missing in-out reload",
|
|
|
|
|
XINT (pattern, 0));
|
|
|
|
|
error_count++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (constraints0 != '=' && constraints0 != '+')
|
2000-12-10 20:50:53 +01:00
|
|
|
|
{
|
|
|
|
|
message_with_line (pattern_lineno,
|
2003-06-01 17:59:10 +02:00
|
|
|
|
"operand %d missing output reload",
|
2000-12-10 20:50:53 +01:00
|
|
|
|
XINT (pattern, 0));
|
|
|
|
|
error_count++;
|
|
|
|
|
}
|
2000-12-09 23:06:52 +01:00
|
|
|
|
}
|
1999-10-15 08:56:28 +02:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-14 11:37:31 +02:00
|
|
|
|
/* Allowing non-lvalues in destinations -- particularly CONST_INT --
|
|
|
|
|
while not likely to occur at runtime, results in less efficient
|
|
|
|
|
code from insn-recog.c. */
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
if (set && pred && pred->allows_non_lvalue)
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"warning: destination operand %d "
|
|
|
|
|
"allows non-lvalue",
|
|
|
|
|
XINT (pattern, 0));
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
/* A modeless MATCH_OPERAND can be handy when we can check for
|
|
|
|
|
multiple modes in the c_test. In most other cases, it is a
|
|
|
|
|
mistake. Only DEFINE_INSN is eligible, since SPLIT and
|
|
|
|
|
PEEP2 can FAIL within the output pattern. Exclude special
|
|
|
|
|
predicates, which check the mode themselves. Also exclude
|
|
|
|
|
predicates that allow only constants. Exclude the SET_DEST
|
|
|
|
|
of a call instruction, as that is a common idiom. */
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
|
|
|
|
if (GET_MODE (pattern) == VOIDmode
|
|
|
|
|
&& code == MATCH_OPERAND
|
1999-10-15 03:52:29 +02:00
|
|
|
|
&& GET_CODE (insn) == DEFINE_INSN
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
&& pred
|
|
|
|
|
&& !pred->special
|
|
|
|
|
&& pred->allows_non_const
|
1999-10-15 08:56:28 +02:00
|
|
|
|
&& strstr (c_test, "operands") == NULL
|
|
|
|
|
&& ! (set
|
|
|
|
|
&& GET_CODE (set) == SET
|
|
|
|
|
&& GET_CODE (SET_SRC (set)) == CALL))
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"warning: operand %d missing mode?",
|
|
|
|
|
XINT (pattern, 0));
|
1999-10-14 05:43:49 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case SET:
|
1999-10-14 11:37:31 +02:00
|
|
|
|
{
|
|
|
|
|
enum machine_mode dmode, smode;
|
|
|
|
|
rtx dest, src;
|
|
|
|
|
|
|
|
|
|
dest = SET_DEST (pattern);
|
|
|
|
|
src = SET_SRC (pattern);
|
|
|
|
|
|
2001-07-06 22:39:56 +02:00
|
|
|
|
/* STRICT_LOW_PART is a wrapper. Its argument is the real
|
|
|
|
|
destination, and it's mode should match the source. */
|
|
|
|
|
if (GET_CODE (dest) == STRICT_LOW_PART)
|
|
|
|
|
dest = XEXP (dest, 0);
|
|
|
|
|
|
2003-11-21 07:52:23 +01:00
|
|
|
|
/* Find the referent for a DUP. */
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (dest) == MATCH_DUP
|
|
|
|
|
|| GET_CODE (dest) == MATCH_OP_DUP
|
|
|
|
|
|| GET_CODE (dest) == MATCH_PAR_DUP)
|
2004-02-07 18:53:44 +01:00
|
|
|
|
dest = find_operand (insn, XINT (dest, 0), NULL);
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (src) == MATCH_DUP
|
|
|
|
|
|| GET_CODE (src) == MATCH_OP_DUP
|
|
|
|
|
|| GET_CODE (src) == MATCH_PAR_DUP)
|
2004-02-07 18:53:44 +01:00
|
|
|
|
src = find_operand (insn, XINT (src, 0), NULL);
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
|
|
|
|
dmode = GET_MODE (dest);
|
|
|
|
|
smode = GET_MODE (src);
|
1999-10-14 05:43:49 +02:00
|
|
|
|
|
1999-10-14 11:37:31 +02:00
|
|
|
|
/* The mode of an ADDRESS_OPERAND is the mode of the memory
|
|
|
|
|
reference, not the mode of the address. */
|
|
|
|
|
if (GET_CODE (src) == MATCH_OPERAND
|
|
|
|
|
&& ! strcmp (XSTR (src, 1), "address_operand"))
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
/* The operands of a SET must have the same mode unless one
|
|
|
|
|
is VOIDmode. */
|
|
|
|
|
else if (dmode != VOIDmode && smode != VOIDmode && dmode != smode)
|
|
|
|
|
{
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"mode mismatch in set: %smode vs %smode",
|
|
|
|
|
GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
|
|
|
|
|
error_count++;
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-03 08:22:01 +02:00
|
|
|
|
/* If only one of the operands is VOIDmode, and PC or CC0 is
|
1999-10-14 11:37:31 +02:00
|
|
|
|
not involved, it's probably a mistake. */
|
|
|
|
|
else if (dmode != smode
|
|
|
|
|
&& GET_CODE (dest) != PC
|
|
|
|
|
&& GET_CODE (dest) != CC0
|
1999-10-15 08:56:28 +02:00
|
|
|
|
&& GET_CODE (src) != PC
|
|
|
|
|
&& GET_CODE (src) != CC0
|
1999-10-14 11:37:31 +02:00
|
|
|
|
&& GET_CODE (src) != CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
const char *which;
|
|
|
|
|
which = (dmode == VOIDmode ? "destination" : "source");
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"warning: %s missing a mode?", which);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dest != SET_DEST (pattern))
|
2000-12-09 23:06:52 +01:00
|
|
|
|
validate_pattern (dest, insn, pattern, '=');
|
|
|
|
|
validate_pattern (SET_DEST (pattern), insn, pattern, '=');
|
|
|
|
|
validate_pattern (SET_SRC (pattern), insn, NULL_RTX, 0);
|
1999-10-14 11:37:31 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case CLOBBER:
|
2000-12-09 23:06:52 +01:00
|
|
|
|
validate_pattern (SET_DEST (pattern), insn, pattern, '=');
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case ZERO_EXTRACT:
|
|
|
|
|
validate_pattern (XEXP (pattern, 0), insn, set, set ? '+' : 0);
|
|
|
|
|
validate_pattern (XEXP (pattern, 1), insn, NULL_RTX, 0);
|
|
|
|
|
validate_pattern (XEXP (pattern, 2), insn, NULL_RTX, 0);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case STRICT_LOW_PART:
|
|
|
|
|
validate_pattern (XEXP (pattern, 0), insn, set, set ? '+' : 0);
|
1999-10-14 05:43:49 +02:00
|
|
|
|
return;
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
1999-10-14 05:43:49 +02:00
|
|
|
|
case LABEL_REF:
|
|
|
|
|
if (GET_MODE (XEXP (pattern, 0)) != VOIDmode)
|
|
|
|
|
{
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"operand to label_ref %smode not VOIDmode",
|
|
|
|
|
GET_MODE_NAME (GET_MODE (XEXP (pattern, 0))));
|
|
|
|
|
error_count++;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
len = GET_RTX_LENGTH (code);
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
switch (fmt[i])
|
|
|
|
|
{
|
|
|
|
|
case 'e': case 'u':
|
2000-12-09 23:06:52 +01:00
|
|
|
|
validate_pattern (XEXP (pattern, i), insn, NULL_RTX, 0);
|
1999-10-14 05:43:49 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
|
for (j = 0; j < XVECLEN (pattern, i); j++)
|
2000-12-09 23:06:52 +01:00
|
|
|
|
validate_pattern (XVECEXP (pattern, i, j), insn, NULL_RTX, 0);
|
1999-10-14 05:43:49 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'i': case 'w': case '0': case 's':
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1999-10-14 05:43:49 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
/* Create a chain of nodes to verify that an rtl expression matches
|
|
|
|
|
PATTERN.
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
LAST is a pointer to the listhead in the previous node in the chain (or
|
|
|
|
|
in the calling function, for the first node).
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
POSITION is the string representing the current position in the insn.
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-08-31 22:37:09 +02:00
|
|
|
|
INSN_TYPE is the type of insn for which we are emitting code.
|
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
A pointer to the final node in the chain is returned. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
static struct decision *
|
2003-06-01 17:59:10 +02:00
|
|
|
|
add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
|
|
|
|
|
enum routine_type insn_type, int top)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
RTX_CODE code;
|
|
|
|
|
struct decision *this, *sub;
|
|
|
|
|
struct decision_test *test;
|
|
|
|
|
struct decision_test **place;
|
|
|
|
|
char *subpos;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
size_t i;
|
|
|
|
|
const char *fmt;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
int depth = strlen (position);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
int len;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
enum machine_mode mode;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
if (depth > max_depth)
|
|
|
|
|
max_depth = depth;
|
|
|
|
|
|
2003-07-19 16:47:15 +02:00
|
|
|
|
subpos = xmalloc (depth + 2);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
strcpy (subpos, position);
|
|
|
|
|
subpos[depth + 1] = 0;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
sub = this = new_decision (position, last);
|
|
|
|
|
place = &this->tests;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
restart:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
mode = GET_MODE (pattern);
|
|
|
|
|
code = GET_CODE (pattern);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
1999-08-31 22:37:09 +02:00
|
|
|
|
case PARALLEL:
|
2001-08-13 01:40:53 +02:00
|
|
|
|
/* Toplevel peephole pattern. */
|
1999-08-31 22:37:09 +02:00
|
|
|
|
if (insn_type == PEEPHOLE2 && top)
|
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
int num_insns;
|
|
|
|
|
|
|
|
|
|
/* Check we have sufficient insns. This avoids complications
|
|
|
|
|
because we then know peep2_next_insn never fails. */
|
|
|
|
|
num_insns = XVECLEN (pattern, 0);
|
|
|
|
|
if (num_insns > 1)
|
|
|
|
|
{
|
|
|
|
|
test = new_decision_test (DT_num_insns, &place);
|
|
|
|
|
test->u.num_insns = num_insns;
|
|
|
|
|
last = &sub->success;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* We don't need the node we just created -- unlink it. */
|
|
|
|
|
last->first = last->last = NULL;
|
|
|
|
|
}
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < (size_t) XVECLEN (pattern, 0); i++)
|
|
|
|
|
{
|
|
|
|
|
/* Which insn we're looking at is represented by A-Z. We don't
|
2001-08-13 01:40:53 +02:00
|
|
|
|
ever use 'A', however; it is always implied. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
subpos[depth] = (i > 0 ? 'A' + i : 0);
|
|
|
|
|
sub = add_to_sequence (XVECEXP (pattern, 0, i),
|
|
|
|
|
last, subpos, insn_type, 0);
|
|
|
|
|
last = &sub->success;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New.
libiberty:
* aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New.
* configure.in: Replace all alloca logic with a simple use of
the above new macro.
* config.table: Kill *-*-beos* entry.
* config/mh-beos: Delete.
* configure, config.in: Regenerate.
* Makefile.in (ALLOCA, HFILES): Kill.
(REQUIRED_OFILES): Add alloca.o.
(alloca.o): Depend on libiberty.h.
(argv.o): Don't depend on alloca-conf.h.
* alloca-conf.h: Delete.
* alloca.c: Include libiberty.h. Kill all #ifdef emacs
blocks. Provide the C alloca unconditionally. Use PTR where
appropriate. Make i00afunc static.
* argv.c: Don't include alloca-conf.h.
include:
* libiberty.h: Prototype C_alloca; define alloca to either
__builtin_alloca or C_alloca as appropriate.
gcc:
* aclocal.m4 (AM_GNU_GETTEXT): Don't AC_REQUIRE
AC_FUNC_ALLOCA.
* configure, config.in: Regenerate.
* config.gcc: Remove references to deleted files.
* genattr.c, genattrtab.c, genextract.c, genoutput.c,
genrecog.c, rtl.c: Do not use alloca anywhere.
* Makefile.in, build-make, system.h, config/x-interix,
config/x-svr4, config/xm-interix.h, config/xm-openbsd.h,
config/alpha/xm-alpha.h, config/alpha/xm-vms.h,
config/arc/xm-arc.h, config/arm/xm-arm.h,
config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h,
config/h8300/xm-h8300.h, config/i370/x-oe,
config/i370/xm-linux.h, config/i386/x-aix, config/i386/x-beos,
config/i386/x-ncr3000, config/i386/x-sco5,
config/i386/xm-dgux.h, config/i860/x-sysv4,
config/i960/xm-i960.h, config/m32r/xm-m32r.h,
config/m68k/x-crds, config/m68k/x-dpx2, config/m68k/x-hp320,
config/m68k/x-hp320g, config/m69k/x-mot3300,
config/m68k/x-mot3300-gas, config/m68k/xm-amix.h,
config/m68k/xm-hp320.h, config/m68k/xm-m68kv.h,
config/m68k/xm-mot3300.h, config/m88k/x-dolph,
config/m88k/x-sysv4, config/m88k/x-tekXD88,
config/m88k/xm-m88k.h, config/mcore/xm-mcore.h,
config/mips/x-iris, config/mips/x-iris3,
config/mips/x-sni-svr4, config/mips/x-sysv,
config/mips/xm-iris6.h, config/mips/xm-mips.h,
config/mips/xm-nws3250v4.h, config/pa/x-hpux,
config/pa/x-pa-mpeix, config/pa/xm-pa.h,
config/pa/xm-pa64hpux.h, config/pa/xm-pahpux.h,
config/pa/xm-papro.h, config/romp/xm-romp.h,
config/rs6000/x-aix31, config/rs6000/x-aix41,
config/rs6000/x-beos, config/rs6000/x-lynx,
config/rs6000/x-mach, config/rs6000/x-rs6000,
config/rs6000/x-sysv4, config/rs6000/xm-rs6000.h,
config/rs6000/xm-sysv4.h, config/sh/xm-sh.h,
config/sparc/x-sysv4, config/sparc/xm-linux.h,
config/sparc/xm-pbd.h, config/sparc/xm-sparc.h,
config/vax/xm-vms.h: Eradicate all references to alloca and
related stuff.
* config/xm-alloca.h, config/clipper/x-clix,
config/i386/xm-sysv4.h, config/i860/x-fx2800,
config/i860/x-sysv3, config/m88k/x-sysv3,
config/sparc/xm-sol2.h, config/we32k/x-we32k: Delete
(contained only alloca related hacks).
* config/i386/xm-beos.h, config/rs6000/xm-beos.h: Just define
USE_C_ALLOCA.
From-SVN: r40259
2001-03-06 10:52:35 +01:00
|
|
|
|
goto ret;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
/* Else nothing special. */
|
1999-08-31 22:37:09 +02:00
|
|
|
|
break;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
2001-01-14 21:35:06 +01:00
|
|
|
|
case MATCH_PARALLEL:
|
|
|
|
|
/* The explicit patterns within a match_parallel enforce a minimum
|
|
|
|
|
length on the vector. The match_parallel predicate may allow
|
|
|
|
|
for more elements. We do need to check for this minimum here
|
|
|
|
|
or the code generated to match the internals may reference data
|
|
|
|
|
beyond the end of the vector. */
|
|
|
|
|
test = new_decision_test (DT_veclen_ge, &place);
|
|
|
|
|
test->u.veclen = XVECLEN (pattern, 2);
|
2004-01-06 17:51:21 +01:00
|
|
|
|
/* Fall through. */
|
2001-01-14 21:35:06 +01:00
|
|
|
|
|
1991-11-24 20:57:16 +01:00
|
|
|
|
case MATCH_OPERAND:
|
|
|
|
|
case MATCH_SCRATCH:
|
|
|
|
|
case MATCH_OPERATOR:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
RTX_CODE was_code = code;
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
const char *pred_name;
|
|
|
|
|
bool allows_const_int = true;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
if (code == MATCH_SCRATCH)
|
|
|
|
|
{
|
|
|
|
|
pred_name = "scratch_operand";
|
|
|
|
|
code = UNKNOWN;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pred_name = XSTR (pattern, 1);
|
|
|
|
|
if (code == MATCH_PARALLEL)
|
|
|
|
|
code = PARALLEL;
|
|
|
|
|
else
|
|
|
|
|
code = UNKNOWN;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-15 14:50:32 +01:00
|
|
|
|
if (pred_name[0] != 0)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
const struct pred_data *pred;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test = new_decision_test (DT_pred, &place);
|
|
|
|
|
test->u.pred.name = pred_name;
|
|
|
|
|
test->u.pred.mode = mode;
|
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
/* See if we know about this predicate.
|
|
|
|
|
If we do, remember it for use below.
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
We can optimize the generated code a little if either
|
|
|
|
|
(a) the predicate only accepts one code, or (b) the
|
|
|
|
|
predicate does not allow CONST_INT, in which case it
|
|
|
|
|
can match only if the modes match. */
|
|
|
|
|
pred = lookup_predicate (pred_name);
|
|
|
|
|
if (pred)
|
1993-09-19 18:50:43 +02:00
|
|
|
|
{
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
test->u.pred.data = pred;
|
|
|
|
|
allows_const_int = pred->codes[CONST_INT];
|
2004-08-13 08:36:21 +02:00
|
|
|
|
if (was_code == MATCH_PARALLEL
|
|
|
|
|
&& pred->singleton != PARALLEL)
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"predicate '%s' used in match_parallel "
|
|
|
|
|
"does not allow only PARALLEL", pred->name);
|
|
|
|
|
else
|
|
|
|
|
code = pred->singleton;
|
1993-09-19 18:50:43 +02:00
|
|
|
|
}
|
2004-08-13 08:36:21 +02:00
|
|
|
|
else
|
|
|
|
|
message_with_line (pattern_lineno,
|
|
|
|
|
"warning: unknown predicate '%s' in '%s' expression",
|
|
|
|
|
pred_name, GET_RTX_NAME (was_code));
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
1999-10-10 11:43:26 +02:00
|
|
|
|
|
|
|
|
|
/* Can't enforce a mode if we allow const_int. */
|
|
|
|
|
if (allows_const_int)
|
|
|
|
|
mode = VOIDmode;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
bb-reorder.c, [...]: Fix comment typos.
* bb-reorder.c, c-common.c, c-incpath.c, c-typeck.c,
genrecog.c, lambda-code.c, mips-tdump.c, mips-tfile.c,
passes.c, tree-data-ref.c, tree-data-ref.h, tree-mudflap.c,
tree-scalar-evolution.c, tree-ssa-copyrename.c,
tree-ssa-live.c, tree-ssa-live.h: Fix comment typos.
From-SVN: r87302
2004-09-10 17:09:39 +02:00
|
|
|
|
/* Accept the operand, i.e. record it in `operands'. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test = new_decision_test (DT_accept_op, &place);
|
|
|
|
|
test->u.opno = XINT (pattern, 0);
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (was_code == MATCH_OPERATOR || was_code == MATCH_PARALLEL)
|
|
|
|
|
{
|
|
|
|
|
char base = (was_code == MATCH_OPERATOR ? '0' : 'a');
|
|
|
|
|
for (i = 0; i < (size_t) XVECLEN (pattern, 2); i++)
|
|
|
|
|
{
|
|
|
|
|
subpos[depth] = i + base;
|
|
|
|
|
sub = add_to_sequence (XVECEXP (pattern, 2, i),
|
|
|
|
|
&sub->success, subpos, insn_type, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
goto fini;
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
case MATCH_OP_DUP:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
code = UNKNOWN;
|
|
|
|
|
|
|
|
|
|
test = new_decision_test (DT_dup, &place);
|
|
|
|
|
test->u.dup = XINT (pattern, 0);
|
|
|
|
|
|
|
|
|
|
test = new_decision_test (DT_accept_op, &place);
|
|
|
|
|
test->u.opno = XINT (pattern, 0);
|
|
|
|
|
|
1998-10-14 11:02:55 +02:00
|
|
|
|
for (i = 0; i < (size_t) XVECLEN (pattern, 1); i++)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
subpos[depth] = i + '0';
|
|
|
|
|
sub = add_to_sequence (XVECEXP (pattern, 1, i),
|
|
|
|
|
&sub->success, subpos, insn_type, 0);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
goto fini;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
case MATCH_DUP:
|
1992-08-14 20:44:28 +02:00
|
|
|
|
case MATCH_PAR_DUP:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
code = UNKNOWN;
|
|
|
|
|
|
|
|
|
|
test = new_decision_test (DT_dup, &place);
|
|
|
|
|
test->u.dup = XINT (pattern, 0);
|
|
|
|
|
goto fini;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
case ADDRESS:
|
|
|
|
|
pattern = XEXP (pattern, 0);
|
|
|
|
|
goto restart;
|
|
|
|
|
|
1998-01-29 00:25:15 +01:00
|
|
|
|
default:
|
|
|
|
|
break;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
len = GET_RTX_LENGTH (code);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
/* Do tests against the current node first. */
|
1998-10-14 11:02:55 +02:00
|
|
|
|
for (i = 0; i < (size_t) len; i++)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (fmt[i] == 'i')
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (i < 2);
|
|
|
|
|
|
|
|
|
|
if (!i)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
test = new_decision_test (DT_elt_zero_int, &place);
|
|
|
|
|
test->u.intval = XINT (pattern, i);
|
|
|
|
|
}
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
else
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
test = new_decision_test (DT_elt_one_int, &place);
|
|
|
|
|
test->u.intval = XINT (pattern, i);
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
else if (fmt[i] == 'w')
|
1992-07-06 22:02:55 +02:00
|
|
|
|
{
|
2001-05-18 22:53:55 +02:00
|
|
|
|
/* If this value actually fits in an int, we can use a switch
|
|
|
|
|
statement here, so indicate that. */
|
|
|
|
|
enum decision_type type
|
|
|
|
|
= ((int) XWINT (pattern, i) == XWINT (pattern, i))
|
|
|
|
|
? DT_elt_zero_wide_safe : DT_elt_zero_wide;
|
|
|
|
|
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (!i);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
2001-05-18 22:53:55 +02:00
|
|
|
|
test = new_decision_test (type, &place);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test->u.intval = XWINT (pattern, i);
|
1992-07-06 22:02:55 +02:00
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
else if (fmt[i] == 'E')
|
|
|
|
|
{
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (!i);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
test = new_decision_test (DT_veclen, &place);
|
|
|
|
|
test->u.veclen = XVECLEN (pattern, i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now test our sub-patterns. */
|
|
|
|
|
for (i = 0; i < (size_t) len; i++)
|
|
|
|
|
{
|
|
|
|
|
switch (fmt[i])
|
|
|
|
|
{
|
|
|
|
|
case 'e': case 'u':
|
|
|
|
|
subpos[depth] = '0' + i;
|
|
|
|
|
sub = add_to_sequence (XEXP (pattern, i), &sub->success,
|
|
|
|
|
subpos, insn_type, 0);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int j;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (j = 0; j < XVECLEN (pattern, i); j++)
|
|
|
|
|
{
|
|
|
|
|
subpos[depth] = 'a' + j;
|
|
|
|
|
sub = add_to_sequence (XVECEXP (pattern, i, j),
|
|
|
|
|
&sub->success, subpos, insn_type, 0);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 'i': case 'w':
|
|
|
|
|
/* Handled above. */
|
|
|
|
|
break;
|
|
|
|
|
case '0':
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fini:
|
|
|
|
|
/* Insert nodes testing mode and code, if they're still relevant,
|
|
|
|
|
before any of the nodes we may have added above. */
|
|
|
|
|
if (code != UNKNOWN)
|
|
|
|
|
{
|
|
|
|
|
place = &this->tests;
|
|
|
|
|
test = new_decision_test (DT_code, &place);
|
|
|
|
|
test->u.code = code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mode != VOIDmode)
|
|
|
|
|
{
|
|
|
|
|
place = &this->tests;
|
|
|
|
|
test = new_decision_test (DT_mode, &place);
|
|
|
|
|
test->u.mode = mode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we didn't insert any tests or accept nodes, hork. */
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (this->tests);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New.
libiberty:
* aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New.
* configure.in: Replace all alloca logic with a simple use of
the above new macro.
* config.table: Kill *-*-beos* entry.
* config/mh-beos: Delete.
* configure, config.in: Regenerate.
* Makefile.in (ALLOCA, HFILES): Kill.
(REQUIRED_OFILES): Add alloca.o.
(alloca.o): Depend on libiberty.h.
(argv.o): Don't depend on alloca-conf.h.
* alloca-conf.h: Delete.
* alloca.c: Include libiberty.h. Kill all #ifdef emacs
blocks. Provide the C alloca unconditionally. Use PTR where
appropriate. Make i00afunc static.
* argv.c: Don't include alloca-conf.h.
include:
* libiberty.h: Prototype C_alloca; define alloca to either
__builtin_alloca or C_alloca as appropriate.
gcc:
* aclocal.m4 (AM_GNU_GETTEXT): Don't AC_REQUIRE
AC_FUNC_ALLOCA.
* configure, config.in: Regenerate.
* config.gcc: Remove references to deleted files.
* genattr.c, genattrtab.c, genextract.c, genoutput.c,
genrecog.c, rtl.c: Do not use alloca anywhere.
* Makefile.in, build-make, system.h, config/x-interix,
config/x-svr4, config/xm-interix.h, config/xm-openbsd.h,
config/alpha/xm-alpha.h, config/alpha/xm-vms.h,
config/arc/xm-arc.h, config/arm/xm-arm.h,
config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h,
config/h8300/xm-h8300.h, config/i370/x-oe,
config/i370/xm-linux.h, config/i386/x-aix, config/i386/x-beos,
config/i386/x-ncr3000, config/i386/x-sco5,
config/i386/xm-dgux.h, config/i860/x-sysv4,
config/i960/xm-i960.h, config/m32r/xm-m32r.h,
config/m68k/x-crds, config/m68k/x-dpx2, config/m68k/x-hp320,
config/m68k/x-hp320g, config/m69k/x-mot3300,
config/m68k/x-mot3300-gas, config/m68k/xm-amix.h,
config/m68k/xm-hp320.h, config/m68k/xm-m68kv.h,
config/m68k/xm-mot3300.h, config/m88k/x-dolph,
config/m88k/x-sysv4, config/m88k/x-tekXD88,
config/m88k/xm-m88k.h, config/mcore/xm-mcore.h,
config/mips/x-iris, config/mips/x-iris3,
config/mips/x-sni-svr4, config/mips/x-sysv,
config/mips/xm-iris6.h, config/mips/xm-mips.h,
config/mips/xm-nws3250v4.h, config/pa/x-hpux,
config/pa/x-pa-mpeix, config/pa/xm-pa.h,
config/pa/xm-pa64hpux.h, config/pa/xm-pahpux.h,
config/pa/xm-papro.h, config/romp/xm-romp.h,
config/rs6000/x-aix31, config/rs6000/x-aix41,
config/rs6000/x-beos, config/rs6000/x-lynx,
config/rs6000/x-mach, config/rs6000/x-rs6000,
config/rs6000/x-sysv4, config/rs6000/xm-rs6000.h,
config/rs6000/xm-sysv4.h, config/sh/xm-sh.h,
config/sparc/x-sysv4, config/sparc/xm-linux.h,
config/sparc/xm-pbd.h, config/sparc/xm-sparc.h,
config/vax/xm-vms.h: Eradicate all references to alloca and
related stuff.
* config/xm-alloca.h, config/clipper/x-clix,
config/i386/xm-sysv4.h, config/i860/x-fx2800,
config/i860/x-sysv3, config/m88k/x-sysv3,
config/sparc/xm-sol2.h, config/we32k/x-we32k: Delete
(contained only alloca related hacks).
* config/i386/xm-beos.h, config/rs6000/xm-beos.h: Just define
USE_C_ALLOCA.
From-SVN: r40259
2001-03-06 10:52:35 +01:00
|
|
|
|
ret:
|
|
|
|
|
free (subpos);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return sub;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of maybe_both_true; examines only one test.
|
|
|
|
|
Returns > 0 for "definitely both true" and < 0 for "maybe both true". */
|
|
|
|
|
|
|
|
|
|
static int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
maybe_both_true_2 (struct decision_test *d1, struct decision_test *d2)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
if (d1->type == d2->type)
|
|
|
|
|
{
|
|
|
|
|
switch (d1->type)
|
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
case DT_num_insns:
|
|
|
|
|
if (d1->u.num_insns == d2->u.num_insns)
|
|
|
|
|
return 1;
|
|
|
|
|
else
|
|
|
|
|
return -1;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_mode:
|
2002-03-21 08:14:18 +01:00
|
|
|
|
return d1->u.mode == d2->u.mode;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
case DT_code:
|
|
|
|
|
return d1->u.code == d2->u.code;
|
|
|
|
|
|
|
|
|
|
case DT_veclen:
|
|
|
|
|
return d1->u.veclen == d2->u.veclen;
|
|
|
|
|
|
|
|
|
|
case DT_elt_zero_int:
|
|
|
|
|
case DT_elt_one_int:
|
|
|
|
|
case DT_elt_zero_wide:
|
2001-05-18 22:53:55 +02:00
|
|
|
|
case DT_elt_zero_wide_safe:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return d1->u.intval == d2->u.intval;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If either has a predicate that we know something about, set
|
|
|
|
|
things up so that D1 is the one that always has a known
|
|
|
|
|
predicate. Then see if they have any codes in common. */
|
|
|
|
|
|
|
|
|
|
if (d1->type == DT_pred || d2->type == DT_pred)
|
|
|
|
|
{
|
|
|
|
|
if (d2->type == DT_pred)
|
|
|
|
|
{
|
|
|
|
|
struct decision_test *tmp;
|
|
|
|
|
tmp = d1, d1 = d2, d2 = tmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If D2 tests a mode, see if it matches D1. */
|
|
|
|
|
if (d1->u.pred.mode != VOIDmode)
|
|
|
|
|
{
|
|
|
|
|
if (d2->type == DT_mode)
|
|
|
|
|
{
|
2002-03-21 08:14:18 +01:00
|
|
|
|
if (d1->u.pred.mode != d2->u.mode
|
2000-01-13 11:19:39 +01:00
|
|
|
|
/* The mode of an address_operand predicate is the
|
|
|
|
|
mode of the memory, not the operand. It can only
|
|
|
|
|
be used for testing the predicate, so we must
|
|
|
|
|
ignore it here. */
|
|
|
|
|
&& strcmp (d1->u.pred.name, "address_operand") != 0)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
1999-10-14 06:07:03 +02:00
|
|
|
|
/* Don't check two predicate modes here, because if both predicates
|
|
|
|
|
accept CONST_INT, then both can still be true even if the modes
|
|
|
|
|
are different. If they don't accept CONST_INT, there will be a
|
|
|
|
|
separate DT_mode that will make maybe_both_true_1 return 0. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
if (d1->u.pred.data)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
/* If D2 tests a code, see if it is in the list of valid
|
|
|
|
|
codes for D1's predicate. */
|
|
|
|
|
if (d2->type == DT_code)
|
|
|
|
|
{
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
if (!d1->u.pred.data->codes[d2->u.code])
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Otherwise see if the predicates have any codes in common. */
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
else if (d2->type == DT_pred && d2->u.pred.data)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
bool common = false;
|
|
|
|
|
enum rtx_code c;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
for (c = 0; c < NUM_RTX_CODE; c++)
|
|
|
|
|
if (d1->u.pred.data->codes[c] && d2->u.pred.data->codes[c])
|
|
|
|
|
{
|
|
|
|
|
common = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
if (!common)
|
|
|
|
|
return 0;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
2001-01-14 21:35:06 +01:00
|
|
|
|
/* Tests vs veclen may be known when strict equality is involved. */
|
|
|
|
|
if (d1->type == DT_veclen && d2->type == DT_veclen_ge)
|
|
|
|
|
return d1->u.veclen >= d2->u.veclen;
|
|
|
|
|
if (d1->type == DT_veclen_ge && d2->type == DT_veclen)
|
|
|
|
|
return d2->u.veclen >= d1->u.veclen;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return -1;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
/* A subroutine of maybe_both_true; examines all the tests for a given node.
|
|
|
|
|
Returns > 0 for "definitely both true" and < 0 for "maybe both true". */
|
|
|
|
|
|
|
|
|
|
static int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
maybe_both_true_1 (struct decision_test *d1, struct decision_test *d2)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
struct decision_test *t1, *t2;
|
|
|
|
|
|
|
|
|
|
/* A match_operand with no predicate can match anything. Recognize
|
ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4,
ChangeLog.5, ChangeLog, FSFChangeLog.10, FSFChangeLog.11,
c-common.c, c-common.h, c-parse.in, c-typeck.c, cfg.c, config.gcc,
configure, configure.in, except.c, except.h, flow.c, function.c,
gcc.c, gcse.c, genrecog.c, libgcc2.c, loop.c, loop.h, params.def,
predict.def, predict.h, reg-stack.c, regmove.c, sched-deps.c,
sched-int.h, sibcall.c, ssa.c, stringpool.c, toplev.c, tree.c,
unroll.c: Fix spelling errors.
From-SVN: r46595
2001-10-28 21:09:17 +01:00
|
|
|
|
this by the existence of a lone DT_accept_op test. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (d1->type == DT_accept_op || d2->type == DT_accept_op)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
/* Eliminate pairs of tests while they can exactly match. */
|
|
|
|
|
while (d1 && d2 && d1->type == d2->type)
|
|
|
|
|
{
|
|
|
|
|
if (maybe_both_true_2 (d1, d2) == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
d1 = d1->next, d2 = d2->next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* After that, consider all pairs. */
|
|
|
|
|
for (t1 = d1; t1 ; t1 = t1->next)
|
|
|
|
|
for (t2 = d2; t2 ; t2 = t2->next)
|
|
|
|
|
if (maybe_both_true_2 (t1, t2) == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 0 if we can prove that there is no RTL that can match both
|
|
|
|
|
D1 and D2. Otherwise, return 1 (it may be that there is an RTL that
|
1991-12-28 12:36:37 +01:00
|
|
|
|
can match both or just that we couldn't prove there wasn't such an RTL).
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2002-09-22 16:09:34 +02:00
|
|
|
|
TOPLEVEL is nonzero if we are to only look at the top level and not
|
1991-12-28 12:36:37 +01:00
|
|
|
|
recursively descend. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
static int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
maybe_both_true (struct decision *d1, struct decision *d2,
|
|
|
|
|
int toplevel)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1991-12-28 12:36:37 +01:00
|
|
|
|
struct decision *p1, *p2;
|
1999-09-22 03:40:28 +02:00
|
|
|
|
int cmp;
|
|
|
|
|
|
|
|
|
|
/* Don't compare strings on the different positions in insn. Doing so
|
|
|
|
|
is incorrect and results in false matches from constructs like
|
|
|
|
|
|
|
|
|
|
[(set (subreg:HI (match_operand:SI "register_operand" "r") 0)
|
|
|
|
|
(subreg:HI (match_operand:SI "register_operand" "r") 0))]
|
|
|
|
|
vs
|
|
|
|
|
[(set (match_operand:HI "register_operand" "r")
|
|
|
|
|
(match_operand:HI "register_operand" "r"))]
|
|
|
|
|
|
|
|
|
|
If we are presented with such, we are recursing through the remainder
|
|
|
|
|
of a node's success nodes (from the loop at the end of this function).
|
|
|
|
|
Skip forward until we come to a position that matches.
|
|
|
|
|
|
|
|
|
|
Due to the way position strings are constructed, we know that iterating
|
|
|
|
|
forward from the lexically lower position (e.g. "00") will run into
|
|
|
|
|
the lexically higher position (e.g. "1") and not the other way around.
|
|
|
|
|
This saves a bit of effort. */
|
|
|
|
|
|
|
|
|
|
cmp = strcmp (d1->position, d2->position);
|
|
|
|
|
if (cmp != 0)
|
|
|
|
|
{
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (!toplevel);
|
1999-09-22 03:40:28 +02:00
|
|
|
|
|
|
|
|
|
/* If the d2->position was lexically lower, swap. */
|
|
|
|
|
if (cmp > 0)
|
1999-09-22 08:53:35 +02:00
|
|
|
|
p1 = d1, d1 = d2, d2 = p1;
|
1999-09-22 03:40:28 +02:00
|
|
|
|
|
|
|
|
|
if (d1->success.first == 0)
|
2000-12-15 14:50:32 +01:00
|
|
|
|
return 1;
|
1999-09-22 03:40:28 +02:00
|
|
|
|
for (p1 = d1->success.first; p1; p1 = p1->next)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (maybe_both_true (p1, d2, 0))
|
|
|
|
|
return 1;
|
1999-09-22 03:40:28 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return 0;
|
1999-09-22 03:40:28 +02:00
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Test the current level. */
|
|
|
|
|
cmp = maybe_both_true_1 (d1->tests, d2->tests);
|
|
|
|
|
if (cmp >= 0)
|
|
|
|
|
return cmp;
|
|
|
|
|
|
|
|
|
|
/* We can't prove that D1 and D2 cannot both be true. If we are only
|
|
|
|
|
to check the top level, return 1. Otherwise, see if we can prove
|
|
|
|
|
that all choices in both successors are mutually exclusive. If
|
|
|
|
|
either does not have any successors, we can't prove they can't both
|
|
|
|
|
be true. */
|
|
|
|
|
|
|
|
|
|
if (toplevel || d1->success.first == 0 || d2->success.first == 0)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
return 1;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (p1 = d1->success.first; p1; p1 = p1->next)
|
|
|
|
|
for (p2 = d2->success.first; p2; p2 = p2->next)
|
|
|
|
|
if (maybe_both_true (p1, p2, 0))
|
|
|
|
|
return 1;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* A subroutine of nodes_identical. Examine two tests for equivalence. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
nodes_identical_1 (struct decision_test *d1, struct decision_test *d2)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
switch (d1->type)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
case DT_num_insns:
|
|
|
|
|
return d1->u.num_insns == d2->u.num_insns;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_mode:
|
|
|
|
|
return d1->u.mode == d2->u.mode;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_code:
|
|
|
|
|
return d1->u.code == d2->u.code;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_pred:
|
|
|
|
|
return (d1->u.pred.mode == d2->u.pred.mode
|
|
|
|
|
&& strcmp (d1->u.pred.name, d2->u.pred.name) == 0);
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_c_test:
|
|
|
|
|
return strcmp (d1->u.c_test, d2->u.c_test) == 0;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_veclen:
|
2001-01-14 21:35:06 +01:00
|
|
|
|
case DT_veclen_ge:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return d1->u.veclen == d2->u.veclen;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_dup:
|
|
|
|
|
return d1->u.dup == d2->u.dup;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_elt_zero_int:
|
|
|
|
|
case DT_elt_one_int:
|
|
|
|
|
case DT_elt_zero_wide:
|
2001-05-18 22:53:55 +02:00
|
|
|
|
case DT_elt_zero_wide_safe:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return d1->u.intval == d2->u.intval;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_accept_op:
|
|
|
|
|
return d1->u.opno == d2->u.opno;
|
|
|
|
|
|
|
|
|
|
case DT_accept_insn:
|
|
|
|
|
/* Differences will be handled in merge_accept_insn. */
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* True iff the two nodes are identical (on one level only). Due
|
2001-07-03 08:22:01 +02:00
|
|
|
|
to the way these lists are constructed, we shouldn't have to
|
1999-10-05 07:18:54 +02:00
|
|
|
|
consider different orderings on the tests. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
nodes_identical (struct decision *d1, struct decision *d2)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
struct decision_test *t1, *t2;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (t1 = d1->tests, t2 = d2->tests; t1 && t2; t1 = t1->next, t2 = t2->next)
|
|
|
|
|
{
|
|
|
|
|
if (t1->type != t2->type)
|
|
|
|
|
return 0;
|
|
|
|
|
if (! nodes_identical_1 (t1, t2))
|
1991-12-28 12:36:37 +01:00
|
|
|
|
return 0;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* For success, they should now both be null. */
|
1999-10-15 08:56:28 +02:00
|
|
|
|
if (t1 != t2)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Check that their subnodes are at the same position, as any one set
|
2001-01-13 20:31:07 +01:00
|
|
|
|
of sibling decisions must be at the same position. Allowing this
|
|
|
|
|
requires complications to find_afterward and when change_state is
|
|
|
|
|
invoked. */
|
1999-10-15 08:56:28 +02:00
|
|
|
|
if (d1->success.first
|
|
|
|
|
&& d2->success.first
|
|
|
|
|
&& strcmp (d1->success.first->position, d2->success.first->position))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return 1;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* A subroutine of merge_trees; given two nodes that have been declared
|
|
|
|
|
identical, cope with two insn accept states. If they differ in the
|
|
|
|
|
number of clobbers, then the conflict was created by make_insn_sequence
|
2001-07-03 08:22:01 +02:00
|
|
|
|
and we can drop the with-clobbers version on the floor. If both
|
1999-10-05 07:18:54 +02:00
|
|
|
|
nodes have no additional clobbers, we have found an ambiguity in the
|
|
|
|
|
source machine description. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
merge_accept_insn (struct decision *oldd, struct decision *addd)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision_test *old, *add;
|
|
|
|
|
|
|
|
|
|
for (old = oldd->tests; old; old = old->next)
|
|
|
|
|
if (old->type == DT_accept_insn)
|
|
|
|
|
break;
|
|
|
|
|
if (old == NULL)
|
|
|
|
|
return;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (add = addd->tests; add; add = add->next)
|
|
|
|
|
if (add->type == DT_accept_insn)
|
|
|
|
|
break;
|
|
|
|
|
if (add == NULL)
|
|
|
|
|
return;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* If one node is for a normal insn and the second is for the base
|
|
|
|
|
insn with clobbers stripped off, the second node should be ignored. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (old->u.insn.num_clobbers_to_add == 0
|
|
|
|
|
&& add->u.insn.num_clobbers_to_add > 0)
|
|
|
|
|
{
|
|
|
|
|
/* Nothing to do here. */
|
|
|
|
|
}
|
|
|
|
|
else if (old->u.insn.num_clobbers_to_add > 0
|
|
|
|
|
&& add->u.insn.num_clobbers_to_add == 0)
|
|
|
|
|
{
|
|
|
|
|
/* In this case, replace OLD with ADD. */
|
|
|
|
|
old->u.insn = add->u.insn;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1999-10-14 05:43:49 +02:00
|
|
|
|
message_with_line (add->u.insn.lineno, "`%s' matches `%s'",
|
|
|
|
|
get_insn_name (add->u.insn.code_number),
|
|
|
|
|
get_insn_name (old->u.insn.code_number));
|
|
|
|
|
message_with_line (old->u.insn.lineno, "previous definition of `%s'",
|
|
|
|
|
get_insn_name (old->u.insn.code_number));
|
|
|
|
|
error_count++;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Merge two decision trees OLDH and ADDH, modifying OLDH destructively. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
merge_trees (struct decision_head *oldh, struct decision_head *addh)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision *next, *add;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (addh->first == 0)
|
|
|
|
|
return;
|
|
|
|
|
if (oldh->first == 0)
|
|
|
|
|
{
|
|
|
|
|
*oldh = *addh;
|
|
|
|
|
return;
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Trying to merge bits at different positions isn't possible. */
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (!strcmp (oldh->first->position, addh->first->position));
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (add = addh->first; add ; add = next)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision *old, *insert_before = NULL;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
|
|
|
|
next = add->next;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* The semantics of pattern matching state that the tests are
|
|
|
|
|
done in the order given in the MD file so that if an insn
|
|
|
|
|
matches two patterns, the first one will be used. However,
|
|
|
|
|
in practice, most, if not all, patterns are unambiguous so
|
|
|
|
|
that their order is independent. In that case, we can merge
|
|
|
|
|
identical tests and group all similar modes and codes together.
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
|
|
|
|
Scan starting from the end of OLDH until we reach a point
|
1999-10-05 07:18:54 +02:00
|
|
|
|
where we reach the head of the list or where we pass a
|
|
|
|
|
pattern that could also be true if NEW is true. If we find
|
|
|
|
|
an identical pattern, we can merge them. Also, record the
|
|
|
|
|
last node that tests the same code and mode and the last one
|
|
|
|
|
that tests just the same mode.
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
|
|
|
|
If we have no match, place NEW after the closest match we found. */
|
2001-07-03 08:22:01 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (old = oldh->last; old; old = old->prev)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (nodes_identical (old, add))
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
merge_accept_insn (old, add);
|
|
|
|
|
merge_trees (&old->success, &add->success);
|
|
|
|
|
goto merged_nodes;
|
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (maybe_both_true (old, add, 0))
|
|
|
|
|
break;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Insert the nodes in DT test type order, which is roughly
|
|
|
|
|
how expensive/important the test is. Given that the tests
|
|
|
|
|
are also ordered within the list, examining the first is
|
|
|
|
|
sufficient. */
|
2001-03-02 22:41:37 +01:00
|
|
|
|
if ((int) add->tests->type < (int) old->tests->type)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
insert_before = old;
|
|
|
|
|
}
|
1992-01-15 22:29:48 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (insert_before == NULL)
|
|
|
|
|
{
|
|
|
|
|
add->next = NULL;
|
|
|
|
|
add->prev = oldh->last;
|
|
|
|
|
oldh->last->next = add;
|
|
|
|
|
oldh->last = add;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if ((add->prev = insert_before->prev) != NULL)
|
|
|
|
|
add->prev->next = add;
|
|
|
|
|
else
|
|
|
|
|
oldh->first = add;
|
|
|
|
|
add->next = insert_before;
|
|
|
|
|
insert_before->prev = add;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
merged_nodes:;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-03 08:22:01 +02:00
|
|
|
|
/* Walk the tree looking for sub-nodes that perform common tests.
|
1999-10-05 07:18:54 +02:00
|
|
|
|
Factor out the common test into a new node. This enables us
|
|
|
|
|
(depending on the test type) to emit switch statements later. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
factor_tests (struct decision_head *head)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
struct decision *first, *next;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (first = head->first; first && first->next; first = next)
|
|
|
|
|
{
|
|
|
|
|
enum decision_type type;
|
|
|
|
|
struct decision *new, *old_last;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
type = first->tests->type;
|
|
|
|
|
next = first->next;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Want at least two compatible sequential nodes. */
|
|
|
|
|
if (next->tests->type != type)
|
|
|
|
|
continue;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2001-07-03 08:22:01 +02:00
|
|
|
|
/* Don't want all node types, just those we can turn into
|
1999-10-05 07:18:54 +02:00
|
|
|
|
switch statements. */
|
|
|
|
|
if (type != DT_mode
|
|
|
|
|
&& type != DT_code
|
|
|
|
|
&& type != DT_veclen
|
|
|
|
|
&& type != DT_elt_zero_int
|
|
|
|
|
&& type != DT_elt_one_int
|
2001-05-18 22:53:55 +02:00
|
|
|
|
&& type != DT_elt_zero_wide_safe)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
continue;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* If we'd been performing more than one test, create a new node
|
|
|
|
|
below our first test. */
|
|
|
|
|
if (first->tests->next != NULL)
|
|
|
|
|
{
|
|
|
|
|
new = new_decision (first->position, &first->success);
|
|
|
|
|
new->tests = first->tests->next;
|
|
|
|
|
first->tests->next = NULL;
|
|
|
|
|
}
|
2001-07-03 08:22:01 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Crop the node tree off after our first test. */
|
|
|
|
|
first->next = NULL;
|
|
|
|
|
old_last = head->last;
|
|
|
|
|
head->last = first;
|
|
|
|
|
|
|
|
|
|
/* For each compatible test, adjust to perform only one test in
|
|
|
|
|
the top level node, then merge the node back into the tree. */
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
struct decision_head h;
|
|
|
|
|
|
|
|
|
|
if (next->tests->next != NULL)
|
|
|
|
|
{
|
|
|
|
|
new = new_decision (next->position, &next->success);
|
|
|
|
|
new->tests = next->tests->next;
|
|
|
|
|
next->tests->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
new = next;
|
|
|
|
|
next = next->next;
|
|
|
|
|
new->next = NULL;
|
|
|
|
|
h.first = h.last = new;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
merge_trees (head, &h);
|
|
|
|
|
}
|
|
|
|
|
while (next && next->tests->type == type);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* After we run out of compatible tests, graft the remaining nodes
|
|
|
|
|
back onto the tree. */
|
|
|
|
|
if (next)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
next->prev = head->last;
|
|
|
|
|
head->last->next = next;
|
|
|
|
|
head->last = old_last;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Recurse. */
|
|
|
|
|
for (first = head->first; first; first = first->next)
|
|
|
|
|
factor_tests (&first->success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* After factoring, try to simplify the tests on any one node.
|
|
|
|
|
Tests that are useful for switch statements are recognizable
|
|
|
|
|
by having only a single test on a node -- we'll be manipulating
|
|
|
|
|
nodes with multiple tests:
|
|
|
|
|
|
|
|
|
|
If we have mode tests or code tests that are redundant with
|
|
|
|
|
predicates, remove them. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
simplify_tests (struct decision_head *head)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
struct decision *tree;
|
|
|
|
|
|
|
|
|
|
for (tree = head->first; tree; tree = tree->next)
|
|
|
|
|
{
|
|
|
|
|
struct decision_test *a, *b;
|
|
|
|
|
|
|
|
|
|
a = tree->tests;
|
|
|
|
|
b = a->next;
|
|
|
|
|
if (b == NULL)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* Find a predicate node. */
|
|
|
|
|
while (b && b->type != DT_pred)
|
|
|
|
|
b = b->next;
|
|
|
|
|
if (b)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Due to how these tests are constructed, we don't even need
|
|
|
|
|
to check that the mode and code are compatible -- they were
|
|
|
|
|
generated from the predicate in the first place. */
|
|
|
|
|
while (a->type == DT_mode || a->type == DT_code)
|
|
|
|
|
a = a->next;
|
|
|
|
|
tree->tests = a;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Recurse. */
|
|
|
|
|
for (tree = head->first; tree; tree = tree->next)
|
|
|
|
|
simplify_tests (&tree->success);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
1991-12-28 12:36:37 +01:00
|
|
|
|
/* Count the number of subnodes of HEAD. If the number is high enough,
|
|
|
|
|
make the first node in HEAD start a separate subroutine in the C code
|
1999-10-05 07:18:54 +02:00
|
|
|
|
that is generated. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
static int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
break_out_subroutines (struct decision_head *head, int initial)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
|
|
|
|
int size = 0;
|
1994-03-25 20:13:46 +01:00
|
|
|
|
struct decision *sub;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (sub = head->first; sub; sub = sub->next)
|
|
|
|
|
size += 1 + break_out_subroutines (&sub->success, 0);
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
|
|
|
|
if (size > SUBROUTINE_THRESHOLD && ! initial)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
head->first->subroutine_number = ++next_subroutine_number;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
size = 1;
|
|
|
|
|
}
|
|
|
|
|
return size;
|
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
/* For each node p, find the next alternative that might be true
|
|
|
|
|
when p is true. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
find_afterward (struct decision_head *head, struct decision *real_afterward)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision *p, *q, *afterward;
|
1999-08-24 15:34:04 +02:00
|
|
|
|
|
ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog,
FSFChangeLog.10, c-decl.c, cppfiles.c, cppinit.c, cpplex.c,
cpplib.c, cppmain.c, cse.c, df.c, diagnostic.c, dominance.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, errors.c, except.c, except.h,
explow.c, function.c, gcse.c, genrecog.c, predict.c, regmove.c,
sched-rgn.c, ssa-ccp.c, stmt.c, toplev.c: Fix spelling errors.
From-SVN: r47279
2001-11-23 03:05:19 +01:00
|
|
|
|
/* We can't propagate alternatives across subroutine boundaries.
|
1999-10-05 07:18:54 +02:00
|
|
|
|
This is not incorrect, merely a minor optimization loss. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
p = head->first;
|
|
|
|
|
afterward = (p->subroutine_number > 0 ? NULL : real_afterward);
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for ( ; p ; p = p->next)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Find the next node that might be true if this one fails. */
|
|
|
|
|
for (q = p->next; q ; q = q->next)
|
|
|
|
|
if (maybe_both_true (p, q, 1))
|
|
|
|
|
break;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
2001-07-03 08:22:01 +02:00
|
|
|
|
/* If we reached the end of the list without finding one,
|
1999-10-05 07:18:54 +02:00
|
|
|
|
use the incoming afterward position. */
|
|
|
|
|
if (!q)
|
|
|
|
|
q = afterward;
|
|
|
|
|
p->afterward = q;
|
|
|
|
|
if (q)
|
|
|
|
|
q->need_label = 1;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Recurse. */
|
|
|
|
|
for (p = head->first; p ; p = p->next)
|
|
|
|
|
if (p->success.first)
|
|
|
|
|
find_afterward (&p->success, p->afterward);
|
|
|
|
|
|
|
|
|
|
/* When we are generating a subroutine, record the real afterward
|
|
|
|
|
position in the first node where write_tree can find it, and we
|
|
|
|
|
can do the right thing at the subroutine call site. */
|
|
|
|
|
p = head->first;
|
|
|
|
|
if (p->subroutine_number > 0)
|
|
|
|
|
p->afterward = real_afterward;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Assuming that the state of argument is denoted by OLDPOS, take whatever
|
|
|
|
|
actions are necessary to move to NEWPOS. If we fail to move to the
|
2002-09-22 16:09:34 +02:00
|
|
|
|
new state, branch to node AFTERWARD if nonzero, otherwise return.
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
Failure to move to the new state can only occur if we are trying to
|
2001-08-13 01:40:53 +02:00
|
|
|
|
match multiple insns and we try to step past the end of the stream. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void
|
2005-08-27 04:08:29 +02:00
|
|
|
|
change_state (const char *oldpos, const char *newpos, const char *indent)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
int odepth = strlen (oldpos);
|
|
|
|
|
int ndepth = strlen (newpos);
|
|
|
|
|
int depth;
|
|
|
|
|
int old_has_insn, new_has_insn;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Pop up as many levels as necessary. */
|
|
|
|
|
for (depth = odepth; strncmp (oldpos, newpos, depth) != 0; --depth)
|
|
|
|
|
continue;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Hunt for the last [A-Z] in both strings. */
|
|
|
|
|
for (old_has_insn = odepth - 1; old_has_insn >= 0; --old_has_insn)
|
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
2001-10-21 23:32:15 +02:00
|
|
|
|
if (ISUPPER (oldpos[old_has_insn]))
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
1999-12-30 18:48:52 +01:00
|
|
|
|
for (new_has_insn = ndepth - 1; new_has_insn >= 0; --new_has_insn)
|
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
2001-10-21 23:32:15 +02:00
|
|
|
|
if (ISUPPER (newpos[new_has_insn]))
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Go down to desired level. */
|
|
|
|
|
while (depth < ndepth)
|
|
|
|
|
{
|
2001-08-13 01:40:53 +02:00
|
|
|
|
/* It's a different insn from the first one. */
|
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
2001-10-21 23:32:15 +02:00
|
|
|
|
if (ISUPPER (newpos[depth]))
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
printf ("%stem = peep2_next_insn (%d);\n",
|
|
|
|
|
indent, newpos[depth] - 'A');
|
2000-05-27 22:23:15 +02:00
|
|
|
|
printf ("%sx%d = PATTERN (tem);\n", indent, depth + 1);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
2001-10-21 23:32:15 +02:00
|
|
|
|
else if (ISLOWER (newpos[depth]))
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf ("%sx%d = XVECEXP (x%d, 0, %d);\n",
|
|
|
|
|
indent, depth + 1, depth, newpos[depth] - 'a');
|
|
|
|
|
else
|
|
|
|
|
printf ("%sx%d = XEXP (x%d, %c);\n",
|
|
|
|
|
indent, depth + 1, depth, newpos[depth]);
|
|
|
|
|
++depth;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Print the enumerator constant for CODE -- the upcase version of
|
|
|
|
|
the name. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
print_code (enum rtx_code code)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
const char *p;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (p = GET_RTX_NAME (code); *p; p++)
|
|
|
|
|
putchar (TOUPPER (*p));
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Emit code to cross an afterward link -- change state and branch. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_afterward (struct decision *start, struct decision *afterward,
|
|
|
|
|
const char *indent)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
if (!afterward || start->subroutine_number > 0)
|
|
|
|
|
printf("%sgoto ret0;\n", indent);
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
change_state (start->position, afterward->position, indent);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf ("%sgoto L%d;\n", indent, afterward->number);
|
|
|
|
|
}
|
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
2003-12-18 23:10:06 +01:00
|
|
|
|
/* Emit a HOST_WIDE_INT as an integer constant expression. We need to take
|
|
|
|
|
special care to avoid "decimal constant is so large that it is unsigned"
|
|
|
|
|
warnings in the resulting code. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
print_host_wide_int (HOST_WIDE_INT val)
|
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT min = (unsigned HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT-1);
|
|
|
|
|
if (val == min)
|
|
|
|
|
printf ("(" HOST_WIDE_INT_PRINT_DEC_C "-1)", val + 1);
|
|
|
|
|
else
|
|
|
|
|
printf (HOST_WIDE_INT_PRINT_DEC_C, val);
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-03 08:22:01 +02:00
|
|
|
|
/* Emit a switch statement, if possible, for an initial sequence of
|
1999-10-05 07:18:54 +02:00
|
|
|
|
nodes at START. Return the first node yet untested. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static struct decision *
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_switch (struct decision *start, int depth)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
struct decision *p = start;
|
|
|
|
|
enum decision_type type = p->tests->type;
|
2000-10-17 16:27:53 +02:00
|
|
|
|
struct decision *needs_label = NULL;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* If we have two or more nodes in sequence that test the same one
|
|
|
|
|
thing, we may be able to use a switch statement. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (!p->next
|
|
|
|
|
|| p->tests->next
|
|
|
|
|
|| p->next->tests->type != type
|
2001-01-13 20:31:07 +01:00
|
|
|
|
|| p->next->tests->next
|
|
|
|
|
|| nodes_identical_1 (p->tests, p->next->tests))
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return p;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* DT_code is special in that we can do interesting things with
|
|
|
|
|
known predicates at the same time. */
|
|
|
|
|
if (type == DT_code)
|
|
|
|
|
{
|
|
|
|
|
char codemap[NUM_RTX_CODE];
|
|
|
|
|
struct decision *ret;
|
1999-10-30 23:40:05 +02:00
|
|
|
|
RTX_CODE code;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
memset (codemap, 0, sizeof(codemap));
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" switch (GET_CODE (x%d))\n {\n", depth);
|
1999-10-30 23:40:05 +02:00
|
|
|
|
code = p->tests->u.code;
|
2001-07-03 08:22:01 +02:00
|
|
|
|
do
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
2000-10-17 16:27:53 +02:00
|
|
|
|
if (p != start && p->need_label && needs_label == NULL)
|
|
|
|
|
needs_label = p;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" case ");
|
|
|
|
|
print_code (code);
|
|
|
|
|
printf (":\n goto L%d;\n", p->success.first->number);
|
|
|
|
|
p->success.first->need_label = 1;
|
|
|
|
|
|
|
|
|
|
codemap[code] = 1;
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
1999-10-30 23:40:05 +02:00
|
|
|
|
while (p
|
|
|
|
|
&& ! p->tests->next
|
|
|
|
|
&& p->tests->type == DT_code
|
|
|
|
|
&& ! codemap[code = p->tests->u.code]);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
/* If P is testing a predicate that we know about and we haven't
|
|
|
|
|
seen any of the codes that are valid for the predicate, we can
|
|
|
|
|
write a series of "case" statement, one for each possible code.
|
|
|
|
|
Since we are already in a switch, these redundant tests are very
|
|
|
|
|
cheap and will reduce the number of predicates called. */
|
|
|
|
|
|
|
|
|
|
/* Note that while we write out cases for these predicates here,
|
|
|
|
|
we don't actually write the test here, as it gets kinda messy.
|
|
|
|
|
It is trivial to leave this to later by telling our caller that
|
|
|
|
|
we only processed the CODE tests. */
|
2000-10-17 16:27:53 +02:00
|
|
|
|
if (needs_label != NULL)
|
|
|
|
|
ret = needs_label;
|
|
|
|
|
else
|
|
|
|
|
ret = p;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
while (p && p->tests->type == DT_pred && p->tests->u.pred.data)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
const struct pred_data *data = p->tests->u.pred.data;
|
|
|
|
|
RTX_CODE c;
|
|
|
|
|
for (c = 0; c < NUM_RTX_CODE; c++)
|
|
|
|
|
if (codemap[c] && data->codes[c])
|
1999-10-05 07:18:54 +02:00
|
|
|
|
goto pred_done;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
for (c = 0; c < NUM_RTX_CODE; c++)
|
|
|
|
|
if (data->codes[c])
|
|
|
|
|
{
|
|
|
|
|
fputs (" case ", stdout);
|
|
|
|
|
print_code (c);
|
|
|
|
|
fputs (":\n", stdout);
|
|
|
|
|
codemap[c] = 1;
|
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" goto L%d;\n", p->number);
|
|
|
|
|
p->need_label = 1;
|
|
|
|
|
p = p->next;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
pred_done:
|
|
|
|
|
/* Make the default case skip the predicates we managed to match. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" default:\n");
|
|
|
|
|
if (p != ret)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (p)
|
1995-10-27 00:13:47 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" goto L%d;\n", p->number);
|
|
|
|
|
p->need_label = 1;
|
1995-10-27 00:13:47 +01:00
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
else
|
1999-10-05 07:18:54 +02:00
|
|
|
|
write_afterward (start, start->afterward, " ");
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" break;\n");
|
|
|
|
|
printf (" }\n");
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
else if (type == DT_mode
|
|
|
|
|
|| type == DT_veclen
|
|
|
|
|
|| type == DT_elt_zero_int
|
|
|
|
|
|| type == DT_elt_one_int
|
2001-05-18 22:53:55 +02:00
|
|
|
|
|| type == DT_elt_zero_wide_safe)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
2001-10-28 17:00:22 +01:00
|
|
|
|
const char *indent = "";
|
2001-07-16 02:28:20 +02:00
|
|
|
|
|
2001-10-28 17:00:22 +01:00
|
|
|
|
/* We cast switch parameter to integer, so we must ensure that the value
|
|
|
|
|
fits. */
|
|
|
|
|
if (type == DT_elt_zero_wide_safe)
|
|
|
|
|
{
|
|
|
|
|
indent = " ";
|
|
|
|
|
printf(" if ((int) XWINT (x%d, 0) == XWINT (x%d, 0))\n", depth, depth);
|
|
|
|
|
}
|
|
|
|
|
printf ("%s switch (", indent);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case DT_mode:
|
2000-02-19 02:27:00 +01:00
|
|
|
|
printf ("GET_MODE (x%d)", depth);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case DT_veclen:
|
2000-02-19 02:27:00 +01:00
|
|
|
|
printf ("XVECLEN (x%d, 0)", depth);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case DT_elt_zero_int:
|
2000-02-19 02:27:00 +01:00
|
|
|
|
printf ("XINT (x%d, 0)", depth);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case DT_elt_one_int:
|
2000-02-19 02:27:00 +01:00
|
|
|
|
printf ("XINT (x%d, 1)", depth);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
2001-05-18 22:53:55 +02:00
|
|
|
|
case DT_elt_zero_wide_safe:
|
2000-02-19 02:27:00 +01:00
|
|
|
|
/* Convert result of XWINT to int for portability since some C
|
|
|
|
|
compilers won't do it and some will. */
|
|
|
|
|
printf ("(int) XWINT (x%d, 0)", depth);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
2001-10-28 17:00:22 +01:00
|
|
|
|
printf (")\n%s {\n", indent);
|
1992-01-07 01:30:06 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
do
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
2001-01-13 20:31:07 +01:00
|
|
|
|
/* Merge trees will not unify identical nodes if their
|
|
|
|
|
sub-nodes are at different levels. Thus we must check
|
|
|
|
|
for duplicate cases. */
|
|
|
|
|
struct decision *q;
|
|
|
|
|
for (q = start; q != p; q = q->next)
|
|
|
|
|
if (nodes_identical_1 (p->tests, q->tests))
|
|
|
|
|
goto case_done;
|
|
|
|
|
|
2000-10-17 16:27:53 +02:00
|
|
|
|
if (p != start && p->need_label && needs_label == NULL)
|
|
|
|
|
needs_label = p;
|
|
|
|
|
|
2001-10-28 17:00:22 +01:00
|
|
|
|
printf ("%s case ", indent);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
switch (type)
|
1992-01-07 01:30:06 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_mode:
|
|
|
|
|
printf ("%smode", GET_MODE_NAME (p->tests->u.mode));
|
|
|
|
|
break;
|
|
|
|
|
case DT_veclen:
|
|
|
|
|
printf ("%d", p->tests->u.veclen);
|
|
|
|
|
break;
|
|
|
|
|
case DT_elt_zero_int:
|
|
|
|
|
case DT_elt_one_int:
|
|
|
|
|
case DT_elt_zero_wide:
|
2001-05-18 22:53:55 +02:00
|
|
|
|
case DT_elt_zero_wide_safe:
|
2003-12-18 23:10:06 +01:00
|
|
|
|
print_host_wide_int (p->tests->u.intval);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1992-01-07 01:30:06 +01:00
|
|
|
|
}
|
2001-10-28 17:00:22 +01:00
|
|
|
|
printf (":\n%s goto L%d;\n", indent, p->success.first->number);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
p->success.first->need_label = 1;
|
1992-01-07 01:30:06 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
p = p->next;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
while (p && p->tests->type == type && !p->tests->next);
|
2001-01-13 20:31:07 +01:00
|
|
|
|
|
|
|
|
|
case_done:
|
2001-10-28 17:00:22 +01:00
|
|
|
|
printf ("%s default:\n%s break;\n%s }\n",
|
|
|
|
|
indent, indent, indent);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2000-10-17 16:27:53 +02:00
|
|
|
|
return needs_label != NULL ? needs_label : p;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2003-01-17 15:24:24 +01:00
|
|
|
|
/* None of the other tests are amenable. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Emit code for one test. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_cond (struct decision_test *p, int depth,
|
|
|
|
|
enum routine_type subroutine_type)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
switch (p->type)
|
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
case DT_num_insns:
|
|
|
|
|
printf ("peep2_current_count >= %d", p->u.num_insns);
|
|
|
|
|
break;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_mode:
|
|
|
|
|
printf ("GET_MODE (x%d) == %smode", depth, GET_MODE_NAME (p->u.mode));
|
|
|
|
|
break;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_code:
|
|
|
|
|
printf ("GET_CODE (x%d) == ", depth);
|
|
|
|
|
print_code (p->u.code);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DT_veclen:
|
|
|
|
|
printf ("XVECLEN (x%d, 0) == %d", depth, p->u.veclen);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DT_elt_zero_int:
|
|
|
|
|
printf ("XINT (x%d, 0) == %d", depth, (int) p->u.intval);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DT_elt_one_int:
|
|
|
|
|
printf ("XINT (x%d, 1) == %d", depth, (int) p->u.intval);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DT_elt_zero_wide:
|
2001-05-18 22:53:55 +02:00
|
|
|
|
case DT_elt_zero_wide_safe:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf ("XWINT (x%d, 0) == ", depth);
|
2003-12-18 23:10:06 +01:00
|
|
|
|
print_host_wide_int (p->u.intval);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2004-02-01 00:08:52 +01:00
|
|
|
|
case DT_const_int:
|
|
|
|
|
printf ("x%d == const_int_rtx[MAX_SAVED_CONST_INT + (%d)]",
|
|
|
|
|
depth, (int) p->u.intval);
|
|
|
|
|
break;
|
|
|
|
|
|
2001-01-14 21:35:06 +01:00
|
|
|
|
case DT_veclen_ge:
|
|
|
|
|
printf ("XVECLEN (x%d, 0) >= %d", depth, p->u.veclen);
|
|
|
|
|
break;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_dup:
|
|
|
|
|
printf ("rtx_equal_p (x%d, operands[%d])", depth, p->u.dup);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DT_pred:
|
|
|
|
|
printf ("%s (x%d, %smode)", p->u.pred.name, depth,
|
|
|
|
|
GET_MODE_NAME (p->u.pred.mode));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DT_c_test:
|
* rtl.h (copy_rtx_ptr_loc, print_rtx_ptr_loc, join_c_conditions)
(print_c_condition): Declare.
* read-rtl.c (ptr_loc): New structure.
(ptr_locs, ptr_loc_obstack, joined_conditions)
(joined_conditions_obstack): New variables.
(leading_ptr_hash, leading_ptr_eq_p, set_rtx_ptr_loc)
(get_rtx_ptr_loc, copy_rtx_ptr_loc, print_rtx_ptr_loc)
(join_c_conditions, print_c_condition): New functions.
(apply_macro_to_string): Associate the new string with the same
source location as the old one.
(add_condition_to_string): Use join_c_conditions.
(read_string): Use set_rtx_ptr_loc to record a filename and line
number for the string.
(read_rtx): Initialize the new variables above.
* genattrtab.c (write_test_expr, write_attr_value): Use
print_c_condition.
* genconditions.c (write_header): Don't define MAYBE_EVAL. Move its
comment above the GCC_VERSION check.
(write_one_condition): Use print_rtx_ptr_loc and print_c_condition.
Inline the definition of MAYBE_EVAL.
* genemit.c (gen_expand, gen_split): Use print_rtx_ptr_loc.
* genoutput.c (process_template): Likewise.
* genpreds.c (write_predicate_subfunction): Likewise.
(write_predicate_expr): Use print_c_condition.
* genrecog.c (write_cond): Likewise.
* gensupport.c (process_rtx): Use join_c_conditions to join the
conditions of a define_insn_and_split. Record a source location
for the string after the "&&".
(alter_test_for_insn): Use join_c_conditions.
From-SVN: r95883
2005-03-04 12:10:35 +01:00
|
|
|
|
print_c_condition (p->u.c_test);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DT_accept_insn:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (subroutine_type == RECOG);
|
|
|
|
|
gcc_assert (p->u.insn.num_clobbers_to_add);
|
|
|
|
|
printf ("pnum_clobbers != NULL");
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Emit code for one action. The previous tests have succeeded;
|
|
|
|
|
TEST is the last of the chain. In the normal case we simply
|
|
|
|
|
perform a state change. For the `accept' tests we must do more work. */
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_action (struct decision *p, struct decision_test *test,
|
|
|
|
|
int depth, int uncond, struct decision *success,
|
|
|
|
|
enum routine_type subroutine_type)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
const char *indent;
|
|
|
|
|
int want_close = 0;
|
|
|
|
|
|
|
|
|
|
if (uncond)
|
|
|
|
|
indent = " ";
|
|
|
|
|
else if (test->type == DT_accept_op || test->type == DT_accept_insn)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
fputs (" {\n", stdout);
|
|
|
|
|
indent = " ";
|
|
|
|
|
want_close = 1;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
else
|
|
|
|
|
indent = " ";
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (test->type == DT_accept_op)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf("%soperands[%d] = x%d;\n", indent, test->u.opno, depth);
|
|
|
|
|
|
|
|
|
|
/* Only allow DT_accept_insn to follow. */
|
|
|
|
|
if (test->next)
|
|
|
|
|
{
|
|
|
|
|
test = test->next;
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (test->type == DT_accept_insn);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Sanity check that we're now at the end of the list of tests. */
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (!test->next);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (test->type == DT_accept_insn)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
switch (subroutine_type)
|
|
|
|
|
{
|
|
|
|
|
case RECOG:
|
|
|
|
|
if (test->u.insn.num_clobbers_to_add != 0)
|
|
|
|
|
printf ("%s*pnum_clobbers = %d;\n",
|
|
|
|
|
indent, test->u.insn.num_clobbers_to_add);
|
genattrtab.c (insn_ent): Replace insn_code...
* genattrtab.c (insn_ent): Replace insn_code, insn_index and lineno
fields with a pointer to the instruction definition.
(get_attr_value, fill_attr, make_length_attrs, remove_insn_ent)
(insert_insn_ent, simplify_test_exp, optimize_attrs, write_attr_get)
(write_attr_case, write_const_num_delay_slots): Update accordingly.
(write_attr_case, write_const_num_delay_slots): Write the name of
an insn next to its case statement.
* genoutput.c (data): Add a filename field.
(gen_insn, gen_peephole, gen_expand, gen_split): Set it.
(output_insn_data): Print the location of each insn definition.
* genrecog.c (write_action): Print the name of an insn above
the statement that returns its code.
From-SVN: r85947
2004-08-13 18:43:04 +02:00
|
|
|
|
printf ("%sreturn %d; /* %s */\n", indent,
|
|
|
|
|
test->u.insn.code_number,
|
r110124@banpei: zack | 2006-01-22 14:45:55 -0800
r110124@banpei: zack | 2006-01-22 14:45:55 -0800
* gensupport.c: Define get_insn_name and record_insn_name here.
(read_md_rtx): Call record_insn_name as appropriate.
* genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c
* genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c
* genpreds.c, genrecog.c: Don't define get_insn_name nor
record_insn_name.
* Makefile.in (BUILD_SUPPORT, BUILD_PRINT): Fold into BUILD_RTL.
(BUILD_VARRAY): Delete.
(genprognormal): Rename genprogmd. Fold in all programs from
genprognoprint; also attrtab.
(build/genattrtab): Just mention genautomata.o and varray.o.
Reorganize a bit, add comments to make the categories clearer.
From-SVN: r110120
2006-01-23 16:15:12 +01:00
|
|
|
|
get_insn_name (test->u.insn.code_number));
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SPLIT:
|
2004-04-02 01:30:25 +02:00
|
|
|
|
printf ("%sreturn gen_split_%d (insn, operands);\n",
|
1999-10-05 07:18:54 +02:00
|
|
|
|
indent, test->u.insn.code_number);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PEEPHOLE2:
|
2000-05-27 22:23:15 +02:00
|
|
|
|
{
|
|
|
|
|
int match_len = 0, i;
|
|
|
|
|
|
|
|
|
|
for (i = strlen (p->position) - 1; i >= 0; --i)
|
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
2001-10-21 23:32:15 +02:00
|
|
|
|
if (ISUPPER (p->position[i]))
|
2000-05-27 22:23:15 +02:00
|
|
|
|
{
|
|
|
|
|
match_len = p->position[i] - 'A';
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
printf ("%s*_pmatch_len = %d;\n", indent, match_len);
|
|
|
|
|
printf ("%stem = gen_peephole2_%d (insn, operands);\n",
|
|
|
|
|
indent, test->u.insn.code_number);
|
|
|
|
|
printf ("%sif (tem != 0)\n%s return tem;\n", indent, indent);
|
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
printf("%sgoto L%d;\n", indent, success->number);
|
|
|
|
|
success->need_label = 1;
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (want_close)
|
|
|
|
|
fputs (" }\n", stdout);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Return 1 if the test is always true and has no fallthru path. Return -1
|
|
|
|
|
if the test does have a fallthru path, but requires that the condition be
|
|
|
|
|
terminated. Otherwise return 0 for a normal test. */
|
|
|
|
|
/* ??? is_unconditional is a stupid name for a tri-state function. */
|
|
|
|
|
|
1991-11-24 20:57:16 +01:00
|
|
|
|
static int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
is_unconditional (struct decision_test *t, enum routine_type subroutine_type)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (t->type == DT_accept_op)
|
|
|
|
|
return 1;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (t->type == DT_accept_insn)
|
|
|
|
|
{
|
|
|
|
|
switch (subroutine_type)
|
|
|
|
|
{
|
|
|
|
|
case RECOG:
|
|
|
|
|
return (t->u.insn.num_clobbers_to_add == 0);
|
|
|
|
|
case SPLIT:
|
|
|
|
|
return 1;
|
|
|
|
|
case PEEPHOLE2:
|
|
|
|
|
return -1;
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return 0;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Emit code for one node -- the conditional and the accompanying action.
|
|
|
|
|
Return true if there is no fallthru path. */
|
|
|
|
|
|
1991-11-24 20:57:16 +01:00
|
|
|
|
static int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_node (struct decision *p, int depth,
|
|
|
|
|
enum routine_type subroutine_type)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision_test *test, *last_test;
|
|
|
|
|
int uncond;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2004-02-01 00:08:52 +01:00
|
|
|
|
/* Scan the tests and simplify comparisons against small
|
|
|
|
|
constants. */
|
|
|
|
|
for (test = p->tests; test; test = test->next)
|
|
|
|
|
{
|
|
|
|
|
if (test->type == DT_code
|
|
|
|
|
&& test->u.code == CONST_INT
|
|
|
|
|
&& test->next
|
|
|
|
|
&& test->next->type == DT_elt_zero_wide_safe
|
|
|
|
|
&& -MAX_SAVED_CONST_INT <= test->next->u.intval
|
|
|
|
|
&& test->next->u.intval <= MAX_SAVED_CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
test->type = DT_const_int;
|
|
|
|
|
test->u.intval = test->next->u.intval;
|
|
|
|
|
test->next = test->next->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
last_test = test = p->tests;
|
|
|
|
|
uncond = is_unconditional (test, subroutine_type);
|
|
|
|
|
if (uncond == 0)
|
|
|
|
|
{
|
|
|
|
|
printf (" if (");
|
|
|
|
|
write_cond (test, depth, subroutine_type);
|
|
|
|
|
|
|
|
|
|
while ((test = test->next) != NULL)
|
|
|
|
|
{
|
|
|
|
|
last_test = test;
|
2004-01-28 22:07:09 +01:00
|
|
|
|
if (is_unconditional (test, subroutine_type))
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
printf ("\n && ");
|
|
|
|
|
write_cond (test, depth, subroutine_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf (")\n");
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
write_action (p, last_test, depth, uncond, p->success.first, subroutine_type);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
return uncond > 0;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Emit code for all of the sibling nodes of HEAD. */
|
|
|
|
|
|
1991-11-24 20:57:16 +01:00
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_tree_1 (struct decision_head *head, int depth,
|
|
|
|
|
enum routine_type subroutine_type)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision *p, *next;
|
|
|
|
|
int uncond = 0;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (p = head->first; p ; p = next)
|
|
|
|
|
{
|
|
|
|
|
/* The label for the first element was printed in write_tree. */
|
|
|
|
|
if (p != head->first && p->need_label)
|
|
|
|
|
OUTPUT_LABEL (" ", p->number);
|
|
|
|
|
|
|
|
|
|
/* Attempt to write a switch statement for a whole sequence. */
|
|
|
|
|
next = write_switch (p, depth);
|
|
|
|
|
if (p != next)
|
|
|
|
|
uncond = 0;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Failed -- fall back and write one node. */
|
|
|
|
|
uncond = write_node (p, depth, subroutine_type);
|
|
|
|
|
next = p->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Finished with this chain. Close a fallthru path by branching
|
|
|
|
|
to the afterward node. */
|
|
|
|
|
if (! uncond)
|
|
|
|
|
write_afterward (head->last, head->last->afterward, " ");
|
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Write out the decision tree starting at HEAD. PREVPOS is the
|
|
|
|
|
position at the node that branched to this node. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_tree (struct decision_head *head, const char *prevpos,
|
|
|
|
|
enum routine_type type, int initial)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
struct decision *p = head->first;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
putchar ('\n');
|
|
|
|
|
if (p->need_label)
|
|
|
|
|
OUTPUT_LABEL (" ", p->number);
|
|
|
|
|
|
|
|
|
|
if (! initial && p->subroutine_number > 0)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static const char * const name_prefix[] = {
|
|
|
|
|
"recog", "split", "peephole2"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const char * const call_suffix[] = {
|
2000-05-27 22:23:15 +02:00
|
|
|
|
", pnum_clobbers", "", ", _pmatch_len"
|
1999-10-05 07:18:54 +02:00
|
|
|
|
};
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* This node has been broken out into a separate subroutine.
|
|
|
|
|
Call it, test the result, and branch accordingly. */
|
|
|
|
|
|
|
|
|
|
if (p->afterward)
|
1991-12-28 12:36:37 +01:00
|
|
|
|
{
|
|
|
|
|
printf (" tem = %s_%d (x0, insn%s);\n",
|
1999-10-05 07:18:54 +02:00
|
|
|
|
name_prefix[type], p->subroutine_number, call_suffix[type]);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
if (IS_SPLIT (type))
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" if (tem != 0)\n return tem;\n");
|
1992-10-20 08:51:30 +01:00
|
|
|
|
else
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" if (tem >= 0)\n return tem;\n");
|
|
|
|
|
|
2005-08-27 04:08:29 +02:00
|
|
|
|
change_state (p->position, p->afterward->position, " ");
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf (" goto L%d;\n", p->afterward->number);
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
printf (" return %s_%d (x0, insn%s);\n",
|
|
|
|
|
name_prefix[type], p->subroutine_number, call_suffix[type]);
|
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int depth = strlen (p->position);
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
2005-08-27 04:08:29 +02:00
|
|
|
|
change_state (prevpos, p->position, " ");
|
1999-10-05 07:18:54 +02:00
|
|
|
|
write_tree_1 (head, depth, type);
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (p = head->first; p; p = p->next)
|
|
|
|
|
if (p->success.first)
|
|
|
|
|
write_tree (&p->success, p->position, type, 0);
|
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Write out a subroutine of type TYPE to do comparisons starting at
|
|
|
|
|
node TREE. */
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_subroutine (struct decision_head *head, enum routine_type type)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
1999-10-13 19:22:40 +02:00
|
|
|
|
int subfunction = head->first ? head->first->subroutine_number : 0;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
const char *s_or_e;
|
|
|
|
|
char extension[32];
|
|
|
|
|
int i;
|
2001-07-03 08:22:01 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
s_or_e = subfunction ? "static " : "";
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (subfunction)
|
|
|
|
|
sprintf (extension, "_%d", subfunction);
|
|
|
|
|
else if (type == RECOG)
|
|
|
|
|
extension[0] = '\0';
|
|
|
|
|
else
|
|
|
|
|
strcpy (extension, "_insns");
|
|
|
|
|
|
c-common.c (check_format_info): Don't call a variadic function with a non-literal format string.
* c-common.c (check_format_info): Don't call a variadic function
with a non-literal format string.
* c-decl.c (grokdeclarator, start_struct, finish_struct): Likewise.
* c-typeck.c (build_component_ref, build_unary_op, lvalue_or_else,
pedantic_lvalue_warning, error_init, pedwarn_init, warning_init):
Likewise.
* cccp.c (check_macro_name, do_xifdef, vwarning_with_line):
Likewise.
* collect2.c (collect_wait): Likewise.
* dbxout.c (dbxout_type): Likewise.
* gcc.c (do_spec_1): Likewise.
* genemit.c (gen_insn, gen_expand): Likewise.
* genrecog.c (write_switch, write_subroutine): Likewise.
* mips-tfile.c (catch_signal, botch): Likewise.
* print-rtl.c (print_rtx): Likewise.
* toplev.c (default_print_error_function, report_error_function,
_fatal_insn): Likewise.
From-SVN: r30666
1999-11-25 17:58:32 +01:00
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case RECOG:
|
|
|
|
|
printf ("%sint\n\
|
2003-07-05 07:27:22 +02:00
|
|
|
|
recog%s (rtx x0 ATTRIBUTE_UNUSED,\n\trtx insn ATTRIBUTE_UNUSED,\n\tint *pnum_clobbers ATTRIBUTE_UNUSED)\n", s_or_e, extension);
|
c-common.c (check_format_info): Don't call a variadic function with a non-literal format string.
* c-common.c (check_format_info): Don't call a variadic function
with a non-literal format string.
* c-decl.c (grokdeclarator, start_struct, finish_struct): Likewise.
* c-typeck.c (build_component_ref, build_unary_op, lvalue_or_else,
pedantic_lvalue_warning, error_init, pedwarn_init, warning_init):
Likewise.
* cccp.c (check_macro_name, do_xifdef, vwarning_with_line):
Likewise.
* collect2.c (collect_wait): Likewise.
* dbxout.c (dbxout_type): Likewise.
* gcc.c (do_spec_1): Likewise.
* genemit.c (gen_insn, gen_expand): Likewise.
* genrecog.c (write_switch, write_subroutine): Likewise.
* mips-tfile.c (catch_signal, botch): Likewise.
* print-rtl.c (print_rtx): Likewise.
* toplev.c (default_print_error_function, report_error_function,
_fatal_insn): Likewise.
From-SVN: r30666
1999-11-25 17:58:32 +01:00
|
|
|
|
break;
|
|
|
|
|
case SPLIT:
|
|
|
|
|
printf ("%srtx\n\
|
2003-07-05 07:27:22 +02:00
|
|
|
|
split%s (rtx x0 ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n",
|
|
|
|
|
s_or_e, extension);
|
c-common.c (check_format_info): Don't call a variadic function with a non-literal format string.
* c-common.c (check_format_info): Don't call a variadic function
with a non-literal format string.
* c-decl.c (grokdeclarator, start_struct, finish_struct): Likewise.
* c-typeck.c (build_component_ref, build_unary_op, lvalue_or_else,
pedantic_lvalue_warning, error_init, pedwarn_init, warning_init):
Likewise.
* cccp.c (check_macro_name, do_xifdef, vwarning_with_line):
Likewise.
* collect2.c (collect_wait): Likewise.
* dbxout.c (dbxout_type): Likewise.
* gcc.c (do_spec_1): Likewise.
* genemit.c (gen_insn, gen_expand): Likewise.
* genrecog.c (write_switch, write_subroutine): Likewise.
* mips-tfile.c (catch_signal, botch): Likewise.
* print-rtl.c (print_rtx): Likewise.
* toplev.c (default_print_error_function, report_error_function,
_fatal_insn): Likewise.
From-SVN: r30666
1999-11-25 17:58:32 +01:00
|
|
|
|
break;
|
|
|
|
|
case PEEPHOLE2:
|
|
|
|
|
printf ("%srtx\n\
|
2003-07-05 07:27:22 +02:00
|
|
|
|
peephole2%s (rtx x0 ATTRIBUTE_UNUSED,\n\trtx insn ATTRIBUTE_UNUSED,\n\tint *_pmatch_len ATTRIBUTE_UNUSED)\n",
|
|
|
|
|
s_or_e, extension);
|
c-common.c (check_format_info): Don't call a variadic function with a non-literal format string.
* c-common.c (check_format_info): Don't call a variadic function
with a non-literal format string.
* c-decl.c (grokdeclarator, start_struct, finish_struct): Likewise.
* c-typeck.c (build_component_ref, build_unary_op, lvalue_or_else,
pedantic_lvalue_warning, error_init, pedwarn_init, warning_init):
Likewise.
* cccp.c (check_macro_name, do_xifdef, vwarning_with_line):
Likewise.
* collect2.c (collect_wait): Likewise.
* dbxout.c (dbxout_type): Likewise.
* gcc.c (do_spec_1): Likewise.
* genemit.c (gen_insn, gen_expand): Likewise.
* genrecog.c (write_switch, write_subroutine): Likewise.
* mips-tfile.c (catch_signal, botch): Likewise.
* print-rtl.c (print_rtx): Likewise.
* toplev.c (default_print_error_function, report_error_function,
_fatal_insn): Likewise.
From-SVN: r30666
1999-11-25 17:58:32 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
2001-10-11 05:16:15 +02:00
|
|
|
|
printf ("{\n rtx * const operands ATTRIBUTE_UNUSED = &recog_data.operand[0];\n");
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (i = 1; i <= max_depth; i++)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
printf (" rtx x%d ATTRIBUTE_UNUSED;\n", i);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
printf (" %s tem ATTRIBUTE_UNUSED;\n", IS_SPLIT (type) ? "rtx" : "int");
|
|
|
|
|
|
2000-09-12 01:54:11 +02:00
|
|
|
|
if (!subfunction)
|
|
|
|
|
printf (" recog_data.insn = NULL_RTX;\n");
|
|
|
|
|
|
1999-10-13 19:22:40 +02:00
|
|
|
|
if (head->first)
|
|
|
|
|
write_tree (head, "", type, 1);
|
|
|
|
|
else
|
|
|
|
|
printf (" goto ret0;\n");
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
printf (" ret0:\n return %d;\n}\n\n", IS_SPLIT (type) ? 0 : -1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* In break_out_subroutines, we discovered the boundaries for the
|
|
|
|
|
subroutines, but did not write them out. Do so now. */
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1991-11-24 20:57:16 +01:00
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_subroutines (struct decision_head *head, enum routine_type type)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision *p;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (p = head->first; p ; p = p->next)
|
|
|
|
|
if (p->success.first)
|
|
|
|
|
write_subroutines (&p->success, type);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (head->first->subroutine_number > 0)
|
|
|
|
|
write_subroutine (head, type);
|
|
|
|
|
}
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Begin the output file. */
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
write_header (void)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
puts ("\
|
|
|
|
|
/* Generated automatically by the program `genrecog' from the target\n\
|
|
|
|
|
machine description file. */\n\
|
|
|
|
|
\n\
|
|
|
|
|
#include \"config.h\"\n\
|
|
|
|
|
#include \"system.h\"\n\
|
2002-12-16 19:23:00 +01:00
|
|
|
|
#include \"coretypes.h\"\n\
|
|
|
|
|
#include \"tm.h\"\n\
|
1999-10-05 07:18:54 +02:00
|
|
|
|
#include \"rtl.h\"\n\
|
|
|
|
|
#include \"tm_p.h\"\n\
|
|
|
|
|
#include \"function.h\"\n\
|
|
|
|
|
#include \"insn-config.h\"\n\
|
|
|
|
|
#include \"recog.h\"\n\
|
|
|
|
|
#include \"real.h\"\n\
|
|
|
|
|
#include \"output.h\"\n\
|
|
|
|
|
#include \"flags.h\"\n\
|
1999-10-08 19:10:19 +02:00
|
|
|
|
#include \"hard-reg-set.h\"\n\
|
|
|
|
|
#include \"resource.h\"\n\
|
2001-04-11 20:36:50 +02:00
|
|
|
|
#include \"toplev.h\"\n\
|
2001-07-03 08:22:01 +02:00
|
|
|
|
#include \"reload.h\"\n\
|
2006-03-29 23:07:12 +02:00
|
|
|
|
#include \"tm-constrs.h\"\n\
|
1999-10-05 07:18:54 +02:00
|
|
|
|
\n");
|
|
|
|
|
|
|
|
|
|
puts ("\n\
|
|
|
|
|
/* `recog' contains a decision tree that recognizes whether the rtx\n\
|
|
|
|
|
X0 is a valid instruction.\n\
|
|
|
|
|
\n\
|
|
|
|
|
recog returns -1 if the rtx is not valid. If the rtx is valid, recog\n\
|
|
|
|
|
returns a nonnegative number which is the insn code number for the\n\
|
|
|
|
|
pattern that matched. This is the same as the order in the machine\n\
|
|
|
|
|
description of the entry that matched. This number can be used as an\n\
|
2000-07-13 22:33:09 +02:00
|
|
|
|
index into `insn_data' and other tables.\n");
|
|
|
|
|
puts ("\
|
1999-10-05 07:18:54 +02:00
|
|
|
|
The third argument to recog is an optional pointer to an int. If\n\
|
|
|
|
|
present, recog will accept a pattern if it matches except for missing\n\
|
|
|
|
|
CLOBBER expressions at the end. In that case, the value pointed to by\n\
|
|
|
|
|
the optional pointer will be set to the number of CLOBBERs that need\n\
|
2000-07-13 22:33:09 +02:00
|
|
|
|
to be added (it should be initialized to zero by the caller). If it");
|
|
|
|
|
puts ("\
|
1999-10-05 07:18:54 +02:00
|
|
|
|
is set nonzero, the caller should allocate a PARALLEL of the\n\
|
|
|
|
|
appropriate size, copy the initial entries, and call add_clobbers\n\
|
|
|
|
|
(found in insn-emit.c) to fill in the CLOBBERs.\n\
|
|
|
|
|
");
|
|
|
|
|
|
|
|
|
|
puts ("\n\
|
|
|
|
|
The function split_insns returns 0 if the rtl could not\n\
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
be split or the split rtl as an INSN list if it can be.\n\
|
1999-10-05 07:18:54 +02:00
|
|
|
|
\n\
|
|
|
|
|
The function peephole2_insns returns 0 if the rtl could not\n\
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
be matched. If there was a match, the new rtl is returned in an INSN list,\n\
|
1999-10-05 07:18:54 +02:00
|
|
|
|
and LAST_INSN will point to the last recognized insn in the old sequence.\n\
|
|
|
|
|
*/\n\n");
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
/* Construct and return a sequence of decisions
|
|
|
|
|
that will recognize INSN.
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
TYPE says what type of routine we are recognizing (RECOG or SPLIT). */
|
|
|
|
|
|
|
|
|
|
static struct decision_head
|
2003-06-01 17:59:10 +02:00
|
|
|
|
make_insn_sequence (rtx insn, enum routine_type type)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
rtx x;
|
|
|
|
|
const char *c_test = XSTR (insn, type == RECOG ? 2 : 1);
|
2002-07-29 20:02:47 +02:00
|
|
|
|
int truth = maybe_eval_c_test (c_test);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision *last;
|
|
|
|
|
struct decision_test *test, **place;
|
|
|
|
|
struct decision_head head;
|
top level:
* Makefile.in (WARN_CFLAGS): Add -Wwrite-strings.
(tree.o): Depend on output.h.
* c-decl.c (pending_invalid_xref_file,
current_function_prototype_file): Constify.
(pushdecl): Constify a local char *.
(define_label): Constify filename parameter.
* c-lex.c (init_parse): Constify parameter and return value.
* c-typeck.c (c_expand_asm_operands): Constify filename parameter.
* c-tree.h: Update prototypes.
* c-parse.in: Constify filename member of %union, and if_stmt_file.
* c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y,
objc/objc-parse.c: Regenerate.
* dwarfout.c (dwarfout_init): Constify main_input_filename parameter.
* dwarfout.h: Update prototypes.
* expr.c (expand_expr): Constify a local char *.
* flags.h: Constify main_input_filename.
* function.c (expand_function_end): Constify filename parameter.
* genrecog.c (make_insn_sequence): Use a character array for
c_test_pos.
(main): Remove unused variables.
* input.h: Constify input_filename, main_input_filename, and
file_stack.name. Update prototypes.
* output.h: Declare first_global_object_name and
weak_global_object_name here, as const char *.
* stmt.c (expand_asm_operands): Constify filename parameter.
* toplev.c (compile_file, push_srcloc, debug_start_source_file):
Constify filename parameter.
(input_filename, main_input_filename): Constify.
* toplev.h: Update prototypes.
* tree.c: Include output.h. Don't declare
first_global_object_name or weak_global_object_name. Clean up string
bashing in get_file_function_name_long.
* tree.h (struct tree_decl): Constify filename member.
(input_filename): Constify.
Update prototypes.
* varasm.c (first_global_object_name, weak_global_object_name):
Constify.
(assemble_start_function, assemble_variable): Clean up string bashing.
* gcc.c: Constify all spec-related strings initialized,
transitively, from string constants. Constify all strings
and string variables related to multilibs.
(set_spec, read_specs): Cast argument to free to PTR.
(used_arg): Do not modify multilib_matches. Use strncmp plus
length comparison to compare multilib switches.
* genmultilib: Constify everything declared in multilib.h.
ch:
* ch-tree.h: Update prototypes. Remove prototypes for
functions declared elsewhere.
* decl.c (define_label): Constify filename parameter.
* grant.c (globalize_decl, set_default_grant_file): Constify
local char * variables. Don't declare
first_global_object_name or asm_out_file.
* lang.c (chill_real_input_filename): Constify.
* lex.c (init_parse): Constify parameter and return value.
* parse.c: Don't declare input_filename.
(ch_expand_asm_operands): Constify filename parameter.
(parse_multi_dimension_case_action): Constify local char *.
* satisfy.c (safe_satisfy_decl): Constify local char *.
cp:
* cp-tree.h: Constify tree_srcloc.filename, tinst_level.file,
and pending_inline.filename. Update prototypes.
* decl.c (define_label): Constify filename parameter.
* decl2.c (warn_if_unknown_interface): Constify local char *.
* input.c Constify input_source.filename. Don't declare
input_filename or lineno. Constify filename parameter to feed_input.
* lex.c (init_parse): Constify parameter and return value.
(cp_pragma_interface, cp_pragma_implementation): Constify
filename argument.
(reinit_parse_for_method, reinit_parse_for_block,
reinit_parse_for_expr, feed_defarg, handle_cp_pragma):
Constify local char *.
* pt.c: Don't declare lineno or input_filename.
(print_template_context, tsubst_friend_function, tsubst_decl,
tsubst, instantiate_decl): Constify local char *.
* semantics.c (expand_body): Constify local char *.
* tree.c (build_srcloc): Constify filename parameter.
* typeck.c (c_expand_asm_operands): Constify filename
parameter.
f:
* com.c (ffecom_subscript_check_): Constify array_name
parameter. Clean up string bashing.
(ffecom_arrayref_, ffecom_char_args_x_): Constify array_name
parameter.
(ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_,
ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify
local char *.
(init_parse): Constify parameter and return value.
* lex.c: Include dwarfout.h instead of prototyping dwarfout_*
functions here.
(ffelex_file_pop_, ffelex_file_push_): Constify filename parameter.
(ffelex_hash_, ffelex_include_): Constify local char *.
* std.c (ffestd_exec_end): Constify local char *.
* where.c (ffewhere_file_new): Constify filename parameter.
* where.h: Update prototypes.
java:
* check_init.c (check_init): Constify local char *.
* class.c (push_class): Constify local char *.
* java_tree.h: Update prototypes.
* jcf-io.c (open_class): Constify filename parameter and
return value.
(find_class): Remove redundant string copy. Cast return from
open_class.
* jcf-parse.c (read_class, parse_class_file, yyparse):
Constify local char *.
* jcf-write.c (generate_bytecode_insns, generate_classfile):
Constify local char *.
* jcf.h (JCF): Constify filename and classname.
(JCF_FINISH): Cast args to FREE to char * when appropriate.
* lang.c (init_parse): Constify parameter and return value.
* lex.c (java_get_line_col): Constify filename parameter.
* parse.h: Constify parser_ctxt.filename. Update prototypes.
* parse.y (java_parser_context_suspend,
issue_warning_error_from_context, safe_layout_class): Constify
local char *.
* parse.c: Regenerate.
From-SVN: r33804
2000-05-09 21:56:01 +02:00
|
|
|
|
char c_test_pos[2];
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
2002-07-29 20:02:47 +02:00
|
|
|
|
/* We should never see an insn whose C test is false at compile time. */
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_assert (truth);
|
2002-07-29 20:02:47 +02:00
|
|
|
|
|
top level:
* Makefile.in (WARN_CFLAGS): Add -Wwrite-strings.
(tree.o): Depend on output.h.
* c-decl.c (pending_invalid_xref_file,
current_function_prototype_file): Constify.
(pushdecl): Constify a local char *.
(define_label): Constify filename parameter.
* c-lex.c (init_parse): Constify parameter and return value.
* c-typeck.c (c_expand_asm_operands): Constify filename parameter.
* c-tree.h: Update prototypes.
* c-parse.in: Constify filename member of %union, and if_stmt_file.
* c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y,
objc/objc-parse.c: Regenerate.
* dwarfout.c (dwarfout_init): Constify main_input_filename parameter.
* dwarfout.h: Update prototypes.
* expr.c (expand_expr): Constify a local char *.
* flags.h: Constify main_input_filename.
* function.c (expand_function_end): Constify filename parameter.
* genrecog.c (make_insn_sequence): Use a character array for
c_test_pos.
(main): Remove unused variables.
* input.h: Constify input_filename, main_input_filename, and
file_stack.name. Update prototypes.
* output.h: Declare first_global_object_name and
weak_global_object_name here, as const char *.
* stmt.c (expand_asm_operands): Constify filename parameter.
* toplev.c (compile_file, push_srcloc, debug_start_source_file):
Constify filename parameter.
(input_filename, main_input_filename): Constify.
* toplev.h: Update prototypes.
* tree.c: Include output.h. Don't declare
first_global_object_name or weak_global_object_name. Clean up string
bashing in get_file_function_name_long.
* tree.h (struct tree_decl): Constify filename member.
(input_filename): Constify.
Update prototypes.
* varasm.c (first_global_object_name, weak_global_object_name):
Constify.
(assemble_start_function, assemble_variable): Clean up string bashing.
* gcc.c: Constify all spec-related strings initialized,
transitively, from string constants. Constify all strings
and string variables related to multilibs.
(set_spec, read_specs): Cast argument to free to PTR.
(used_arg): Do not modify multilib_matches. Use strncmp plus
length comparison to compare multilib switches.
* genmultilib: Constify everything declared in multilib.h.
ch:
* ch-tree.h: Update prototypes. Remove prototypes for
functions declared elsewhere.
* decl.c (define_label): Constify filename parameter.
* grant.c (globalize_decl, set_default_grant_file): Constify
local char * variables. Don't declare
first_global_object_name or asm_out_file.
* lang.c (chill_real_input_filename): Constify.
* lex.c (init_parse): Constify parameter and return value.
* parse.c: Don't declare input_filename.
(ch_expand_asm_operands): Constify filename parameter.
(parse_multi_dimension_case_action): Constify local char *.
* satisfy.c (safe_satisfy_decl): Constify local char *.
cp:
* cp-tree.h: Constify tree_srcloc.filename, tinst_level.file,
and pending_inline.filename. Update prototypes.
* decl.c (define_label): Constify filename parameter.
* decl2.c (warn_if_unknown_interface): Constify local char *.
* input.c Constify input_source.filename. Don't declare
input_filename or lineno. Constify filename parameter to feed_input.
* lex.c (init_parse): Constify parameter and return value.
(cp_pragma_interface, cp_pragma_implementation): Constify
filename argument.
(reinit_parse_for_method, reinit_parse_for_block,
reinit_parse_for_expr, feed_defarg, handle_cp_pragma):
Constify local char *.
* pt.c: Don't declare lineno or input_filename.
(print_template_context, tsubst_friend_function, tsubst_decl,
tsubst, instantiate_decl): Constify local char *.
* semantics.c (expand_body): Constify local char *.
* tree.c (build_srcloc): Constify filename parameter.
* typeck.c (c_expand_asm_operands): Constify filename
parameter.
f:
* com.c (ffecom_subscript_check_): Constify array_name
parameter. Clean up string bashing.
(ffecom_arrayref_, ffecom_char_args_x_): Constify array_name
parameter.
(ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_,
ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify
local char *.
(init_parse): Constify parameter and return value.
* lex.c: Include dwarfout.h instead of prototyping dwarfout_*
functions here.
(ffelex_file_pop_, ffelex_file_push_): Constify filename parameter.
(ffelex_hash_, ffelex_include_): Constify local char *.
* std.c (ffestd_exec_end): Constify local char *.
* where.c (ffewhere_file_new): Constify filename parameter.
* where.h: Update prototypes.
java:
* check_init.c (check_init): Constify local char *.
* class.c (push_class): Constify local char *.
* java_tree.h: Update prototypes.
* jcf-io.c (open_class): Constify filename parameter and
return value.
(find_class): Remove redundant string copy. Cast return from
open_class.
* jcf-parse.c (read_class, parse_class_file, yyparse):
Constify local char *.
* jcf-write.c (generate_bytecode_insns, generate_classfile):
Constify local char *.
* jcf.h (JCF): Constify filename and classname.
(JCF_FINISH): Cast args to FREE to char * when appropriate.
* lang.c (init_parse): Constify parameter and return value.
* lex.c (java_get_line_col): Constify filename parameter.
* parse.h: Constify parser_ctxt.filename. Update prototypes.
* parse.y (java_parser_context_suspend,
issue_warning_error_from_context, safe_layout_class): Constify
local char *.
* parse.c: Regenerate.
From-SVN: r33804
2000-05-09 21:56:01 +02:00
|
|
|
|
c_test_pos[0] = '\0';
|
1999-10-05 07:18:54 +02:00
|
|
|
|
if (type == PEEPHOLE2)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
|
|
/* peephole2 gets special treatment:
|
|
|
|
|
- X always gets an outer parallel even if it's only one entry
|
|
|
|
|
- we remove all traces of outer-level match_scratch and match_dup
|
|
|
|
|
expressions here. */
|
|
|
|
|
x = rtx_alloc (PARALLEL);
|
|
|
|
|
PUT_MODE (x, VOIDmode);
|
|
|
|
|
XVEC (x, 0) = rtvec_alloc (XVECLEN (insn, 0));
|
|
|
|
|
for (i = j = 0; i < XVECLEN (insn, 0); i++)
|
1999-08-31 22:37:09 +02:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
rtx tmp = XVECEXP (insn, 0, i);
|
|
|
|
|
if (GET_CODE (tmp) != MATCH_SCRATCH && GET_CODE (tmp) != MATCH_DUP)
|
|
|
|
|
{
|
|
|
|
|
XVECEXP (x, 0, j) = tmp;
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
XVECLEN (x, 0) = j;
|
2000-04-07 09:16:59 +02:00
|
|
|
|
|
|
|
|
|
c_test_pos[0] = 'A' + j - 1;
|
|
|
|
|
c_test_pos[1] = '\0';
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
else if (XVECLEN (insn, type == RECOG) == 1)
|
|
|
|
|
x = XVECEXP (insn, type == RECOG, 0);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
x = rtx_alloc (PARALLEL);
|
|
|
|
|
XVEC (x, 0) = XVEC (insn, type == RECOG);
|
|
|
|
|
PUT_MODE (x, VOIDmode);
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-09 23:06:52 +01:00
|
|
|
|
validate_pattern (x, insn, NULL_RTX, 0);
|
1999-10-14 05:43:49 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
memset(&head, 0, sizeof(head));
|
|
|
|
|
last = add_to_sequence (x, &head, "", type, 1);
|
|
|
|
|
|
|
|
|
|
/* Find the end of the test chain on the last node. */
|
|
|
|
|
for (test = last->tests; test->next; test = test->next)
|
|
|
|
|
continue;
|
|
|
|
|
place = &test->next;
|
|
|
|
|
|
2002-07-29 20:02:47 +02:00
|
|
|
|
/* Skip the C test if it's known to be true at compile time. */
|
|
|
|
|
if (truth == -1)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
/* Need a new node if we have another test to add. */
|
|
|
|
|
if (test->type == DT_accept_op)
|
|
|
|
|
{
|
2000-04-07 09:16:59 +02:00
|
|
|
|
last = new_decision (c_test_pos, &last->success);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
place = &last->tests;
|
|
|
|
|
}
|
|
|
|
|
test = new_decision_test (DT_c_test, &place);
|
|
|
|
|
test->u.c_test = c_test;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test = new_decision_test (DT_accept_insn, &place);
|
|
|
|
|
test->u.insn.code_number = next_insn_code;
|
1999-10-14 05:43:49 +02:00
|
|
|
|
test->u.insn.lineno = pattern_lineno;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test->u.insn.num_clobbers_to_add = 0;
|
|
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case RECOG:
|
2003-06-23 18:11:56 +02:00
|
|
|
|
/* If this is a DEFINE_INSN and X is a PARALLEL, see if it ends
|
1999-10-05 07:18:54 +02:00
|
|
|
|
with a group of CLOBBERs of (hard) registers or MATCH_SCRATCHes.
|
|
|
|
|
If so, set up to recognize the pattern without these CLOBBERs. */
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) == PARALLEL)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
/* Find the last non-clobber in the parallel. */
|
|
|
|
|
for (i = XVECLEN (x, 0); i > 0; i--)
|
1999-08-31 22:37:09 +02:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
rtx y = XVECEXP (x, 0, i - 1);
|
|
|
|
|
if (GET_CODE (y) != CLOBBER
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
|| (!REG_P (XEXP (y, 0))
|
1999-10-05 07:18:54 +02:00
|
|
|
|
&& GET_CODE (XEXP (y, 0)) != MATCH_SCRATCH))
|
|
|
|
|
break;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
if (i != XVECLEN (x, 0))
|
1999-08-31 22:37:09 +02:00
|
|
|
|
{
|
1999-10-05 07:18:54 +02:00
|
|
|
|
rtx new;
|
|
|
|
|
struct decision_head clobber_head;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Build a similar insn without the clobbers. */
|
|
|
|
|
if (i == 1)
|
|
|
|
|
new = XVECEXP (x, 0, 0);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
else
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
int j;
|
|
|
|
|
|
|
|
|
|
new = rtx_alloc (PARALLEL);
|
|
|
|
|
XVEC (new, 0) = rtvec_alloc (i);
|
|
|
|
|
for (j = i - 1; j >= 0; j--)
|
|
|
|
|
XVECEXP (new, 0, j) = XVECEXP (x, 0, j);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Recognize it. */
|
|
|
|
|
memset (&clobber_head, 0, sizeof(clobber_head));
|
|
|
|
|
last = add_to_sequence (new, &clobber_head, "", type, 1);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
/* Find the end of the test chain on the last node. */
|
|
|
|
|
for (test = last->tests; test->next; test = test->next)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* We definitely have a new test to add -- create a new
|
|
|
|
|
node if needed. */
|
|
|
|
|
place = &test->next;
|
|
|
|
|
if (test->type == DT_accept_op)
|
|
|
|
|
{
|
|
|
|
|
last = new_decision ("", &last->success);
|
|
|
|
|
place = &last->tests;
|
|
|
|
|
}
|
|
|
|
|
|
2002-07-29 20:02:47 +02:00
|
|
|
|
/* Skip the C test if it's known to be true at compile
|
|
|
|
|
time. */
|
|
|
|
|
if (truth == -1)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
test = new_decision_test (DT_c_test, &place);
|
|
|
|
|
test->u.c_test = c_test;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test = new_decision_test (DT_accept_insn, &place);
|
|
|
|
|
test->u.insn.code_number = next_insn_code;
|
1999-10-14 05:43:49 +02:00
|
|
|
|
test->u.insn.lineno = pattern_lineno;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test->u.insn.num_clobbers_to_add = XVECLEN (x, 0) - i;
|
|
|
|
|
|
|
|
|
|
merge_trees (&head, &clobber_head);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SPLIT:
|
|
|
|
|
/* Define the subroutine we will call below and emit in genemit. */
|
2004-04-02 01:30:25 +02:00
|
|
|
|
printf ("extern rtx gen_split_%d (rtx, rtx *);\n", next_insn_code);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PEEPHOLE2:
|
|
|
|
|
/* Define the subroutine we will call below and emit in genemit. */
|
2003-06-01 17:59:10 +02:00
|
|
|
|
printf ("extern rtx gen_peephole2_%d (rtx, rtx *);\n",
|
1999-10-05 07:18:54 +02:00
|
|
|
|
next_insn_code);
|
|
|
|
|
break;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
return head;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
process_tree (struct decision_head *head, enum routine_type subroutine_type)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
1999-10-14 06:07:03 +02:00
|
|
|
|
if (head->first == NULL)
|
|
|
|
|
{
|
|
|
|
|
/* We can elide peephole2_insns, but not recog or split_insns. */
|
|
|
|
|
if (subroutine_type == PEEPHOLE2)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
1999-10-13 19:22:40 +02:00
|
|
|
|
{
|
|
|
|
|
factor_tests (head);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-13 19:22:40 +02:00
|
|
|
|
next_subroutine_number = 0;
|
|
|
|
|
break_out_subroutines (head, 1);
|
|
|
|
|
find_afterward (head, NULL);
|
1999-09-15 16:13:50 +02:00
|
|
|
|
|
1999-10-14 06:07:03 +02:00
|
|
|
|
/* We run this after find_afterward, because find_afterward needs
|
|
|
|
|
the redundant DT_mode tests on predicates to determine whether
|
|
|
|
|
two tests can both be true or not. */
|
|
|
|
|
simplify_tests(head);
|
|
|
|
|
|
1999-10-13 19:22:40 +02:00
|
|
|
|
write_subroutines (head, subroutine_type);
|
|
|
|
|
}
|
1999-10-14 06:07:03 +02:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
write_subroutine (head, subroutine_type);
|
|
|
|
|
}
|
|
|
|
|
|
2003-06-01 17:59:10 +02:00
|
|
|
|
extern int main (int, char **);
|
1999-10-24 21:23:11 +02:00
|
|
|
|
|
1991-11-24 20:57:16 +01:00
|
|
|
|
int
|
2003-06-01 17:59:10 +02:00
|
|
|
|
main (int argc, char **argv)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
|
|
|
|
rtx desc;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision_head recog_tree, split_tree, peephole2_tree, h;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
errors.c: New file...
1999-08-27 00:27 -0700 Zack Weinberg <zack@bitmover.com>
* errors.c: New file; defines functions error, warning, and
fatal, variables have_error and progname.
* errors.h: New file; prototypes and decls for stuff in errors.c.
* Makefile: Add rules to build errors.o and
$(HOST_PREFIX)errors.o. Link genconfig, gencodes, genemit,
genopinit, genrecog, genextract, genpeep, genattr, and
genoutput with errors.o. Add errors.h to deps of genconfig.o,
gencodes.o, genemit.o, genopinit.o, genrecog.o, genextract.o,
genpeep.o, genattr.o, and genoutput.o.
* genconfig.c, gencodes.c, genemit.c, genopinit.c, genrecog.c,
genextract.c, genpeep.c, genattr.c: Include errors.h. Don't
define or prototype fatal. Set progname at beginning of main.
* genoutput.c: Likewise, and don't define or prototype error
either.
From-SVN: r28925
1999-08-27 09:47:17 +02:00
|
|
|
|
progname = "genrecog";
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
memset (&recog_tree, 0, sizeof recog_tree);
|
|
|
|
|
memset (&split_tree, 0, sizeof split_tree);
|
|
|
|
|
memset (&peephole2_tree, 0, sizeof peephole2_tree);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2001-11-14 21:17:08 +01:00
|
|
|
|
if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
|
2000-05-03 19:45:26 +02:00
|
|
|
|
return (FATAL_EXIT_CODE);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
next_insn_code = 0;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
write_header ();
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
|
|
|
|
/* Read the machine description. */
|
|
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
2000-05-03 19:45:26 +02:00
|
|
|
|
desc = read_md_rtx (&pattern_lineno, &next_insn_code);
|
|
|
|
|
if (desc == NULL)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
break;
|
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
switch (GET_CODE (desc))
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
case DEFINE_PREDICATE:
|
|
|
|
|
case DEFINE_SPECIAL_PREDICATE:
|
|
|
|
|
process_define_predicate (desc);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DEFINE_INSN:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
h = make_insn_sequence (desc, RECOG);
|
|
|
|
|
merge_trees (&recog_tree, &h);
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DEFINE_SPLIT:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
h = make_insn_sequence (desc, SPLIT);
|
|
|
|
|
merge_trees (&split_tree, &h);
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DEFINE_PEEPHOLE2:
|
1999-10-05 07:18:54 +02:00
|
|
|
|
h = make_insn_sequence (desc, PEEPHOLE2);
|
|
|
|
|
merge_trees (&peephole2_tree, &h);
|
2001-07-03 08:22:01 +02:00
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
default:
|
|
|
|
|
/* do nothing */;
|
|
|
|
|
}
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
genpreds.c: Add capability to generate predicate bodies as well as function prototypes.
* genpreds.c: Add capability to generate predicate bodies as
well as function prototypes. Write function prototypes for
the generic predicates too.
(process_define_predicate, write_tm_preds_h, write_insn_preds_c)
(write_predicate_subfunction, mark_mode_tests, add_mode_tests)
(write_match_code, write_predicate_expr, write_one_predicate_function)
(parse_option): New functions.
(output_predicate_decls): Delete.
(main): Read the machine description, process DEFINE_PREDICATE or
DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c
as appropriate.
* genrecog.c (struct decision_test): Replace index with
struct pred_data pointer.
(next_index): Remove, unused.
(pred_table, preds, special_mode_pred_table): Delete.
(compute_predicate_codes, process_define_predicate): New functions.
(validate_pattern, add_to_sequence, write_switch): Update for
new data structures.
(main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
Check both error_count and have_error.
* gensupport.c (in_fname, first_predicate): New globals.
(define_pred_queue, define_pred_tail): New RTL-pattern queue.
(predicate_table, last_predicate, old_pred_table)
(old_special_pred_table): New statics.
(hash_struct_pred_data, eq_struct_pred_data, lookup_predicate)
(add_predicate, init_predicate_table): New functions.
(process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE.
(init_md_reader_args_cb): Use the global in_fname. No need to zero
it or max_include_len. Call init_predicate_table.
(read_rtx): Run the predicate queue after the attribute queue
but before all the others.
* gensupport.h (in_fname, struct pred_data, first_predicate)
(lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare.
* rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE)
(DEFINE_SPECIAL_PREDICATE): New RTL codes.
* dummy-conditions.c: Don't include bconfig.h, system.h,
coretypes.h, tm.h, or system.h. Do include stddef.h.
Duplicate declaration of struct c_test from gensupport.h.
* Makefile.in (OBJS-common): Add insn-preds.o.
(STAGESTUFF, .PRECIOUS): Add insn-preds.c.
(insn-preds.c, insn-preds.o): New rules.
(s-preds): Also generate insn-preds.c.
(dummy-conditions.o, genpreds$(build_exeext), genpreds.o):
Update dependencies.
(print-rtl.o, print-rtl1.o): Correct dependencies.
* recog.h: Delete prototypes of predicate functions.
* doc/md.texi (Predicates): New section with complete
documentation of operand/operator predicates. Remove some
incomplete documentation of predicates from other places.
* doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to
PREDICATE_CODES; indicate that both are deprecated in favor
of define_predicate/define_special_predicate.
* config/ia64/ia64.c: All predicate function definitions moved
to ia64.md, except
(small_addr_symbolic_operand, tls_symbolic_operand): Delete.
(ia64_expand_load_address, ia64_expand_move):
Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand.
* config/ia64/ia64.md: All predicates now defined here.
(symbolic_operand): Is now a special predicate.
* config/ia64/ia64.h: Declare ia64_section_threshold.
(PREDICATE_CODES): Delete.
From-SVN: r85855
2004-08-12 09:49:00 +02:00
|
|
|
|
if (error_count || have_error)
|
1999-10-14 05:43:49 +02:00
|
|
|
|
return FATAL_EXIT_CODE;
|
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
puts ("\n\n");
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
1999-10-05 07:18:54 +02:00
|
|
|
|
process_tree (&recog_tree, RECOG);
|
|
|
|
|
process_tree (&split_tree, SPLIT);
|
|
|
|
|
process_tree (&peephole2_tree, PEEPHOLE2);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
1991-11-24 20:57:16 +01:00
|
|
|
|
fflush (stdout);
|
1999-09-15 16:13:50 +02:00
|
|
|
|
return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
debug_decision_2 (struct decision_test *test)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
switch (test->type)
|
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
case DT_num_insns:
|
|
|
|
|
fprintf (stderr, "num_insns=%d", test->u.num_insns);
|
|
|
|
|
break;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_mode:
|
|
|
|
|
fprintf (stderr, "mode=%s", GET_MODE_NAME (test->u.mode));
|
|
|
|
|
break;
|
|
|
|
|
case DT_code:
|
|
|
|
|
fprintf (stderr, "code=%s", GET_RTX_NAME (test->u.code));
|
|
|
|
|
break;
|
|
|
|
|
case DT_veclen:
|
|
|
|
|
fprintf (stderr, "veclen=%d", test->u.veclen);
|
|
|
|
|
break;
|
|
|
|
|
case DT_elt_zero_int:
|
|
|
|
|
fprintf (stderr, "elt0_i=%d", (int) test->u.intval);
|
|
|
|
|
break;
|
|
|
|
|
case DT_elt_one_int:
|
|
|
|
|
fprintf (stderr, "elt1_i=%d", (int) test->u.intval);
|
|
|
|
|
break;
|
|
|
|
|
case DT_elt_zero_wide:
|
2003-05-17 03:40:45 +02:00
|
|
|
|
fprintf (stderr, "elt0_w=" HOST_WIDE_INT_PRINT_DEC, test->u.intval);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
2001-05-18 22:53:55 +02:00
|
|
|
|
case DT_elt_zero_wide_safe:
|
2003-05-17 03:40:45 +02:00
|
|
|
|
fprintf (stderr, "elt0_ws=" HOST_WIDE_INT_PRINT_DEC, test->u.intval);
|
2001-05-18 22:53:55 +02:00
|
|
|
|
break;
|
2001-01-14 21:35:06 +01:00
|
|
|
|
case DT_veclen_ge:
|
|
|
|
|
fprintf (stderr, "veclen>=%d", test->u.veclen);
|
|
|
|
|
break;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
case DT_dup:
|
|
|
|
|
fprintf (stderr, "dup=%d", test->u.dup);
|
|
|
|
|
break;
|
|
|
|
|
case DT_pred:
|
|
|
|
|
fprintf (stderr, "pred=(%s,%s)",
|
|
|
|
|
test->u.pred.name, GET_MODE_NAME(test->u.pred.mode));
|
|
|
|
|
break;
|
|
|
|
|
case DT_c_test:
|
|
|
|
|
{
|
|
|
|
|
char sub[16+4];
|
|
|
|
|
strncpy (sub, test->u.c_test, sizeof(sub));
|
|
|
|
|
memcpy (sub+16, "...", 4);
|
|
|
|
|
fprintf (stderr, "c_test=\"%s\"", sub);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case DT_accept_op:
|
|
|
|
|
fprintf (stderr, "A_op=%d", test->u.opno);
|
|
|
|
|
break;
|
|
|
|
|
case DT_accept_insn:
|
2001-07-03 08:22:01 +02:00
|
|
|
|
fprintf (stderr, "A_insn=(%d,%d)",
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test->u.insn.code_number, test->u.insn.num_clobbers_to_add);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
Makefile.in (gengtype): Use $(BUILD_ERRORS).
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
From-SVN: r87236
2004-09-09 15:22:38 +02:00
|
|
|
|
gcc_unreachable ();
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
debug_decision_1 (struct decision *d, int indent)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
struct decision_test *test;
|
|
|
|
|
|
|
|
|
|
if (d == NULL)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < indent; ++i)
|
|
|
|
|
putc (' ', stderr);
|
|
|
|
|
fputs ("(nil)\n", stderr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < indent; ++i)
|
|
|
|
|
putc (' ', stderr);
|
|
|
|
|
|
|
|
|
|
putc ('{', stderr);
|
|
|
|
|
test = d->tests;
|
|
|
|
|
if (test)
|
|
|
|
|
{
|
|
|
|
|
debug_decision_2 (test);
|
|
|
|
|
while ((test = test->next) != NULL)
|
|
|
|
|
{
|
|
|
|
|
fputs (" + ", stderr);
|
|
|
|
|
debug_decision_2 (test);
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-10-14 06:07:03 +02:00
|
|
|
|
fprintf (stderr, "} %d n %d a %d\n", d->number,
|
|
|
|
|
(d->next ? d->next->number : -1),
|
|
|
|
|
(d->afterward ? d->afterward->number : -1));
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
debug_decision_0 (struct decision *d, int indent, int maxdepth)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
struct decision *n;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (maxdepth < 0)
|
|
|
|
|
return;
|
|
|
|
|
if (d == NULL)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < indent; ++i)
|
|
|
|
|
putc (' ', stderr);
|
|
|
|
|
fputs ("(nil)\n", stderr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
debug_decision_1 (d, indent);
|
|
|
|
|
for (n = d->success.first; n ; n = n->next)
|
|
|
|
|
debug_decision_0 (n, indent + 2, maxdepth - 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
debug_decision (struct decision *d)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
debug_decision_0 (d, 0, 1000000);
|
|
|
|
|
}
|
1999-10-10 11:43:26 +02:00
|
|
|
|
|
|
|
|
|
void
|
2003-06-01 17:59:10 +02:00
|
|
|
|
debug_decision_list (struct decision *d)
|
1999-10-10 11:43:26 +02:00
|
|
|
|
{
|
|
|
|
|
while (d)
|
|
|
|
|
{
|
|
|
|
|
debug_decision_0 (d, 0, 0);
|
|
|
|
|
d = d->next;
|
|
|
|
|
}
|
|
|
|
|
}
|