1991-11-24 20:57:16 +01:00
|
|
|
|
/* Generate code from machine description to recognize rtl as insns.
|
2014-01-02 23:23:26 +01:00
|
|
|
|
Copyright (C) 1987-2014 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
|
2007-07-26 10:37:01 +02:00
|
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
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
|
2007-07-26 10:37:01 +02:00
|
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
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"
|
Makefile.in (READ_MD_H): New variable.
gcc/
* Makefile.in (READ_MD_H): New variable.
(BUILD_RTL): Add build/read-md.o.
(lto-wrapper.o): Depend on coretypes.h instead of defaults.h.
(build/gensupport.o, build/read-rtl.o, build/genattr.o)
(build/genattrtab.o, build/genconditions.o build/genemit.o)
(build/genextract.o, build/genflags.o, build/genoutput.o)
(build/genpreds.o, build/genrecog.o): Depend on $(READ_MD_H).
(build/read-md.o): New rule.
* defaults.h (obstack_chunk_alloc, obstack_chunk_free)
(OBSTACK_CHUNK_SIZE, gcc_obstack_init): Move to...
* coretypes.h: ...here.
* lto-wrapper.c: Include coretypes.h instead of defaults.h.
* pretty-print.c (obstack_chunk_alloc, obstack_chunk_free): Delete.
* genattr.c: Include read-md.h.
* genattrtab.c: Likewise.
* genconditions.c: Likewise.
* genemit.c: Likewise.
* genextract.c: Likewise.
* genflags.c: Likewise.
* genoutput.c: Likewise.
* genpreds.c: Likewise.
* genrecog.c: Likewise.
* rtl.h (read_skip_spaces, copy_rtx_ptr_loc, print_rtx_ptr_loc)
(join_c_conditions, print_c_condition, read_rtx_filename)
(read_rtx_lineno): Move to read-md.h.
* read-rtl.c: Include read-md.h.
(ptr_loc, string_obstack, ptr_locs, ptr_loc_obstack)
(joined_conditions, joined_conditions_obstack, read_rtx_lineno)
(read_rtx_filename, fatal_with_file_and_line, fatal_expected_char)
(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, read_skip_spaces, read_escape, read_quoted_string)
(read_braced_string, read_string): Move to read-md.c.
(read_rtx): Move some initialization to init_md_reader and call
init_md_reader here.
* gensupport.h (message_with_line, n_comma_elts, scan_comma_elt):
Move to read-md.h.
* gensupport.c: Include read-md.h.
(message_with_line, n_comma_elts, scan_comma_elt): Move to
read-md.c.
* read-md.h, read-md.c: New files.
From-SVN: r160570
2010-06-10 22:21:23 +02:00
|
|
|
|
#include "read-md.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) \
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
printf ("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (INDENT_STRING), (LABEL_NUMBER))
|
1999-01-04 08:48:37 +01:00
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
/* Ways of obtaining an rtx to be tested. */
|
|
|
|
|
enum position_type {
|
|
|
|
|
/* PATTERN (peep2_next_insn (ARG)). */
|
|
|
|
|
POS_PEEP2_INSN,
|
|
|
|
|
|
|
|
|
|
/* XEXP (BASE, ARG). */
|
|
|
|
|
POS_XEXP,
|
|
|
|
|
|
|
|
|
|
/* XVECEXP (BASE, 0, ARG). */
|
|
|
|
|
POS_XVECEXP0
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* The position of an rtx relative to X0. Each useful position is
|
|
|
|
|
represented by exactly one instance of this structure. */
|
|
|
|
|
struct position
|
|
|
|
|
{
|
|
|
|
|
/* The parent rtx. This is the root position for POS_PEEP2_INSNs. */
|
|
|
|
|
struct position *base;
|
|
|
|
|
|
|
|
|
|
/* A position with the same BASE and TYPE, but with the next value
|
|
|
|
|
of ARG. */
|
|
|
|
|
struct position *next;
|
|
|
|
|
|
|
|
|
|
/* A list of all POS_XEXP positions that use this one as their base,
|
|
|
|
|
chained by NEXT fields. The first entry represents XEXP (this, 0),
|
|
|
|
|
the second represents XEXP (this, 1), and so on. */
|
|
|
|
|
struct position *xexps;
|
|
|
|
|
|
|
|
|
|
/* A list of POS_XVECEXP0 positions that use this one as their base,
|
|
|
|
|
chained by NEXT fields. The first entry represents XVECEXP (this, 0, 0),
|
|
|
|
|
the second represents XVECEXP (this, 0, 1), and so on. */
|
|
|
|
|
struct position *xvecexp0s;
|
|
|
|
|
|
|
|
|
|
/* The type of position. */
|
|
|
|
|
enum position_type type;
|
|
|
|
|
|
|
|
|
|
/* The argument to TYPE (shown as ARG in the position_type comments). */
|
|
|
|
|
int arg;
|
|
|
|
|
|
|
|
|
|
/* The depth of this position, with 0 as the root. */
|
|
|
|
|
int depth;
|
|
|
|
|
};
|
|
|
|
|
|
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
|
|
|
|
|
basic-block.h (enum profile_status): Break out of struct control_flow_graph.
./: * basic-block.h (enum profile_status): Break out of struct
control_flow_graph.
* cgraph.h (struct inline_summary): Break out of struct
cgraph_local_info.
* cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out
of struct cgraph_order_sort.
* combine.c (enum undo_kind): New enum, broken out of struct
undo.
* cse.c (struct branch_path): Break out of struct
cse_basic_block_data.
* except.h (enum eh_region_type): Break out of struct eh_region.
* gcc.c (enum add_del): Break out of struct modify_target.
* genrecog.c (enum decision_type): Break out of struct
decision_test.
* ggc-page.c (struct ggc_pch_ondisk): Break out of struct
ggc_pch_data.
* matrix-reorg.c (struct free_info): Break out of struct
matrix_info.
* regmove.c (enum match_use): New enum, broken out of struct
match.
* sched-int.h (enum post_call_group): New enum, broken out of
struct deps.
(struct deps_reg): Break out of struct deps.
* target.h (struct asm_int_op): Break out of struct gcc_target.
* tree-eh.c (struct goto_queue_node): Break out of struct
leh_tf_state.
* tree-inline.h (enum copy_body_cge_which): Break out of
copy_body_data.
* tree-pass.h (enum opt_pass_type): Break out of struct opt_pass.
* c-decl.c (in_struct, struct_types): New static variables.
(pushtag): Add loc parameter. Change all callers.
(lookup_tag): Add ploc parameter. Change all callers.
(check_compound_literal_type): New function.
(parser_xref_tag): Add loc parameter. Change all callers. If
-Wc++-compat, warn about struct/union/enum types defined within a
struct or union.
(start_struct): Add enclosing_in_struct, enclosing_struct_types,
and loc parameters. Change all callers. Change error calls to
error_at, using loc. For a redefinition, if the location of the
original definition is known, report it. Set in_struct and
struct_types. If -Wc++-compat warn if in sizeof, typeof, or
alignof.
(finish_struct): Add new parameters enclosing_in_struct and
enclosing_struct_types. Change all callers. Set
C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined
in the struct. If in a struct, add this struct to struct_types.
(start_enum): Add loc parameter. Change all callers. Use
error_at for errors, using loc. For a redefinition, if the
location of the original definition is known, report it. If in a
struct, add this enum type to struct_types. If -Wc++-compat warn
if in sizeof, typeof, or alignof.
* c-parser.c (disable_extension_diagnostics): Disable
-Wc++-compat.
(enable_extension_diagnostics): Reenable -Wc++-compat if
appropriate.
(c_parser_enum_specifier): Get enum location for start_enum.
(c_parser_struct_or_union_specifier): Get struct location for
start_struct. Save in_struct and struct_types status between
start_struct and finish_struct.
(c_parser_cast_expression): Get location of cast.
(c_parser_alignof_expression): Get location of type.
(c_parser_postfix_expression): Likewise.
(c_parser_postfix_expression_after_paren_type): Add type_loc
parameter. Change all callers. Call
check_compound_literal_type. Use type_loc for error about
variable size type.
* c-typeck.c (build_external_ref): If -Wc++-compat, warn about a
use of an enum constant from an enum type defined in a struct or
union.
(c_cast_expr): Add loc parameter. Change all callers. If
-Wc++-compat, warn about defining a type in a cast.
* c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define.
(start_enum, start_struct, finish_struct): Update declarations.
(parser_xref_tag, c_cast_expr): Update declarations.
(check_compound_literal_type): Declare.
fortran/:
* gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of
gfc_omp_clauses.
(enum gfc_omp_default_sharing): Likewise.
* module.c (enum gfc_rsym_state): New enum, broken out of
pointer_info.
(enum gfc_wsym_state): Likewise.
* parse.c (enum state_order): New enum, broken out of st_state.
objc/:
* objc-act.c (objc_building_struct): New static variable.
(objc_in_struct, objc_struct_types): New static variables.
(objc_start_struct, objc_finish_struct): New static functions.
(generate_struct_by_value_array): Call objc_start_struct instead
of start_struct, and call objc_finish_struct instead of
finish_struct.
(objc_build_struct, build_objc_symtab_template): Likewise.
(build_module_descriptor): Likewise.
(build_next_objc_exception_stuff): Likewise.
(build_protocol_template): Likewise.
(build_method_prototype_list_template): Likewise.
(build_method_prototype_template): Likewise.
(build_category_template, build_selector_template): Likewise.
(build_class_template, build_super_template): Likewise.
(build_ivar_template, build_ivar_list_template): Likewise.
(build_method_list_template): Likewise.
(build_method_template): Likewise.
objcp/:
* objcp-decl.h (start_struct): Add three new, ignored, macro
parameters.
(finish_struct): Add two new, ignored, macro parameters.
testsuite/:
* gcc.dg/Wcxx-compat-7.c: New testcase.
* gcc.dg/Wcxx-compat-8.c: New testcase.
* gcc.dg/c99-tag-1.c: Recognize new "originally defined here"
notes
* gcc.dg/pr17188-1.c: Likewise.
* gcc.dg/pr39084.c: Likewise.
From-SVN: r147358
2009-05-11 03:02:40 +02:00
|
|
|
|
/* These types are roughly in the order in which we'd like to test them. */
|
|
|
|
|
enum decision_type
|
|
|
|
|
{
|
|
|
|
|
DT_num_insns,
|
|
|
|
|
DT_mode, DT_code, DT_veclen,
|
|
|
|
|
DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe,
|
|
|
|
|
DT_const_int,
|
|
|
|
|
DT_veclen_ge, DT_dup, DT_pred, DT_c_test,
|
|
|
|
|
DT_accept_op, DT_accept_insn
|
|
|
|
|
};
|
|
|
|
|
|
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;
|
|
|
|
|
|
basic-block.h (enum profile_status): Break out of struct control_flow_graph.
./: * basic-block.h (enum profile_status): Break out of struct
control_flow_graph.
* cgraph.h (struct inline_summary): Break out of struct
cgraph_local_info.
* cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out
of struct cgraph_order_sort.
* combine.c (enum undo_kind): New enum, broken out of struct
undo.
* cse.c (struct branch_path): Break out of struct
cse_basic_block_data.
* except.h (enum eh_region_type): Break out of struct eh_region.
* gcc.c (enum add_del): Break out of struct modify_target.
* genrecog.c (enum decision_type): Break out of struct
decision_test.
* ggc-page.c (struct ggc_pch_ondisk): Break out of struct
ggc_pch_data.
* matrix-reorg.c (struct free_info): Break out of struct
matrix_info.
* regmove.c (enum match_use): New enum, broken out of struct
match.
* sched-int.h (enum post_call_group): New enum, broken out of
struct deps.
(struct deps_reg): Break out of struct deps.
* target.h (struct asm_int_op): Break out of struct gcc_target.
* tree-eh.c (struct goto_queue_node): Break out of struct
leh_tf_state.
* tree-inline.h (enum copy_body_cge_which): Break out of
copy_body_data.
* tree-pass.h (enum opt_pass_type): Break out of struct opt_pass.
* c-decl.c (in_struct, struct_types): New static variables.
(pushtag): Add loc parameter. Change all callers.
(lookup_tag): Add ploc parameter. Change all callers.
(check_compound_literal_type): New function.
(parser_xref_tag): Add loc parameter. Change all callers. If
-Wc++-compat, warn about struct/union/enum types defined within a
struct or union.
(start_struct): Add enclosing_in_struct, enclosing_struct_types,
and loc parameters. Change all callers. Change error calls to
error_at, using loc. For a redefinition, if the location of the
original definition is known, report it. Set in_struct and
struct_types. If -Wc++-compat warn if in sizeof, typeof, or
alignof.
(finish_struct): Add new parameters enclosing_in_struct and
enclosing_struct_types. Change all callers. Set
C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined
in the struct. If in a struct, add this struct to struct_types.
(start_enum): Add loc parameter. Change all callers. Use
error_at for errors, using loc. For a redefinition, if the
location of the original definition is known, report it. If in a
struct, add this enum type to struct_types. If -Wc++-compat warn
if in sizeof, typeof, or alignof.
* c-parser.c (disable_extension_diagnostics): Disable
-Wc++-compat.
(enable_extension_diagnostics): Reenable -Wc++-compat if
appropriate.
(c_parser_enum_specifier): Get enum location for start_enum.
(c_parser_struct_or_union_specifier): Get struct location for
start_struct. Save in_struct and struct_types status between
start_struct and finish_struct.
(c_parser_cast_expression): Get location of cast.
(c_parser_alignof_expression): Get location of type.
(c_parser_postfix_expression): Likewise.
(c_parser_postfix_expression_after_paren_type): Add type_loc
parameter. Change all callers. Call
check_compound_literal_type. Use type_loc for error about
variable size type.
* c-typeck.c (build_external_ref): If -Wc++-compat, warn about a
use of an enum constant from an enum type defined in a struct or
union.
(c_cast_expr): Add loc parameter. Change all callers. If
-Wc++-compat, warn about defining a type in a cast.
* c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define.
(start_enum, start_struct, finish_struct): Update declarations.
(parser_xref_tag, c_cast_expr): Update declarations.
(check_compound_literal_type): Declare.
fortran/:
* gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of
gfc_omp_clauses.
(enum gfc_omp_default_sharing): Likewise.
* module.c (enum gfc_rsym_state): New enum, broken out of
pointer_info.
(enum gfc_wsym_state): Likewise.
* parse.c (enum state_order): New enum, broken out of st_state.
objc/:
* objc-act.c (objc_building_struct): New static variable.
(objc_in_struct, objc_struct_types): New static variables.
(objc_start_struct, objc_finish_struct): New static functions.
(generate_struct_by_value_array): Call objc_start_struct instead
of start_struct, and call objc_finish_struct instead of
finish_struct.
(objc_build_struct, build_objc_symtab_template): Likewise.
(build_module_descriptor): Likewise.
(build_next_objc_exception_stuff): Likewise.
(build_protocol_template): Likewise.
(build_method_prototype_list_template): Likewise.
(build_method_prototype_template): Likewise.
(build_category_template, build_selector_template): Likewise.
(build_class_template, build_super_template): Likewise.
(build_ivar_template, build_ivar_list_template): Likewise.
(build_method_list_template): Likewise.
(build_method_template): Likewise.
objcp/:
* objcp-decl.h (start_struct): Add three new, ignored, macro
parameters.
(finish_struct): Add two new, ignored, macro parameters.
testsuite/:
* gcc.dg/Wcxx-compat-7.c: New testcase.
* gcc.dg/Wcxx-compat-8.c: New testcase.
* gcc.dg/c99-tag-1.c: Recognize new "originally defined here"
notes
* gcc.dg/pr17188-1.c: Likewise.
* gcc.dg/pr39084.c: Likewise.
From-SVN: r147358
2009-05-11 03:02:40 +02:00
|
|
|
|
enum decision_type 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. */
|
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
struct position *position; /* Position in pattern. */
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
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;
|
2011-05-26 21:16:05 +02:00
|
|
|
|
|
|
|
|
|
/* The root position (x0). */
|
|
|
|
|
static struct position root_pos;
|
|
|
|
|
|
|
|
|
|
/* A list of all POS_PEEP2_INSNs. The entry for insn 0 is the root position,
|
|
|
|
|
since we are given that instruction's pattern as x0. */
|
|
|
|
|
static struct position *peep2_insn_pos_list = &root_pos;
|
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
|
|
|
|
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
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
/* Return a position with the given BASE, TYPE and ARG. NEXT_PTR
|
|
|
|
|
points to where the unique object that represents the position
|
|
|
|
|
should be stored. Create the object if it doesn't already exist,
|
|
|
|
|
otherwise reuse the object that is already there. */
|
|
|
|
|
|
|
|
|
|
static struct position *
|
|
|
|
|
next_position (struct position **next_ptr, struct position *base,
|
|
|
|
|
enum position_type type, int arg)
|
|
|
|
|
{
|
|
|
|
|
struct position *pos;
|
|
|
|
|
|
|
|
|
|
pos = *next_ptr;
|
|
|
|
|
if (!pos)
|
|
|
|
|
{
|
|
|
|
|
pos = XCNEW (struct position);
|
|
|
|
|
pos->base = base;
|
|
|
|
|
pos->type = type;
|
|
|
|
|
pos->arg = arg;
|
|
|
|
|
pos->depth = base->depth + 1;
|
|
|
|
|
*next_ptr = pos;
|
|
|
|
|
}
|
|
|
|
|
return pos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Compare positions POS1 and POS2 lexicographically. */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
compare_positions (struct position *pos1, struct position *pos2)
|
|
|
|
|
{
|
|
|
|
|
int diff;
|
|
|
|
|
|
|
|
|
|
diff = pos1->depth - pos2->depth;
|
|
|
|
|
if (diff < 0)
|
|
|
|
|
do
|
|
|
|
|
pos2 = pos2->base;
|
|
|
|
|
while (pos1->depth != pos2->depth);
|
|
|
|
|
else if (diff > 0)
|
|
|
|
|
do
|
|
|
|
|
pos1 = pos1->base;
|
|
|
|
|
while (pos1->depth != pos2->depth);
|
|
|
|
|
while (pos1 != pos2)
|
|
|
|
|
{
|
|
|
|
|
diff = (int) pos1->type - (int) pos2->type;
|
|
|
|
|
if (diff == 0)
|
|
|
|
|
diff = pos1->arg - pos2->arg;
|
|
|
|
|
pos1 = pos1->base;
|
|
|
|
|
pos2 = pos2->base;
|
|
|
|
|
}
|
|
|
|
|
return diff;
|
|
|
|
|
}
|
|
|
|
|
|
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 *
|
2011-05-26 21:16:05 +02:00
|
|
|
|
new_decision (struct position *pos, struct decision_head *last)
|
1991-11-24 20:57:16 +01:00
|
|
|
|
{
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
struct decision *new_decision = XCNEW (struct decision);
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
new_decision->success = *last;
|
2011-05-26 21:16:05 +02:00
|
|
|
|
new_decision->position = pos;
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
new_decision->number = next_number++;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
last->first = last->last = new_decision;
|
|
|
|
|
return new_decision;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-19 12:37:40 +02:00
|
|
|
|
/* In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we
|
|
|
|
|
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. */
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
constraints_supported_in_insn_p (rtx insn)
|
|
|
|
|
{
|
|
|
|
|
return !(GET_CODE (insn) == DEFINE_EXPAND
|
|
|
|
|
|| GET_CODE (insn) == DEFINE_SPLIT
|
|
|
|
|
|| GET_CODE (insn) == DEFINE_PEEPHOLE2);
|
|
|
|
|
}
|
2000-12-10 20:50:53 +01:00
|
|
|
|
|
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:
|
2014-09-19 12:37:40 +02:00
|
|
|
|
{
|
|
|
|
|
const char constraints0 = XSTR (pattern, 1)[0];
|
|
|
|
|
|
|
|
|
|
if (!constraints_supported_in_insn_p (insn))
|
|
|
|
|
{
|
|
|
|
|
if (constraints0)
|
|
|
|
|
{
|
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"constraints not supported in %s",
|
|
|
|
|
rtx_name[GET_CODE (insn)]);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If a MATCH_SCRATCH is used in a context requiring an write-only
|
|
|
|
|
or read/write register, validate that. */
|
|
|
|
|
if (set_code == '='
|
2014-09-19 18:23:44 +02:00
|
|
|
|
&& constraints0
|
2014-09-19 12:37:40 +02:00
|
|
|
|
&& constraints0 != '='
|
|
|
|
|
&& constraints0 != '+')
|
|
|
|
|
{
|
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"operand %d missing output reload",
|
|
|
|
|
XINT (pattern, 0));
|
|
|
|
|
}
|
|
|
|
|
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)
|
2010-06-10 22:21:59 +02:00
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"operand %i duplicated before defined",
|
|
|
|
|
XINT (pattern, 0));
|
2004-02-07 18:53:44 +01:00
|
|
|
|
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)
|
2013-12-10 19:28:51 +01:00
|
|
|
|
error_with_line (pattern_lineno, "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];
|
|
|
|
|
|
2014-09-19 12:37:40 +02:00
|
|
|
|
if (!constraints_supported_in_insn_p (insn))
|
2000-12-09 23:06:52 +01:00
|
|
|
|
{
|
2001-07-06 22:39:56 +02:00
|
|
|
|
if (constraints0)
|
2014-09-19 12:37:40 +02:00
|
|
|
|
{
|
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"constraints not supported in %s",
|
|
|
|
|
rtx_name[GET_CODE (insn)]);
|
|
|
|
|
}
|
2001-07-06 22:39:56 +02:00
|
|
|
|
}
|
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
|
2010-06-10 22:21:59 +02:00
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"operand %d missing in-out reload",
|
2000-12-10 20:50:53 +01:00
|
|
|
|
XINT (pattern, 0));
|
|
|
|
|
}
|
2010-06-10 22:21:59 +02:00
|
|
|
|
else if (constraints0 != '=' && constraints0 != '+')
|
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"operand %d missing output reload",
|
|
|
|
|
XINT (pattern, 0));
|
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)
|
2013-12-10 19:28:51 +01:00
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"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)
|
2010-06-10 22:21:59 +02:00
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"mode mismatch in set: %smode vs %smode",
|
|
|
|
|
GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
|
1999-10-14 11:37:31 +02:00
|
|
|
|
|
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
|
2009-06-22 12:29:13 +02:00
|
|
|
|
&& !CONST_INT_P (src)
|
2014-05-06 18:25:05 +02:00
|
|
|
|
&& !CONST_WIDE_INT_P (src)
|
2009-04-25 06:51:34 +02:00
|
|
|
|
&& GET_CODE (src) != CALL)
|
1999-10-14 11:37:31 +02:00
|
|
|
|
{
|
|
|
|
|
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:
|
2014-09-11 22:47:39 +02:00
|
|
|
|
if (GET_MODE (LABEL_REF_LABEL (pattern)) != VOIDmode)
|
2010-06-10 22:21:59 +02:00
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"operand to label_ref %smode not VOIDmode",
|
2014-09-11 22:47:39 +02:00
|
|
|
|
GET_MODE_NAME (GET_MODE (LABEL_REF_LABEL (pattern))));
|
1999-10-14 05:43:49 +02:00
|
|
|
|
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
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
POSITION is 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 *
|
2011-05-26 21:16:05 +02:00
|
|
|
|
add_to_sequence (rtx pattern, struct decision_head *last,
|
|
|
|
|
struct position *pos, 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;
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
struct decision *this_decision, *sub;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
struct decision_test *test;
|
|
|
|
|
struct decision_test **place;
|
2011-05-26 21:16:05 +02:00
|
|
|
|
struct position *subpos, **subpos_ptr;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
size_t i;
|
|
|
|
|
const char *fmt;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
int len;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
enum machine_mode mode;
|
2011-05-26 21:16:05 +02:00
|
|
|
|
enum position_type pos_type;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
if (pos->depth > max_depth)
|
|
|
|
|
max_depth = pos->depth;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
sub = this_decision = new_decision (pos, last);
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
place = &this_decision->tests;
|
1991-11-24 20:57:16 +01:00
|
|
|
|
|
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
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos_ptr = &peep2_insn_pos_list;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
for (i = 0; i < (size_t) XVECLEN (pattern, 0); i++)
|
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos = next_position (subpos_ptr, &root_pos,
|
|
|
|
|
POS_PEEP2_INSN, i);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
sub = add_to_sequence (XVECEXP (pattern, 0, i),
|
|
|
|
|
last, subpos, insn_type, 0);
|
|
|
|
|
last = &sub->success;
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos_ptr = &subpos->next;
|
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
|
2014-05-06 18:25:05 +02:00
|
|
|
|
predicate does not allow CONST_INT or CONST_WIDE_INT,
|
|
|
|
|
in which case it can match only if the modes match. */
|
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)
|
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;
|
2014-05-06 18:25:05 +02:00
|
|
|
|
allows_const_int = (pred->codes[CONST_INT]
|
|
|
|
|
|| pred->codes[CONST_WIDE_INT]);
|
2004-08-13 08:36:21 +02:00
|
|
|
|
if (was_code == MATCH_PARALLEL
|
|
|
|
|
&& pred->singleton != PARALLEL)
|
2013-12-10 19:28:51 +01:00
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"predicate '%s' used in match_parallel "
|
|
|
|
|
"does not allow only PARALLEL", pred->name);
|
2004-08-13 08:36:21 +02:00
|
|
|
|
else
|
|
|
|
|
code = pred->singleton;
|
1993-09-19 18:50:43 +02:00
|
|
|
|
}
|
2004-08-13 08:36:21 +02:00
|
|
|
|
else
|
2013-12-10 19:28:51 +01:00
|
|
|
|
error_with_line (pattern_lineno,
|
|
|
|
|
"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)
|
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
if (was_code == MATCH_OPERATOR)
|
|
|
|
|
{
|
|
|
|
|
pos_type = POS_XEXP;
|
|
|
|
|
subpos_ptr = &pos->xexps;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pos_type = POS_XVECEXP0;
|
|
|
|
|
subpos_ptr = &pos->xvecexp0s;
|
|
|
|
|
}
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (i = 0; i < (size_t) XVECLEN (pattern, 2); i++)
|
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos = next_position (subpos_ptr, pos, pos_type, i);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
sub = add_to_sequence (XVECEXP (pattern, 2, i),
|
|
|
|
|
&sub->success, subpos, insn_type, 0);
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos_ptr = &subpos->next;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
|
2011-05-28 09:38:07 +02:00
|
|
|
|
subpos_ptr = &pos->xexps;
|
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
|
|
|
|
{
|
2011-05-28 09:38:07 +02:00
|
|
|
|
subpos = next_position (subpos_ptr, pos, POS_XEXP, i);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
sub = add_to_sequence (XVECEXP (pattern, 1, i),
|
|
|
|
|
&sub->success, subpos, insn_type, 0);
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos_ptr = &subpos->next;
|
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
|
|
|
|
|
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);
|
2007-05-30 19:07:58 +02: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
|
|
|
|
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. */
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos_ptr = &pos->xexps;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (i = 0; i < (size_t) len; i++)
|
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos = next_position (subpos_ptr, pos, POS_XEXP, i);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
switch (fmt[i])
|
|
|
|
|
{
|
|
|
|
|
case 'e': case 'u':
|
|
|
|
|
sub = add_to_sequence (XEXP (pattern, i), &sub->success,
|
|
|
|
|
subpos, insn_type, 0);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
struct position *subpos2, **subpos2_ptr;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int j;
|
2011-05-26 21:16:05 +02:00
|
|
|
|
|
|
|
|
|
subpos2_ptr = &pos->xvecexp0s;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (j = 0; j < XVECLEN (pattern, i); j++)
|
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos2 = next_position (subpos2_ptr, pos, POS_XVECEXP0, j);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
sub = add_to_sequence (XVECEXP (pattern, i, j),
|
2011-05-26 21:16:05 +02:00
|
|
|
|
&sub->success, subpos2, insn_type, 0);
|
|
|
|
|
subpos2_ptr = &subpos2->next;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
2011-05-26 21:16:05 +02:00
|
|
|
|
subpos_ptr = &subpos->next;
|
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)
|
|
|
|
|
{
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
place = &this_decision->tests;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test = new_decision_test (DT_code, &place);
|
|
|
|
|
test->u.code = code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mode != VOIDmode)
|
|
|
|
|
{
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
place = &this_decision->tests;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
test = new_decision_test (DT_mode, &place);
|
|
|
|
|
test->u.mode = mode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we didn't insert any tests or accept nodes, hork. */
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
gcc_assert (this_decision->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:
|
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;
|
2009-04-24 17:31:38 +02:00
|
|
|
|
int 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.
|
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
Due to the way positions are constructed, we know that iterating
|
|
|
|
|
forward from the lexically lower position will run into the lexically
|
|
|
|
|
higher position and not the other way around. This saves a bit
|
|
|
|
|
of effort. */
|
1999-09-22 03:40:28 +02:00
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
cmp = compare_positions (d1->position, d2->position);
|
1999-09-22 03:40:28 +02:00
|
|
|
|
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
|
2011-05-26 21:16:05 +02:00
|
|
|
|
&& d1->success.first->position != d2->success.first->position)
|
1999-10-15 08:56:28 +02:00
|
|
|
|
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
|
|
|
|
|
{
|
2010-06-10 22:21:59 +02:00
|
|
|
|
error_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));
|
1999-10-14 05:43:49 +02:00
|
|
|
|
message_with_line (old->u.insn.lineno, "previous definition of `%s'",
|
|
|
|
|
get_insn_name (old->u.insn.code_number));
|
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. */
|
2011-05-26 21:16:05 +02:00
|
|
|
|
gcc_assert (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;
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
struct decision *new_dec, *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)
|
|
|
|
|
{
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
new_dec = new_decision (first->position, &first->success);
|
|
|
|
|
new_dec->tests = first->tests->next;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
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)
|
|
|
|
|
{
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
new_dec = new_decision (next->position, &next->success);
|
|
|
|
|
new_dec->tests = next->tests->next;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
next->tests->next = NULL;
|
|
|
|
|
}
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
new_dec = next;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
next = next->next;
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
new_dec->next = NULL;
|
|
|
|
|
h.first = h.last = new_dec;
|
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
|
2011-05-26 21:16:05 +02:00
|
|
|
|
change_state (struct position *oldpos, struct position *newpos,
|
|
|
|
|
const char *indent)
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
while (oldpos->depth > newpos->depth)
|
|
|
|
|
oldpos = oldpos->base;
|
1991-12-28 12:36:37 +01:00
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
if (oldpos != newpos)
|
|
|
|
|
switch (newpos->type)
|
|
|
|
|
{
|
|
|
|
|
case POS_PEEP2_INSN:
|
|
|
|
|
printf ("%stem = peep2_next_insn (%d);\n", indent, newpos->arg);
|
|
|
|
|
printf ("%sx%d = PATTERN (tem);\n", indent, newpos->depth);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case POS_XEXP:
|
|
|
|
|
change_state (oldpos, newpos->base, indent);
|
|
|
|
|
printf ("%sx%d = XEXP (x%d, %d);\n",
|
|
|
|
|
indent, newpos->depth, newpos->depth - 1, newpos->arg);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case POS_XVECEXP0:
|
|
|
|
|
change_state (oldpos, newpos->base, indent);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
printf ("%sx%d = XVECEXP (x%d, 0, %d);\n",
|
2011-05-26 21:16:05 +02:00
|
|
|
|
indent, newpos->depth, newpos->depth - 1, newpos->arg);
|
|
|
|
|
break;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 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)
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
printf ("%sgoto ret0;\n", indent);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
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
|
|
|
|
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +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;
|
2009-04-24 17:31:38 +02:00
|
|
|
|
int 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
|
|
|
|
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);
|
2009-04-24 17:31:38 +02:00
|
|
|
|
print_code ((enum rtx_code) 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
|
|
|
|
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 = " ";
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
printf (" if ((int) XWINT (x%d, 0) == XWINT (x%d, 0))\n",
|
|
|
|
|
depth, depth);
|
2001-10-28 17:00:22 +01:00
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
{
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
printf ("%soperands[%d] = x%d;\n", indent, test->u.opno, depth);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
int match_len = 0;
|
|
|
|
|
struct position *pos;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
for (pos = p->position; pos; pos = pos->base)
|
|
|
|
|
if (pos->type == POS_PEEP2_INSN)
|
2000-05-27 22:23:15 +02:00
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
match_len = pos->arg;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
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
|
|
|
|
{
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
printf ("%sgoto L%d;\n", indent, success->number);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
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
|
2011-05-26 21:16:05 +02:00
|
|
|
|
write_tree (struct decision_head *head, struct position *prevpos,
|
2003-06-01 17:59:10 +02:00
|
|
|
|
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
|
|
|
|
|
{
|
2005-08-27 04:08:29 +02:00
|
|
|
|
change_state (prevpos, p->position, " ");
|
2011-05-26 21:16:05 +02:00
|
|
|
|
write_tree_1 (head, p->position->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;
|
Use rtx_insn internally within generated functions
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* recog.h (insn_output_fn): Update this function typedef to match
the changes below to the generated output functions, strengthening
the 2nd param from rtx to rtx_insn *.
* final.c (get_insn_template): Add a checked cast to rtx_insn * on
insn when invoking an output function, to match the new signature
of insn_output_fn with a stronger second param.
* genconditions.c (write_header): In the generated code for
gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
to match the other changes in this patch.
* genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
implementations.
* genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
the subfunctions within the generated "recog_", "split", "peephole2"
function trees from rtx to rtx_insn *. For now, the top-level
generated functions ("recog", "split", "peephole2") continue to
take a plain rtx for "insn", to avoid introducing dependencies on
other patches. Rename this 2nd param from "insn" to
"uncast_insn", and reintroduce "insn" as a local variable of type
rtx_insn *, initialized at the top of the generated function with
a checked cast on "uncast_insn".
(make_insn_sequence): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
prototypes.
* genoutput.c (process_template): Strengthen the 2nd param within
the generated "output_" functions "insn" from rtx to rtx_insn *.
From-SVN: r214257
2014-08-21 09:49:28 +02:00
|
|
|
|
const char *insn_param;
|
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");
|
|
|
|
|
|
Use rtx_insn internally within generated functions
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* recog.h (insn_output_fn): Update this function typedef to match
the changes below to the generated output functions, strengthening
the 2nd param from rtx to rtx_insn *.
* final.c (get_insn_template): Add a checked cast to rtx_insn * on
insn when invoking an output function, to match the new signature
of insn_output_fn with a stronger second param.
* genconditions.c (write_header): In the generated code for
gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
to match the other changes in this patch.
* genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
implementations.
* genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
the subfunctions within the generated "recog_", "split", "peephole2"
function trees from rtx to rtx_insn *. For now, the top-level
generated functions ("recog", "split", "peephole2") continue to
take a plain rtx for "insn", to avoid introducing dependencies on
other patches. Rename this 2nd param from "insn" to
"uncast_insn", and reintroduce "insn" as a local variable of type
rtx_insn *, initialized at the top of the generated function with
a checked cast on "uncast_insn".
(make_insn_sequence): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
prototypes.
* genoutput.c (process_template): Strengthen the 2nd param within
the generated "output_" functions "insn" from rtx to rtx_insn *.
From-SVN: r214257
2014-08-21 09:49:28 +02:00
|
|
|
|
/* For now, the top-level functions take a plain "rtx", and perform a
|
|
|
|
|
checked cast to "rtx_insn *" for use throughout the rest of the
|
|
|
|
|
function and the code it calls. */
|
|
|
|
|
insn_param = subfunction ? "rtx_insn *insn" : "rtx uncast_insn";
|
|
|
|
|
|
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\
|
Use rtx_insn internally within generated functions
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* recog.h (insn_output_fn): Update this function typedef to match
the changes below to the generated output functions, strengthening
the 2nd param from rtx to rtx_insn *.
* final.c (get_insn_template): Add a checked cast to rtx_insn * on
insn when invoking an output function, to match the new signature
of insn_output_fn with a stronger second param.
* genconditions.c (write_header): In the generated code for
gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
to match the other changes in this patch.
* genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
implementations.
* genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
the subfunctions within the generated "recog_", "split", "peephole2"
function trees from rtx to rtx_insn *. For now, the top-level
generated functions ("recog", "split", "peephole2") continue to
take a plain rtx for "insn", to avoid introducing dependencies on
other patches. Rename this 2nd param from "insn" to
"uncast_insn", and reintroduce "insn" as a local variable of type
rtx_insn *, initialized at the top of the generated function with
a checked cast on "uncast_insn".
(make_insn_sequence): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
prototypes.
* genoutput.c (process_template): Strengthen the 2nd param within
the generated "output_" functions "insn" from rtx to rtx_insn *.
From-SVN: r214257
2014-08-21 09:49:28 +02:00
|
|
|
|
recog%s (rtx x0 ATTRIBUTE_UNUSED,\n\t%s ATTRIBUTE_UNUSED,\n\tint *pnum_clobbers ATTRIBUTE_UNUSED)\n",
|
|
|
|
|
s_or_e, extension, insn_param);
|
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\
|
Use rtx_insn internally within generated functions
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* recog.h (insn_output_fn): Update this function typedef to match
the changes below to the generated output functions, strengthening
the 2nd param from rtx to rtx_insn *.
* final.c (get_insn_template): Add a checked cast to rtx_insn * on
insn when invoking an output function, to match the new signature
of insn_output_fn with a stronger second param.
* genconditions.c (write_header): In the generated code for
gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
to match the other changes in this patch.
* genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
implementations.
* genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
the subfunctions within the generated "recog_", "split", "peephole2"
function trees from rtx to rtx_insn *. For now, the top-level
generated functions ("recog", "split", "peephole2") continue to
take a plain rtx for "insn", to avoid introducing dependencies on
other patches. Rename this 2nd param from "insn" to
"uncast_insn", and reintroduce "insn" as a local variable of type
rtx_insn *, initialized at the top of the generated function with
a checked cast on "uncast_insn".
(make_insn_sequence): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
prototypes.
* genoutput.c (process_template): Strengthen the 2nd param within
the generated "output_" functions "insn" from rtx to rtx_insn *.
From-SVN: r214257
2014-08-21 09:49:28 +02:00
|
|
|
|
split%s (rtx x0 ATTRIBUTE_UNUSED, %s ATTRIBUTE_UNUSED)\n",
|
|
|
|
|
s_or_e, extension, insn_param);
|
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\
|
Use rtx_insn internally within generated functions
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* recog.h (insn_output_fn): Update this function typedef to match
the changes below to the generated output functions, strengthening
the 2nd param from rtx to rtx_insn *.
* final.c (get_insn_template): Add a checked cast to rtx_insn * on
insn when invoking an output function, to match the new signature
of insn_output_fn with a stronger second param.
* genconditions.c (write_header): In the generated code for
gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
to match the other changes in this patch.
* genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
implementations.
* genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
the subfunctions within the generated "recog_", "split", "peephole2"
function trees from rtx to rtx_insn *. For now, the top-level
generated functions ("recog", "split", "peephole2") continue to
take a plain rtx for "insn", to avoid introducing dependencies on
other patches. Rename this 2nd param from "insn" to
"uncast_insn", and reintroduce "insn" as a local variable of type
rtx_insn *, initialized at the top of the generated function with
a checked cast on "uncast_insn".
(make_insn_sequence): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
prototypes.
* genoutput.c (process_template): Strengthen the 2nd param within
the generated "output_" functions "insn" from rtx to rtx_insn *.
From-SVN: r214257
2014-08-21 09:49:28 +02:00
|
|
|
|
peephole2%s (rtx x0 ATTRIBUTE_UNUSED,\n\t%s ATTRIBUTE_UNUSED,\n\tint *_pmatch_len ATTRIBUTE_UNUSED)\n",
|
|
|
|
|
s_or_e, extension, insn_param);
|
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");
|
|
|
|
|
|
Use rtx_insn internally within generated functions
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* recog.h (insn_output_fn): Update this function typedef to match
the changes below to the generated output functions, strengthening
the 2nd param from rtx to rtx_insn *.
* final.c (get_insn_template): Add a checked cast to rtx_insn * on
insn when invoking an output function, to match the new signature
of insn_output_fn with a stronger second param.
* genconditions.c (write_header): In the generated code for
gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
to match the other changes in this patch.
* genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
implementations.
* genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
the subfunctions within the generated "recog_", "split", "peephole2"
function trees from rtx to rtx_insn *. For now, the top-level
generated functions ("recog", "split", "peephole2") continue to
take a plain rtx for "insn", to avoid introducing dependencies on
other patches. Rename this 2nd param from "insn" to
"uncast_insn", and reintroduce "insn" as a local variable of type
rtx_insn *, initialized at the top of the generated function with
a checked cast on "uncast_insn".
(make_insn_sequence): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
prototypes.
* genoutput.c (process_template): Strengthen the 2nd param within
the generated "output_" functions "insn" from rtx to rtx_insn *.
From-SVN: r214257
2014-08-21 09:49:28 +02:00
|
|
|
|
/* For now add the downcast to rtx_insn *, at the top of each top-level
|
|
|
|
|
function. */
|
|
|
|
|
if (!subfunction)
|
|
|
|
|
{
|
|
|
|
|
printf (" rtx_insn *insn ATTRIBUTE_UNUSED;\n");
|
|
|
|
|
printf (" insn = safe_as_a <rtx_insn *> (uncast_insn);\n");
|
|
|
|
|
}
|
|
|
|
|
|
1999-10-13 19:22:40 +02:00
|
|
|
|
if (head->first)
|
2011-05-26 21:16:05 +02:00
|
|
|
|
write_tree (head, &root_pos, type, 1);
|
1999-10-13 19:22:40 +02:00
|
|
|
|
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\
|
function.h: Flatten file.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* function.h: Flatten file. Remove includes, adjust prototypes to
reflect only what is in function.h.
(enum direction, struct args_size, struct locate_and_pad_arg_data,
ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Relocate
from expr.h.
(ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD): Relocate from rtl.h.
(optimize_function_for_size_p, optimize_function_for_speed_p): Move
prototypes to predict.h.
(init_varasm_status): Move prototype to varasm.h.
* expr.h: Adjust include files.
(enum direction, struct args_size, struct locate_and_pad_arg_data,
ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Move
to function.h.
(locate_and_pad_parm): Move prototype to function.h.
* rtl.h: (assign_stack_local, ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD,
assign_stack_local_1, assign_stack_temp, assign_stack_temp_for_type,
assign_temp, reposition_prologue_and_epilogue_notes,
prologue_epilogue_contains, sibcall_epilogue_contains,
update_temp_slot_address, maybe_copy_prologue_epilogue_insn,
set_return_jump_label): Move prototypes to function.h.
* predict.h (optimize_function_for_size_p,
optimize_function_for_speed_p): Relocate prototypes from function.h.
* shrink-wrap.h (emit_return_into_block, active_insn_between,
convert_jumps_to_returns, emit_return_for_exit): Move prototypes to
function.h.
* varasm.h (init_varasm_status): Relocate prototype from function.h.
* genattrtab.c (write_header): Add predict.h to include list.
* genconditions.c (write_header): Add predict.h to include list.
* genemit.c (main): Adjust header file includes.
* gengtype.c (ifiles): Add flattened function.h header files.
* genoutput.c (output_prologue): Add predict.h to include list.
* genpreds.c (write_insn_preds_c): Adjust header file includes.
* genrecog.c (write_header): Add flattened function.h header files.
* alias.c: Adjust include files.
* auto-inc-dec.c: Likewise.
* basic-block.h: Likewise.
* bb-reorder.c: Likewise.
* bt-load.c: Likewise.
* builtins.c: Likewise.
* caller-save.c: Likewise.
* calls.c: Likewise.
* cfgbuild.c: Likewise.
* cfgcleanup.c: Likewise.
* cfgexpand.c: Likewise.
* cfgloop.c: Likewise.
* cfgloop.h: Likewise.
* cfgrtl.c: Likewise.
* cgraph.h: Likewise.
* cgraphclones.c: Likewise.
* cgraphunit.c: Likewise.
* combine-stack-adj.c: Likewise.
* combine.c: Likewise.
* coverage.c: Likewise.
* cprop.c: Likewise.
* cse.c: Likewise.
* cselib.c: Likewise.
* dbxout.c: Likewise.
* ddg.c: Likewise.
* df-core.c: Likewise.
* df-problems.c: Likewise.
* df-scan.c: Likewise.
* dojump.c: Likewise.
* dwarf2cfi.c: Likewise.
* dwarf2out.c: Likewise.
* emit-rtl.c: Likewise.
* except.c: Likewise.
* explow.c: Likewise.
* expr.c: Likewise.
* final.c: Likewise.
* function.c: Likewise.
* gcse.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-low.c: Likewise.
* gimple-streamer.h: Likewise.
* haifa-sched.c: Likewise.
* ifcvt.c: Likewise.
* ira.c: Likewise.
* jump.c: Likewise.
* lcm.c: Likewise.
* loop-invariant.c: Likewise.
* lra-assigns.c: Likewise.
* lra-coalesce.c: Likewise.
* lra-constraints.c: Likewise.
* lra-eliminations.c: Likewise.
* lra-lives.c: Likewise.
* lra-spills.c: Likewise.
* lra.c: Likewise.
* lto-cgraph.c: Likewise.
* lto-section-in.c: Likewise.
* lto-section-out.c: Likewise.
* lto-streamer-in.c: Likewise.
* lto-streamer-out.c: Likewise.
* mode-switching.c: Likewise.
* modulo-sched.c: Likewise.
* omp-low.c: Likewise.
* optabs.c: Likewise.
* passes.c: Likewise.
* postreload-gcse.c: Likewise.
* postreload.c: Likewise.
* predict.c: Likewise.
* profile.c: Likewise.
* recog.c: Likewise.
* ree.c: Likewise.
* reg-stack.c: Likewise.
* regcprop.c: Likewise.
* reginfo.c: Likewise.
* regrename.c: Likewise.
* reload.c: Likewise.
* reload1.c: Likewise.
* reorg.c: Likewise.
* resource.c: Likewise.
* rtlanal.c: Likewise.
* sched-deps.c: Likewise.
* sched-ebb.c: Likewise.
* sched-rgn.c: Likewise.
* sel-sched-dump.c: Likewise.
* sel-sched-ir.c: Likewise.
* sel-sched.c: Likewise.
* shrink-wrap.c: Likewise.
* simplify-rtx.c: Likewise.
* statistics.c: Likewise.
* stmt.c: Likewise.
* stor-layout.c: Likewise.
* store-motion.c: Likewise.
* symtab.c: Likewise.
* targhooks.c: Likewise.
* toplev.c: Likewise.
* trans-mem.c: Likewise.
* tree-cfg.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-dfa.c: Likewise.
* tree-eh.c: Likewise.
* tree-inline.c: Likewise.
* tree-into-ssa.c: Likewise.
* tree-nested.c: Likewise.
* tree-nrv.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-alias.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-copy.c: Likewise.
* tree-ssa-copyrename.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-ssa-operands.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-ssa-tail-merge.c: Likewise.
* tree-ssa-threadedge.c: Likewise.
* tree-ssa-threadupdate.c: Likewise.
* tree-ssa-uncprop.c: Likewise.
* tree-ssa-uninit.c: Likewise.
* tree-ssa.c: Likewise.
* tree-stdarg.c: Likewise.
* tree-tailcall.c: Likewise.
* tree.c: Likewise.
* tsan.c: Likewise.
* valtrack.c: Likewise.
* varasm.c: Likewise.
* vmsdbgout.c: Likewise.
* web.c: Likewise.
* testsuite/g++.dg/plugin/pragma_plugin.c: Adjust include files.
* config/aarch64/aarch64.c: Add flattened includes from function.h.
* config/alpha/alpha.c: Likewise.
* config/arc/arc.c: Likewise.
* config/arm/arm.c: Likewise.
* config/avr/avr-log.c: Likewise.
* config/avr/avr.c: Likewise.
* config/bfin/bfin.c: Likewise.
* config/c6x/c6x.c: Likewise.
* config/cr16/cr16.c: Likewise.
* config/cris/cris.c: Likewise.
* config/darwin.c: Likewise.
* config/epiphany/epiphany.c: Likewise.
* config/epiphany/mode-switch-use.c: Likewise.
* config/epiphany/resolve-sw-modes.c: Likewise.
* config/fr30/fr30.c: Likewise.
* config/frv/frv.c: Likewise.
* config/h8300/h8300.c: Likewise.
* config/i386/i386.c: Likewise.
* config/ia64/ia64.c: Likewise.
* config/iq2000/iq2000.c: Likewise.
* config/lm32/lm32.c: Likewise.
* config/m32c/m32c.c: Likewise.
* config/m32r/m32r.c: Likewise.
* config/m68k/m68k.c: Likewise.
* config/mcore/mcore.c: Likewise.
* config/mep/mep-pragma.c: Likewise.
* config/mep/mep.c: Likewise.
* config/microblaze/microblaze.c: Likewise.
* config/mips/mips.c: Likewise.
* config/mmix/mmix.c: Likewise.
* config/mn10300/mn10300.c: Likewise.
* config/moxie/moxie.c: Likewise.
* config/msp430/msp430.c: Likewise.
* config/nds32/nds32-cost.c: Likewise.
* config/nds32/nds32-fp-as-gp.c: Likewise.
* config/nds32/nds32-intrinsic.c: Likewise.
* config/nds32/nds32-isr.c: Likewise.
* config/nds32/nds32-md-auxiliary.c: Likewise.
* config/nds32/nds32-memory-manipulation.c: Likewise.
* config/nds32/nds32-pipelines-auxiliary.c: Likewise.
* config/nds32/nds32-predicates.c: Likewise.
* config/nds32/nds32.c: Likewise.
* config/nios2/nios2.c: Likewise.
* config/pa/pa.c: Likewise.
* config/pdp11/pdp11.c: Likewise.
* config/rl78/rl78.c: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/rx/rx.c: Likewise.
* config/s390/s390.c: Likewise.
* config/score/score.c: Likewise.
* config/sh/sh.c: Likewise.
* config/sparc/sparc.c: Likewise.
* config/spu/spu.c: Likewise.
* config/stormy16/stormy16.c: Likewise.
* config/tilegx/tilegx.c: Likewise.
* config/tilepro/tilepro.c: Likewise.
* config/v850/v850.c: Likewise.
* config/vax/vax.c: Likewise.
* config/xtensa/xtensa.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* ada/gcc-interface/misc.c: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* c/c-decl.c: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* c-family/c-pragma.c: Adjust include files.
* c-family/c-semantics.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* cp/cp-tree.h: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* fortran/f95-lang.c: Adjust include files.
* fortran/trans-decl.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* java/class.c: Adjust include files.
* java/resource.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* objc/objc-act.c: Adjust include files.
From-SVN: r216337
2014-10-16 18:37:19 +02:00
|
|
|
|
#include \"hashtab.h\"\n\
|
|
|
|
|
#include \"hash-set.h\"\n\
|
|
|
|
|
#include \"vec.h\"\n\
|
|
|
|
|
#include \"machmode.h\"\n\
|
|
|
|
|
#include \"hard-reg-set.h\"\n\
|
|
|
|
|
#include \"input.h\"\n\
|
1999-10-05 07:18:54 +02:00
|
|
|
|
#include \"function.h\"\n\
|
|
|
|
|
#include \"insn-config.h\"\n\
|
|
|
|
|
#include \"recog.h\"\n\
|
|
|
|
|
#include \"output.h\"\n\
|
|
|
|
|
#include \"flags.h\"\n\
|
1999-10-08 19:10:19 +02:00
|
|
|
|
#include \"hard-reg-set.h\"\n\
|
2014-10-27 13:41:01 +01:00
|
|
|
|
#include \"predict.h\"\n\
|
|
|
|
|
#include \"basic-block.h\"\n\
|
1999-10-08 19:10:19 +02:00
|
|
|
|
#include \"resource.h\"\n\
|
2010-07-09 03:34:40 +02:00
|
|
|
|
#include \"diagnostic-core.h\"\n\
|
2001-07-03 08:22:01 +02:00
|
|
|
|
#include \"reload.h\"\n\
|
2007-05-30 19:07:58 +02:00
|
|
|
|
#include \"regs.h\"\n\
|
2006-03-29 23:07:12 +02:00
|
|
|
|
#include \"tm-constrs.h\"\n\
|
function.h: Flatten file.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* function.h: Flatten file. Remove includes, adjust prototypes to
reflect only what is in function.h.
(enum direction, struct args_size, struct locate_and_pad_arg_data,
ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Relocate
from expr.h.
(ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD): Relocate from rtl.h.
(optimize_function_for_size_p, optimize_function_for_speed_p): Move
prototypes to predict.h.
(init_varasm_status): Move prototype to varasm.h.
* expr.h: Adjust include files.
(enum direction, struct args_size, struct locate_and_pad_arg_data,
ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Move
to function.h.
(locate_and_pad_parm): Move prototype to function.h.
* rtl.h: (assign_stack_local, ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD,
assign_stack_local_1, assign_stack_temp, assign_stack_temp_for_type,
assign_temp, reposition_prologue_and_epilogue_notes,
prologue_epilogue_contains, sibcall_epilogue_contains,
update_temp_slot_address, maybe_copy_prologue_epilogue_insn,
set_return_jump_label): Move prototypes to function.h.
* predict.h (optimize_function_for_size_p,
optimize_function_for_speed_p): Relocate prototypes from function.h.
* shrink-wrap.h (emit_return_into_block, active_insn_between,
convert_jumps_to_returns, emit_return_for_exit): Move prototypes to
function.h.
* varasm.h (init_varasm_status): Relocate prototype from function.h.
* genattrtab.c (write_header): Add predict.h to include list.
* genconditions.c (write_header): Add predict.h to include list.
* genemit.c (main): Adjust header file includes.
* gengtype.c (ifiles): Add flattened function.h header files.
* genoutput.c (output_prologue): Add predict.h to include list.
* genpreds.c (write_insn_preds_c): Adjust header file includes.
* genrecog.c (write_header): Add flattened function.h header files.
* alias.c: Adjust include files.
* auto-inc-dec.c: Likewise.
* basic-block.h: Likewise.
* bb-reorder.c: Likewise.
* bt-load.c: Likewise.
* builtins.c: Likewise.
* caller-save.c: Likewise.
* calls.c: Likewise.
* cfgbuild.c: Likewise.
* cfgcleanup.c: Likewise.
* cfgexpand.c: Likewise.
* cfgloop.c: Likewise.
* cfgloop.h: Likewise.
* cfgrtl.c: Likewise.
* cgraph.h: Likewise.
* cgraphclones.c: Likewise.
* cgraphunit.c: Likewise.
* combine-stack-adj.c: Likewise.
* combine.c: Likewise.
* coverage.c: Likewise.
* cprop.c: Likewise.
* cse.c: Likewise.
* cselib.c: Likewise.
* dbxout.c: Likewise.
* ddg.c: Likewise.
* df-core.c: Likewise.
* df-problems.c: Likewise.
* df-scan.c: Likewise.
* dojump.c: Likewise.
* dwarf2cfi.c: Likewise.
* dwarf2out.c: Likewise.
* emit-rtl.c: Likewise.
* except.c: Likewise.
* explow.c: Likewise.
* expr.c: Likewise.
* final.c: Likewise.
* function.c: Likewise.
* gcse.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-low.c: Likewise.
* gimple-streamer.h: Likewise.
* haifa-sched.c: Likewise.
* ifcvt.c: Likewise.
* ira.c: Likewise.
* jump.c: Likewise.
* lcm.c: Likewise.
* loop-invariant.c: Likewise.
* lra-assigns.c: Likewise.
* lra-coalesce.c: Likewise.
* lra-constraints.c: Likewise.
* lra-eliminations.c: Likewise.
* lra-lives.c: Likewise.
* lra-spills.c: Likewise.
* lra.c: Likewise.
* lto-cgraph.c: Likewise.
* lto-section-in.c: Likewise.
* lto-section-out.c: Likewise.
* lto-streamer-in.c: Likewise.
* lto-streamer-out.c: Likewise.
* mode-switching.c: Likewise.
* modulo-sched.c: Likewise.
* omp-low.c: Likewise.
* optabs.c: Likewise.
* passes.c: Likewise.
* postreload-gcse.c: Likewise.
* postreload.c: Likewise.
* predict.c: Likewise.
* profile.c: Likewise.
* recog.c: Likewise.
* ree.c: Likewise.
* reg-stack.c: Likewise.
* regcprop.c: Likewise.
* reginfo.c: Likewise.
* regrename.c: Likewise.
* reload.c: Likewise.
* reload1.c: Likewise.
* reorg.c: Likewise.
* resource.c: Likewise.
* rtlanal.c: Likewise.
* sched-deps.c: Likewise.
* sched-ebb.c: Likewise.
* sched-rgn.c: Likewise.
* sel-sched-dump.c: Likewise.
* sel-sched-ir.c: Likewise.
* sel-sched.c: Likewise.
* shrink-wrap.c: Likewise.
* simplify-rtx.c: Likewise.
* statistics.c: Likewise.
* stmt.c: Likewise.
* stor-layout.c: Likewise.
* store-motion.c: Likewise.
* symtab.c: Likewise.
* targhooks.c: Likewise.
* toplev.c: Likewise.
* trans-mem.c: Likewise.
* tree-cfg.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-dfa.c: Likewise.
* tree-eh.c: Likewise.
* tree-inline.c: Likewise.
* tree-into-ssa.c: Likewise.
* tree-nested.c: Likewise.
* tree-nrv.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-alias.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-copy.c: Likewise.
* tree-ssa-copyrename.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-ssa-operands.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-ssa-tail-merge.c: Likewise.
* tree-ssa-threadedge.c: Likewise.
* tree-ssa-threadupdate.c: Likewise.
* tree-ssa-uncprop.c: Likewise.
* tree-ssa-uninit.c: Likewise.
* tree-ssa.c: Likewise.
* tree-stdarg.c: Likewise.
* tree-tailcall.c: Likewise.
* tree.c: Likewise.
* tsan.c: Likewise.
* valtrack.c: Likewise.
* varasm.c: Likewise.
* vmsdbgout.c: Likewise.
* web.c: Likewise.
* testsuite/g++.dg/plugin/pragma_plugin.c: Adjust include files.
* config/aarch64/aarch64.c: Add flattened includes from function.h.
* config/alpha/alpha.c: Likewise.
* config/arc/arc.c: Likewise.
* config/arm/arm.c: Likewise.
* config/avr/avr-log.c: Likewise.
* config/avr/avr.c: Likewise.
* config/bfin/bfin.c: Likewise.
* config/c6x/c6x.c: Likewise.
* config/cr16/cr16.c: Likewise.
* config/cris/cris.c: Likewise.
* config/darwin.c: Likewise.
* config/epiphany/epiphany.c: Likewise.
* config/epiphany/mode-switch-use.c: Likewise.
* config/epiphany/resolve-sw-modes.c: Likewise.
* config/fr30/fr30.c: Likewise.
* config/frv/frv.c: Likewise.
* config/h8300/h8300.c: Likewise.
* config/i386/i386.c: Likewise.
* config/ia64/ia64.c: Likewise.
* config/iq2000/iq2000.c: Likewise.
* config/lm32/lm32.c: Likewise.
* config/m32c/m32c.c: Likewise.
* config/m32r/m32r.c: Likewise.
* config/m68k/m68k.c: Likewise.
* config/mcore/mcore.c: Likewise.
* config/mep/mep-pragma.c: Likewise.
* config/mep/mep.c: Likewise.
* config/microblaze/microblaze.c: Likewise.
* config/mips/mips.c: Likewise.
* config/mmix/mmix.c: Likewise.
* config/mn10300/mn10300.c: Likewise.
* config/moxie/moxie.c: Likewise.
* config/msp430/msp430.c: Likewise.
* config/nds32/nds32-cost.c: Likewise.
* config/nds32/nds32-fp-as-gp.c: Likewise.
* config/nds32/nds32-intrinsic.c: Likewise.
* config/nds32/nds32-isr.c: Likewise.
* config/nds32/nds32-md-auxiliary.c: Likewise.
* config/nds32/nds32-memory-manipulation.c: Likewise.
* config/nds32/nds32-pipelines-auxiliary.c: Likewise.
* config/nds32/nds32-predicates.c: Likewise.
* config/nds32/nds32.c: Likewise.
* config/nios2/nios2.c: Likewise.
* config/pa/pa.c: Likewise.
* config/pdp11/pdp11.c: Likewise.
* config/rl78/rl78.c: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/rx/rx.c: Likewise.
* config/s390/s390.c: Likewise.
* config/score/score.c: Likewise.
* config/sh/sh.c: Likewise.
* config/sparc/sparc.c: Likewise.
* config/spu/spu.c: Likewise.
* config/stormy16/stormy16.c: Likewise.
* config/tilegx/tilegx.c: Likewise.
* config/tilepro/tilepro.c: Likewise.
* config/v850/v850.c: Likewise.
* config/vax/vax.c: Likewise.
* config/xtensa/xtensa.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* ada/gcc-interface/misc.c: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* c/c-decl.c: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* c-family/c-pragma.c: Adjust include files.
* c-family/c-semantics.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* cp/cp-tree.h: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* fortran/f95-lang.c: Adjust include files.
* fortran/trans-decl.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* java/class.c: Adjust include files.
* java/resource.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* objc/objc-act.c: Adjust include files.
From-SVN: r216337
2014-10-16 18:37:19 +02:00
|
|
|
|
#include \"predict.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;
|
2011-05-26 21:16:05 +02:00
|
|
|
|
struct position *c_test_pos, **pos_ptr;
|
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
|
|
|
|
|
2011-05-26 21:16:05 +02:00
|
|
|
|
c_test_pos = &root_pos;
|
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));
|
2011-05-26 21:16:05 +02:00
|
|
|
|
pos_ptr = &peep2_insn_pos_list;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
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)
|
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
c_test_pos = next_position (pos_ptr, &root_pos,
|
2011-07-20 17:26:57 +02:00
|
|
|
|
POS_PEEP2_INSN, j);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
XVECEXP (x, 0, j) = tmp;
|
|
|
|
|
j++;
|
2011-05-26 21:16:05 +02:00
|
|
|
|
pos_ptr = &c_test_pos->next;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
XVECLEN (x, 0) = j;
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
memset (&head, 0, sizeof (head));
|
2011-05-26 21:16:05 +02:00
|
|
|
|
last = add_to_sequence (x, &head, &root_pos, type, 1);
|
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;
|
|
|
|
|
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
|
|
|
|
{
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
rtx new_rtx;
|
1999-10-05 07:18:54 +02:00
|
|
|
|
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)
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
new_rtx = XVECEXP (x, 0, 0);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
else
|
1999-10-05 07:18:54 +02:00
|
|
|
|
{
|
|
|
|
|
int j;
|
|
|
|
|
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
new_rtx = rtx_alloc (PARALLEL);
|
|
|
|
|
XVEC (new_rtx, 0) = rtvec_alloc (i);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
for (j = i - 1; j >= 0; j--)
|
genattrtab.c (insert_right_side, [...]): Avoid C++ keywords.
* genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++
keywords.
* genemit.c (gen_insn): Likewise.
* gengtype.c (note_def_vec): Likewise.
* gengtype.h (note_def_vec): Likewise.
* genoutput.c (struct data, output_insn_data, process_template,
gen_expand, gen_split, note_constraint): Likewise.
* genrecog.c (new_decision, add_to_sequence, factor_tests,
make_insn_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
From-SVN: r137653
2008-07-09 08:45:21 +02:00
|
|
|
|
XVECEXP (new_rtx, 0, j) = XVECEXP (x, 0, j);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Recognize it. */
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
memset (&clobber_head, 0, sizeof (clobber_head));
|
2011-05-26 21:16:05 +02:00
|
|
|
|
last = add_to_sequence (new_rtx, &clobber_head, &root_pos,
|
|
|
|
|
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)
|
|
|
|
|
{
|
2011-05-26 21:16:05 +02:00
|
|
|
|
last = new_decision (&root_pos, &last->success);
|
1999-10-05 07:18:54 +02:00
|
|
|
|
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. */
|
Use rtx_insn internally within generated functions
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* recog.h (insn_output_fn): Update this function typedef to match
the changes below to the generated output functions, strengthening
the 2nd param from rtx to rtx_insn *.
* final.c (get_insn_template): Add a checked cast to rtx_insn * on
insn when invoking an output function, to match the new signature
of insn_output_fn with a stronger second param.
* genconditions.c (write_header): In the generated code for
gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
to match the other changes in this patch.
* genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
implementations.
* genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
the subfunctions within the generated "recog_", "split", "peephole2"
function trees from rtx to rtx_insn *. For now, the top-level
generated functions ("recog", "split", "peephole2") continue to
take a plain rtx for "insn", to avoid introducing dependencies on
other patches. Rename this 2nd param from "insn" to
"uncast_insn", and reintroduce "insn" as a local variable of type
rtx_insn *, initialized at the top of the generated function with
a checked cast on "uncast_insn".
(make_insn_sequence): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
prototypes.
* genoutput.c (process_template): Strengthen the 2nd param within
the generated "output_" functions "insn" from rtx to rtx_insn *.
From-SVN: r214257
2014-08-21 09:49:28 +02:00
|
|
|
|
printf ("extern rtx gen_split_%d (rtx_insn *, 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. */
|
Use rtx_insn internally within generated functions
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* recog.h (insn_output_fn): Update this function typedef to match
the changes below to the generated output functions, strengthening
the 2nd param from rtx to rtx_insn *.
* final.c (get_insn_template): Add a checked cast to rtx_insn * on
insn when invoking an output function, to match the new signature
of insn_output_fn with a stronger second param.
* genconditions.c (write_header): In the generated code for
gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
to match the other changes in this patch.
* genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
implementations.
* genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
the subfunctions within the generated "recog_", "split", "peephole2"
function trees from rtx to rtx_insn *. For now, the top-level
generated functions ("recog", "split", "peephole2") continue to
take a plain rtx for "insn", to avoid introducing dependencies on
other patches. Rename this 2nd param from "insn" to
"uncast_insn", and reintroduce "insn" as a local variable of type
rtx_insn *, initialized at the top of the generated function with
a checked cast on "uncast_insn".
(make_insn_sequence): Strengthen the 1st param "curr_insn" of
the generated "gen_" functions from rtx to rtx_insn * within their
prototypes.
* genoutput.c (process_template): Strengthen the 2nd param within
the generated "output_" functions "insn" from rtx to rtx_insn *.
From-SVN: r214257
2014-08-21 09:49:28 +02:00
|
|
|
|
printf ("extern rtx gen_peephole2_%d (rtx_insn *, 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. */
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
simplify_tests (head);
|
1999-10-14 06:07:03 +02:00
|
|
|
|
|
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
|
|
|
|
|
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H).
gcc/
* Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H).
* genmddeps.c: Include read-md.h.
(main): Call init_rtx_reader_args instead of init_md_reader_args.
* genattr.c (main): Likewise.
* genattrtab.c (main): Likewise.
* genautomata.c (main): Likewise.
* gencodes.c (main): Likewise.
* genconditions.c (main): Likewise.
* genconfig.c (main): Likewise.
* genconstants.c (main): Likewise.
* genemit.c (main): Likewise.
* genextract.c (main): Likewise.
* genflags.c (main): Likewise.
* genopinit.c (main): Likewise.
* genoutput.c (main): Likewise.
* genpeep.c (main): Likewise.
* genrecog.c (main): Likewise.
* genpreds.c (main): Likewise.
* gensupport.h (in_fname): Move to read-md.h.
(init_md_reader_args_cb): Rename to...
(init_rtx_reader_args_cb): ...this and return a bool.
(init_md_reader_args): Rename to...
(init_rtx_reader_args): ...this and return a bool.
(include_callback): Move to read-md.h.
* gensupport.c (in_fname, include_callback, base_dir, max_include_len)
(file_name_list, first_dir_md_include): Move to read-md.c
(first_bracket_include): Delete unused variable.
(last_dir_md_include): Move to read-md.c.
(process_include): Delete, moving code to read-md.c:handle_include.
(process_rtx): Don't handle INCLUDE.
(save_string): Delete.
(rtx_handle_directive): New function.
(init_md_reader_args_cb): Rename to...
(init_rtx_reader_args_cb): ...this and return a boolean success value.
Use read_md_args.
(init_md_reader_args): Rename to...
(init_rtx_reader_args): ...this and return a boolean success value.
* rtl.def (INCLUDE): Delete.
* rtl.h (read_rtx): Remove "int *" argument. Add "const char *"
argument.
* read-rtl.c (read_conditions): Don't gobble ')' here.
(read_mapping): Likewise.
(read_rtx): Remove LINENO argument. Add RTX_NAME argument.
Handle top-level non-rtx constructs here rather than in read_rtx_1.
Store the whole queue in *X. Remove call to init_md_reader.
(read_rtx_1): Rename to...
(read_rtx_code): ...this. Call read_nested_rtx to read subrtxes.
Don't handle top-level non-rtx constructs here. Don't handle (nil)
here.
(read_nested_rtx): New function. Handle (nil) here rather than
in read_rtx_code.
(read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't
gobble ')' here.
* read-md.h (directive_handler_t): New type.
(in_fname, include_callback): Moved from read-md.h.
(read_constants, init_md_reader): Delete.
(read_md_files): Declare.
* read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include)
(last_dir_md_include_ptr, include_callback, max_include_len): Moved
from gensupport.c.
(read_constants): Rename to...
(handle_constants): ...this. Don't gobble ')' here.
(handle_include, handle_file, handle_toplevel_file)
(parse_include): New functions, mostly taken from gensupport.c.
(init_md_reader): Subsume into...
(read_md_files): ...this new function.
From-SVN: r160577
2010-06-10 22:23:13 +02:00
|
|
|
|
if (!init_rtx_reader_args (argc, argv))
|
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_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
|
|
|
|
}
|
|
|
|
|
|
2010-06-10 22:21:59 +02:00
|
|
|
|
if (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)",
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
test->u.pred.name, GET_MODE_NAME (test->u.pred.mode));
|
1999-10-05 07:18:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case DT_c_test:
|
|
|
|
|
{
|
|
|
|
|
char sub[16+4];
|
alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
gimple.h, godump.c, graphite-clast-to-gimple.c,
graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
whitespace before "(".
From-SVN: r203004
2013-09-28 10:42:34 +02:00
|
|
|
|
strncpy (sub, test->u.c_test, sizeof (sub));
|
1999-10-05 07:18:54 +02:00
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION.
* tree-vrp.c (debug_value_range, debug_all_value_ranges,
debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION.
* tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs,
debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks,
debug_names_replaced_by, debug_update_ssa): Likewise.
* sbitmap.c (debug_sbitmap): Likewise.
* genrecog.c (debug_decision, debug_decision_list): Likewise.
* tree-pretty-print.c (debug_generic_expr, debug_generic_stmt,
debug_tree_chain): Likewise.
* tree-loop-distribution.c (debug_rdg_partitions): Likewise.
* cgraph.c (debug_cgraph_node, debug_cgraph): Likewise.
* optabs.c (debug_optab_libfuncs): Likewise.
(verify_loop_closed_ssa): Likewise.
* value-prof.c (verify_histograms): Likewise.
* reload.c (debug_reload_to_stream, debug_reload): Likewise.
* bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
* fold-const.c (debug_fold_checksum): Likewise.
* omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise.
* cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n):
Likewise.
* omega.c (debug_omega_problem): Likewise.
* cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise.
* tree-ssa-ccp.c (debug_lattice_value): Likewise.
* dominance.c (verify_dominators, debug_dominance_info,
debug_dominance_tree): Likewise.
* df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno,
* df_regno_debug, df_ref_debug,
debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref,
debug_df_defno, debug_df_useno, debug_df_chain): Likewise.
* tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise.
* sel-sched.c (debug_state): Likewise.
* tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise.
* cfganal.c (print_edge_list, verify_edge_list): Likewise.
* dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise.
* tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise.
* gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise.
* c-pretty-print.c (debug_c_tree): Likewise.
* sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn
debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector,
debug_hard_reg_set, debug_mem_addr_value): Likewise.
* ebitmap.c (debug_ebitmap): Likewise.
* function.c (debug_find_var_in_block_tree): Likewise.
* print-rtl.c (debug_rtx): Likewise.
(debug_rtx_count): Likewise.
(debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise.
* stor-layout.c (debug_rli): Likewise.
* ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise.
* tree-data-ref.c (debug_data_references, debug_data_dependence_relations,
debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex,
debug_rdg_component, debug_rdg): Likewise.
* tree-affine.c (debug_aff): Likewise.
* tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise.
* except.c (debug_eh_tree, verify_eh_tree): Likewise.
* emit-rtl.c (verify_rtl_sharing): Likewise.
* tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set,
debug_value_expressions): Likewise.
* tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise.
* sese.c (debug_rename_map, debug_ivtype_map): Likewise.
* print-tree.c (debug_tree, debug_vec_tree): Likewise.
* cfglayout.c (verify_insn_chain): Likewise.
* graphite-clast-to-gimple.c (debug_clast_name_indexes,
debug_clast_stmt, debug_generated_program): Likewise.
* ggc-page.c (debug_print_page_list): Likewise.
* tree-ssa-ter.c (debug_ter): Likewise.
* graphite-dependences.c (debug_pddr): Likewise.
* sched-deps.c (debug_ds): Likewise.
* tree-ssa.c (verify_ssa): Likewise.
* graphite-poly.c (debug_scattering_function, debug_iteration_domain,
debug_scattering_functions, debug_iteration_domains, debug_pdr,
debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop,
debug_cloog, debug_scop_params, debug_lst): Likewise.
* tree-inline.c (debug_find_tree): Likewise.
* graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix,
debug_ppl_powerset_matrix): Likewise.
* var-tracking.c (debug_dv): Likewise.
* system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define.
* cfgloop.c (verify_loop_structure): Likewise.
* plugin.c (dump_active_plugins, debug_active_plugins): Likewise.
* c-common.c (verify_sequence_points): Likewise.
* sched-rgn.c (debug_regions, debug_region, debug_candidate,
debug_candidates, debug_rgn_dependencies): Likewise.
* tree-ssa-structalias.c (debug_constraint, debug_constraints,
* debug_constraint_graph, debug_solution_for_var,
debug_sa_points_to_info): Likewise.
* sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim):
Likewie.
* tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function,
debug_loops, debug_loop, debug_loop_num): Likewise.
* passes.c (debug_pass): Likewise.
(dump_properties): Likewise; add cfglayout property.
(debug_properties): Likewise.
* tree-ssa-reassoc.c (debug_ops_vector): Likewise.
* varpool.c (debug_varpool): Likewise.
* regcprop.c (debug_value_data): Likewise.
* tree-ssa-operands.c (verify_imm_links, debug_immediate_uses,
debug_immediate_uses_for): Likewise.
From-SVN: r160036
2010-05-29 22:31:45 +02:00
|
|
|
|
DEBUG_FUNCTION 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
|
|
|
|
|
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION.
* tree-vrp.c (debug_value_range, debug_all_value_ranges,
debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION.
* tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs,
debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks,
debug_names_replaced_by, debug_update_ssa): Likewise.
* sbitmap.c (debug_sbitmap): Likewise.
* genrecog.c (debug_decision, debug_decision_list): Likewise.
* tree-pretty-print.c (debug_generic_expr, debug_generic_stmt,
debug_tree_chain): Likewise.
* tree-loop-distribution.c (debug_rdg_partitions): Likewise.
* cgraph.c (debug_cgraph_node, debug_cgraph): Likewise.
* optabs.c (debug_optab_libfuncs): Likewise.
(verify_loop_closed_ssa): Likewise.
* value-prof.c (verify_histograms): Likewise.
* reload.c (debug_reload_to_stream, debug_reload): Likewise.
* bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
* fold-const.c (debug_fold_checksum): Likewise.
* omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise.
* cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n):
Likewise.
* omega.c (debug_omega_problem): Likewise.
* cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise.
* tree-ssa-ccp.c (debug_lattice_value): Likewise.
* dominance.c (verify_dominators, debug_dominance_info,
debug_dominance_tree): Likewise.
* df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno,
* df_regno_debug, df_ref_debug,
debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref,
debug_df_defno, debug_df_useno, debug_df_chain): Likewise.
* tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise.
* sel-sched.c (debug_state): Likewise.
* tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise.
* cfganal.c (print_edge_list, verify_edge_list): Likewise.
* dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise.
* tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise.
* gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise.
* c-pretty-print.c (debug_c_tree): Likewise.
* sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn
debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector,
debug_hard_reg_set, debug_mem_addr_value): Likewise.
* ebitmap.c (debug_ebitmap): Likewise.
* function.c (debug_find_var_in_block_tree): Likewise.
* print-rtl.c (debug_rtx): Likewise.
(debug_rtx_count): Likewise.
(debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise.
* stor-layout.c (debug_rli): Likewise.
* ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise.
* tree-data-ref.c (debug_data_references, debug_data_dependence_relations,
debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex,
debug_rdg_component, debug_rdg): Likewise.
* tree-affine.c (debug_aff): Likewise.
* tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise.
* except.c (debug_eh_tree, verify_eh_tree): Likewise.
* emit-rtl.c (verify_rtl_sharing): Likewise.
* tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set,
debug_value_expressions): Likewise.
* tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise.
* sese.c (debug_rename_map, debug_ivtype_map): Likewise.
* print-tree.c (debug_tree, debug_vec_tree): Likewise.
* cfglayout.c (verify_insn_chain): Likewise.
* graphite-clast-to-gimple.c (debug_clast_name_indexes,
debug_clast_stmt, debug_generated_program): Likewise.
* ggc-page.c (debug_print_page_list): Likewise.
* tree-ssa-ter.c (debug_ter): Likewise.
* graphite-dependences.c (debug_pddr): Likewise.
* sched-deps.c (debug_ds): Likewise.
* tree-ssa.c (verify_ssa): Likewise.
* graphite-poly.c (debug_scattering_function, debug_iteration_domain,
debug_scattering_functions, debug_iteration_domains, debug_pdr,
debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop,
debug_cloog, debug_scop_params, debug_lst): Likewise.
* tree-inline.c (debug_find_tree): Likewise.
* graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix,
debug_ppl_powerset_matrix): Likewise.
* var-tracking.c (debug_dv): Likewise.
* system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define.
* cfgloop.c (verify_loop_structure): Likewise.
* plugin.c (dump_active_plugins, debug_active_plugins): Likewise.
* c-common.c (verify_sequence_points): Likewise.
* sched-rgn.c (debug_regions, debug_region, debug_candidate,
debug_candidates, debug_rgn_dependencies): Likewise.
* tree-ssa-structalias.c (debug_constraint, debug_constraints,
* debug_constraint_graph, debug_solution_for_var,
debug_sa_points_to_info): Likewise.
* sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim):
Likewie.
* tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function,
debug_loops, debug_loop, debug_loop_num): Likewise.
* passes.c (debug_pass): Likewise.
(dump_properties): Likewise; add cfglayout property.
(debug_properties): Likewise.
* tree-ssa-reassoc.c (debug_ops_vector): Likewise.
* varpool.c (debug_varpool): Likewise.
* regcprop.c (debug_value_data): Likewise.
* tree-ssa-operands.c (verify_imm_links, debug_immediate_uses,
debug_immediate_uses_for): Likewise.
From-SVN: r160036
2010-05-29 22:31:45 +02:00
|
|
|
|
DEBUG_FUNCTION 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;
|
|
|
|
|
}
|
|
|
|
|
}
|