1991-10-24 18:21:48 +01:00
|
|
|
/* Generate code from machine description to compute values of attributes.
|
2000-02-26 14:55:09 +01:00
|
|
|
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998,
|
2005-03-05 15:01:02 +01:00
|
|
|
1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
1994-02-10 14:08:17 +01:00
|
|
|
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
|
1991-10-24 18:21:48 +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.
|
1991-10-24 18:21:48 +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
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
|
|
version.
|
1991-10-24 18:21:48 +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
|
|
|
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.
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
2005-06-25 04:02:01 +02:00
|
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
02110-1301, USA. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-07 08:41:23 +02:00
|
|
|
/* This program handles insn attributes and the DEFINE_DELAY and
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
DEFINE_INSN_RESERVATION definitions.
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
It produces a series of functions named `get_attr_...', one for each insn
|
1991-10-24 18:21:48 +01:00
|
|
|
attribute. Each of these is given the rtx for an insn and returns a member
|
|
|
|
of the enum for the attribute.
|
|
|
|
|
|
|
|
These subroutines have the form of a `switch' on the INSN_CODE (via
|
|
|
|
`recog_memoized'). Each case either returns a constant attribute value
|
|
|
|
or a value that depends on tests on other attributes, the form of
|
|
|
|
operands, or some random C expression (encoded with a SYMBOL_REF
|
|
|
|
expression).
|
|
|
|
|
|
|
|
If the attribute `alternative', or a random C expression is present,
|
|
|
|
`constrain_operands' is called. If either of these cases of a reference to
|
1998-11-04 22:25:00 +01:00
|
|
|
an operand is found, `extract_insn' is called.
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2000-09-12 17:36:21 +02:00
|
|
|
The special attribute `length' is also recognized. For this operand,
|
1991-10-24 18:21:48 +01:00
|
|
|
expressions involving the address of an operand or the current insn,
|
|
|
|
(address (pc)), are valid. In this case, an initial pass is made to
|
|
|
|
set all lengths that do not depend on address. Those that do are set to
|
|
|
|
the maximum length. Then each insn that depends on an address is checked
|
|
|
|
and possibly has its length changed. The process repeats until no further
|
|
|
|
changed are made. The resulting lengths are saved for use by
|
|
|
|
`get_attr_length'.
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
A special form of DEFINE_ATTR, where the expression for default value is a
|
|
|
|
CONST expression, indicates an attribute that is constant for a given run
|
|
|
|
of the compiler. The subroutine generated for these attributes has no
|
|
|
|
parameters as it does not depend on any particular insn. Constant
|
|
|
|
attributes are typically used to specify which variety of processor is
|
|
|
|
used.
|
2000-09-12 17:36:21 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
Internal attributes are defined to handle DEFINE_DELAY and
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
DEFINE_INSN_RESERVATION. Special routines are output for these cases.
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
This program works by keeping a list of possible values for each attribute.
|
|
|
|
These include the basic attribute choices, default values for attribute, and
|
|
|
|
all derived quantities.
|
|
|
|
|
|
|
|
As the description file is read, the definition for each insn is saved in a
|
|
|
|
`struct insn_def'. When the file reading is complete, a `struct insn_ent'
|
|
|
|
is created for each insn and chained to the corresponding attribute value,
|
|
|
|
either that specified, or the default.
|
|
|
|
|
|
|
|
An optimization phase is then run. This simplifies expressions for each
|
|
|
|
insn. EQ_ATTR tests are resolved, whenever possible, to a test that
|
|
|
|
indicates when the attribute has the specified value for the insn. This
|
|
|
|
avoids recursive calls during compilation.
|
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
The strategy used when processing DEFINE_DELAY definitions is to create
|
|
|
|
arbitrarily complex expressions and have the optimization simplify them.
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
Once optimization is complete, any required routines and definitions
|
1992-03-06 23:25:46 +01:00
|
|
|
will be written.
|
|
|
|
|
|
|
|
An optimization that is not yet implemented is to hoist the constant
|
|
|
|
expressions entirely out of the routines and definitions that are written.
|
|
|
|
A way to do this is to iterate over all possible combinations of values
|
|
|
|
for constant attributes and generate a set of functions for that given
|
|
|
|
combination. An initialization function would be written that evaluates
|
|
|
|
the attributes and installs the corresponding set of routines and
|
1992-05-07 01:13:18 +02:00
|
|
|
definitions (each would be accessed through a pointer).
|
|
|
|
|
|
|
|
We use the flags in an RTX as follows:
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
`unchanging' (ATTR_IND_SIMPLIFIED_P): This rtx is fully simplified
|
1992-05-07 01:13:18 +02:00
|
|
|
independent of the insn code.
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
`in_struct' (ATTR_CURR_SIMPLIFIED_P): This rtx is fully simplified
|
1992-05-07 01:13:18 +02:00
|
|
|
for the insn code currently being processed (see optimize_attrs).
|
2004-05-13 08:41:07 +02:00
|
|
|
`return_val' (ATTR_PERMANENT_P): This rtx is permanent and unique
|
2005-04-15 18:35:26 +02:00
|
|
|
(see attr_rtx). */
|
1992-05-07 01:13:18 +02:00
|
|
|
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
#define ATTR_IND_SIMPLIFIED_P(RTX) (RTX_FLAG((RTX), unchanging))
|
|
|
|
#define ATTR_CURR_SIMPLIFIED_P(RTX) (RTX_FLAG((RTX), in_struct))
|
2004-05-13 08:41:07 +02:00
|
|
|
#define ATTR_PERMANENT_P(RTX) (RTX_FLAG((RTX), return_val))
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
#if 0
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
#define strcmp_check(S1, S2) ((S1) == (S2) \
|
|
|
|
? 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 (strcmp ((S1), (S2))), 1))
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
#else
|
|
|
|
#define strcmp_check(S1, S2) ((S1) != (S2))
|
|
|
|
#endif
|
|
|
|
|
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-10-24 18:21:48 +01:00
|
|
|
#include "rtl.h"
|
1999-09-05 18:08:20 +02:00
|
|
|
#include "ggc.h"
|
2000-05-03 19:45:26 +02:00
|
|
|
#include "gensupport.h"
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1997-12-07 01:31:01 +01:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
# include <sys/resource.h>
|
1992-11-10 16:28:47 +01:00
|
|
|
#endif
|
|
|
|
|
1992-11-26 06:35:53 +01:00
|
|
|
/* We must include obstack.h after <sys/time.h>, to avoid lossage with
|
|
|
|
/usr/include/sys/stdtypes.h on Sun OS 4.x. */
|
|
|
|
#include "obstack.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"
|
1992-11-26 06:35:53 +01:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
#include "genattrtab.h"
|
|
|
|
|
Makefile.in (gensupport.o): Compile for the host.
* Makefile.in (gensupport.o): Compile for the host.
(host-prefix gensuuprt.o): Remove.
(genflags.o): Depend on gensupport.h and OBSTACK_H.
(genattrtab.o): Likewise.
(gencodes.o): Depend on gensupport.h.
(genemit.o, genopinit.o, genrecog.o, genextract.o): Likewise.
(genpeep.o, genattr.o, genoutput.o): Likewise.
* gensupport.c (obstack, rtl_obstack): New.
(init_md_reader): Initialize rtl_obstack.
* gensupport.h (rtl_obstack): Declare.
(message_with_line): Declare.
* genattr.c: Remove all traces of obstack manipulation.
* gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise.
* genopinit.c, genoutput.c, genpeep.c, genrecog.c: Likewise.
* genattrtab.c (obstack, rtl_obstack): Remove.
(main): Don't init rtl_obstack.
* genflags.c: Likewise.
* genrecog.c (message_with_line): Move ...
* gensupport.c: ... here.
From-SVN: r33742
2000-05-07 00:30:13 +02:00
|
|
|
static struct obstack obstack1, obstack2;
|
1992-05-05 00:57:54 +02:00
|
|
|
struct obstack *hash_obstack = &obstack1;
|
1992-05-05 23:48:14 +02:00
|
|
|
struct obstack *temp_obstack = &obstack2;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-08-27 22:56:29 +02:00
|
|
|
/* enough space to reserve for printing out ints */
|
|
|
|
#define MAX_DIGITS (HOST_BITS_PER_INT * 3 / 10 + 3)
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Define structures used to record attributes and values. */
|
|
|
|
|
|
|
|
/* As each DEFINE_INSN, DEFINE_PEEPHOLE, or DEFINE_ASM_ATTRIBUTES is
|
|
|
|
encountered, we store all the relevant information into a
|
|
|
|
`struct insn_def'. This is done to allow attribute definitions to occur
|
|
|
|
anywhere in the file. */
|
|
|
|
|
|
|
|
struct insn_def
|
|
|
|
{
|
1996-07-04 00:07:53 +02:00
|
|
|
struct insn_def *next; /* Next insn in chain. */
|
|
|
|
rtx def; /* The DEFINE_... */
|
2000-07-31 01:38:26 +02:00
|
|
|
int insn_code; /* Instruction number. */
|
|
|
|
int insn_index; /* Expression numer in file, for errors. */
|
|
|
|
int lineno; /* Line number. */
|
1991-10-24 18:21:48 +01:00
|
|
|
int num_alternatives; /* Number of alternatives. */
|
1996-07-04 00:07:53 +02:00
|
|
|
int vec_idx; /* Index of attribute vector in `def'. */
|
1991-10-24 18:21:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Once everything has been read in, we store in each attribute value a list
|
|
|
|
of insn codes that have that value. Here is the structure used for the
|
|
|
|
list. */
|
|
|
|
|
|
|
|
struct insn_ent
|
|
|
|
{
|
2000-07-31 01:38:26 +02:00
|
|
|
struct insn_ent *next; /* Next in chain. */
|
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
|
|
|
struct insn_def *def; /* Instruction definition. */
|
1991-10-24 18:21:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Each value of an attribute (either constant or computed) is assigned a
|
|
|
|
structure which is used as the listhead of the insns that have that
|
|
|
|
value. */
|
|
|
|
|
|
|
|
struct attr_value
|
|
|
|
{
|
|
|
|
rtx value; /* Value of attribute. */
|
|
|
|
struct attr_value *next; /* Next attribute value in chain. */
|
|
|
|
struct insn_ent *first_insn; /* First insn with this value. */
|
|
|
|
int num_insns; /* Number of insns with this value. */
|
|
|
|
int has_asm_insn; /* True if this value used for `asm' insns */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Structure for each attribute. */
|
|
|
|
|
|
|
|
struct attr_desc
|
|
|
|
{
|
1996-07-04 00:07:53 +02:00
|
|
|
char *name; /* Name of attribute. */
|
|
|
|
struct attr_desc *next; /* Next attribute. */
|
2003-07-09 02:38:40 +02:00
|
|
|
struct attr_value *first_value; /* First value of this attribute. */
|
|
|
|
struct attr_value *default_val; /* Default value for this attribute. */
|
|
|
|
int lineno : 24; /* Line number. */
|
1998-06-16 12:48:57 +02:00
|
|
|
unsigned is_numeric : 1; /* Values of this attribute are numeric. */
|
|
|
|
unsigned is_const : 1; /* Attribute value constant for each run. */
|
|
|
|
unsigned is_special : 1; /* Don't call `write_attr_set'. */
|
2003-07-09 02:44:34 +02:00
|
|
|
unsigned static_p : 1; /* Make the output function static. */
|
1991-10-24 18:21:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Structure for each DEFINE_DELAY. */
|
|
|
|
|
|
|
|
struct delay_desc
|
|
|
|
{
|
|
|
|
rtx def; /* DEFINE_DELAY expression. */
|
1996-07-04 00:07:53 +02:00
|
|
|
struct delay_desc *next; /* Next DEFINE_DELAY. */
|
1991-10-24 18:21:48 +01:00
|
|
|
int num; /* Number of DEFINE_DELAY, starting at 1. */
|
2000-07-31 01:38:26 +02:00
|
|
|
int lineno; /* Line number. */
|
1991-10-24 18:21:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Listheads of above structures. */
|
|
|
|
|
1992-05-07 01:13:18 +02:00
|
|
|
/* This one is indexed by the first character of the attribute name. */
|
|
|
|
#define MAX_ATTRS_INDEX 256
|
|
|
|
static struct attr_desc *attrs[MAX_ATTRS_INDEX];
|
1991-10-24 18:21:48 +01:00
|
|
|
static struct insn_def *defs;
|
|
|
|
static struct delay_desc *delays;
|
1993-03-06 14:42:58 +01:00
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* Other variables. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static int insn_code_number;
|
|
|
|
static int insn_index_number;
|
|
|
|
static int got_define_asm_attributes;
|
|
|
|
static int must_extract;
|
|
|
|
static int must_constrain;
|
|
|
|
static int address_used;
|
1992-09-24 13:28:09 +02:00
|
|
|
static int length_used;
|
1991-10-24 18:21:48 +01:00
|
|
|
static int num_delays;
|
|
|
|
static int have_annul_true, have_annul_false;
|
1994-10-12 16:31:29 +01:00
|
|
|
static int num_insn_ents;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
int num_dfa_decls;
|
|
|
|
|
1992-05-07 01:13:18 +02:00
|
|
|
/* Stores, for each insn code, the number of constraint alternatives. */
|
|
|
|
|
|
|
|
static int *insn_n_alternatives;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Stores, for each insn code, a bitmap that has bits on for each possible
|
|
|
|
alternative. */
|
|
|
|
|
|
|
|
static int *insn_alternatives;
|
|
|
|
|
|
|
|
/* Used to simplify expressions. */
|
|
|
|
|
|
|
|
static rtx true_rtx, false_rtx;
|
|
|
|
|
|
|
|
/* Used to reduce calls to `strcmp' */
|
|
|
|
|
2005-08-05 11:42:06 +02:00
|
|
|
static const char *alternative_name;
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
static const char *length_str;
|
|
|
|
static const char *delay_type_str;
|
|
|
|
static const char *delay_1_0_str;
|
|
|
|
static const char *num_delay_slots_str;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1998-01-28 20:21:54 +01:00
|
|
|
/* Indicate that REG_DEAD notes are valid if dead_or_set_p is ever
|
|
|
|
called. */
|
|
|
|
|
|
|
|
int reload_completed = 0;
|
|
|
|
|
1998-06-29 23:40:49 +02:00
|
|
|
/* Some machines test `optimize' in macros called from rtlanal.c, so we need
|
|
|
|
to define it here. */
|
|
|
|
|
1998-01-30 09:04:59 +01:00
|
|
|
int optimize = 0;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Simplify an expression. Only call the routine if there is something to
|
|
|
|
simplify. */
|
|
|
|
#define SIMPLIFY_TEST_EXP(EXP,INSN_CODE,INSN_INDEX) \
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
(ATTR_IND_SIMPLIFIED_P (EXP) || ATTR_CURR_SIMPLIFIED_P (EXP) ? (EXP) \
|
1991-10-24 18:21:48 +01:00
|
|
|
: simplify_test_exp (EXP, INSN_CODE, INSN_INDEX))
|
2000-09-12 17:36:21 +02:00
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
#define DEF_ATTR_STRING(S) (attr_string ((S), strlen (S)))
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* These are referenced by rtlanal.c and hence need to be defined somewhere.
|
|
|
|
They won't actually be used. */
|
|
|
|
|
1999-09-18 20:16:44 +02:00
|
|
|
rtx global_rtl[GR_MAX];
|
1998-04-04 15:32:39 +02:00
|
|
|
rtx pic_offset_table_rtx;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2003-06-01 18:02:11 +02:00
|
|
|
static void attr_hash_add_rtx (int, rtx);
|
|
|
|
static void attr_hash_add_string (int, char *);
|
|
|
|
static rtx attr_rtx (enum rtx_code, ...);
|
|
|
|
static rtx attr_rtx_1 (enum rtx_code, va_list);
|
|
|
|
static char *attr_string (const char *, int);
|
|
|
|
static rtx check_attr_value (rtx, struct attr_desc *);
|
|
|
|
static rtx convert_set_attr_alternative (rtx, struct insn_def *);
|
|
|
|
static rtx convert_set_attr (rtx, struct insn_def *);
|
|
|
|
static void check_defs (void);
|
|
|
|
static rtx make_canonical (struct attr_desc *, rtx);
|
|
|
|
static struct attr_value *get_attr_value (rtx, struct attr_desc *, int);
|
|
|
|
static rtx copy_rtx_unchanging (rtx);
|
|
|
|
static rtx copy_boolean (rtx);
|
|
|
|
static void expand_delays (void);
|
|
|
|
static void fill_attr (struct attr_desc *);
|
|
|
|
static rtx substitute_address (rtx, rtx (*) (rtx), rtx (*) (rtx));
|
|
|
|
static void make_length_attrs (void);
|
|
|
|
static rtx identity_fn (rtx);
|
|
|
|
static rtx zero_fn (rtx);
|
|
|
|
static rtx one_fn (rtx);
|
|
|
|
static rtx max_fn (rtx);
|
|
|
|
static void write_length_unit_log (void);
|
|
|
|
static rtx simplify_cond (rtx, int, int);
|
|
|
|
static void clear_struct_flag (rtx);
|
|
|
|
static void remove_insn_ent (struct attr_value *, struct insn_ent *);
|
|
|
|
static void insert_insn_ent (struct attr_value *, struct insn_ent *);
|
|
|
|
static rtx insert_right_side (enum rtx_code, rtx, rtx, int, int);
|
|
|
|
static rtx make_alternative_compare (int);
|
|
|
|
static int compute_alternative_mask (rtx, enum rtx_code);
|
|
|
|
static rtx evaluate_eq_attr (rtx, rtx, int, int);
|
|
|
|
static rtx simplify_and_tree (rtx, rtx *, int, int);
|
|
|
|
static rtx simplify_or_tree (rtx, rtx *, int, int);
|
|
|
|
static rtx simplify_test_exp (rtx, int, int);
|
|
|
|
static rtx simplify_test_exp_in_temp (rtx, int, int);
|
|
|
|
static void optimize_attrs (void);
|
|
|
|
static void gen_attr (rtx, int);
|
|
|
|
static int count_alternatives (rtx);
|
|
|
|
static int compares_alternatives_p (rtx);
|
|
|
|
static int contained_in_p (rtx, rtx);
|
|
|
|
static void gen_insn (rtx, int);
|
|
|
|
static void gen_delay (rtx, int);
|
|
|
|
static void write_test_expr (rtx, int);
|
|
|
|
static int max_attr_value (rtx, int*);
|
|
|
|
static int or_attr_value (rtx, int*);
|
|
|
|
static void walk_attr_value (rtx);
|
|
|
|
static void write_attr_get (struct attr_desc *);
|
|
|
|
static rtx eliminate_known_true (rtx, rtx, int, int);
|
|
|
|
static void write_attr_set (struct attr_desc *, int, rtx,
|
|
|
|
const char *, const char *, rtx,
|
|
|
|
int, int);
|
2004-09-09 22:39:28 +02:00
|
|
|
static void write_insn_cases (struct insn_ent *, int);
|
2003-06-01 18:02:11 +02:00
|
|
|
static void write_attr_case (struct attr_desc *, struct attr_value *,
|
|
|
|
int, const char *, const char *, int, rtx);
|
|
|
|
static void write_attr_valueq (struct attr_desc *, const char *);
|
|
|
|
static void write_attr_value (struct attr_desc *, rtx);
|
|
|
|
static void write_upcase (const char *);
|
|
|
|
static void write_indent (int);
|
|
|
|
static void write_eligible_delay (const char *);
|
|
|
|
static int write_expr_attr_cache (rtx, struct attr_desc *);
|
|
|
|
static void write_const_num_delay_slots (void);
|
|
|
|
static char *next_comma_elt (const char **);
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
static struct attr_desc *find_attr (const char **, int);
|
2003-06-01 18:02:11 +02:00
|
|
|
static struct attr_value *find_most_used (struct attr_desc *);
|
|
|
|
static rtx attr_eq (const char *, const char *);
|
|
|
|
static const char *attr_numeral (int);
|
|
|
|
static int attr_equal_p (rtx, rtx);
|
|
|
|
static rtx attr_copy_rtx (rtx);
|
|
|
|
static int attr_rtx_cost (rtx);
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
static bool attr_alt_subset_p (rtx, rtx);
|
|
|
|
static bool attr_alt_subset_of_compl_p (rtx, rtx);
|
|
|
|
static rtx attr_alt_intersection (rtx, rtx);
|
|
|
|
static rtx attr_alt_union (rtx, rtx);
|
|
|
|
static rtx attr_alt_complement (rtx);
|
|
|
|
static rtx mk_attr_alt (int);
|
1992-08-27 22:56:29 +02:00
|
|
|
|
|
|
|
#define oballoc(size) obstack_alloc (hash_obstack, size)
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
/* Hash table for sharing RTL and strings. */
|
|
|
|
|
|
|
|
/* Each hash table slot is a bucket containing a chain of these structures.
|
|
|
|
Strings are given negative hash codes; RTL expressions are given positive
|
|
|
|
hash codes. */
|
|
|
|
|
|
|
|
struct attr_hash
|
|
|
|
{
|
|
|
|
struct attr_hash *next; /* Next structure in the bucket. */
|
|
|
|
int hashcode; /* Hash code of this rtx or string. */
|
|
|
|
union
|
|
|
|
{
|
|
|
|
char *str; /* The string (negative hash codes) */
|
|
|
|
rtx rtl; /* or the RTL recorded here. */
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Now here is the hash table. When recording an RTL, it is added to
|
|
|
|
the slot whose index is the hash code mod the table size. Note
|
|
|
|
that the hash table is used for several kinds of RTL (see attr_rtx)
|
|
|
|
and for strings. While all these live in the same table, they are
|
|
|
|
completely independent, and the hash code is computed differently
|
|
|
|
for each. */
|
|
|
|
|
|
|
|
#define RTL_HASH_SIZE 4093
|
|
|
|
struct attr_hash *attr_hash_table[RTL_HASH_SIZE];
|
|
|
|
|
|
|
|
/* Here is how primitive or already-shared RTL's hash
|
|
|
|
codes are made. */
|
1998-02-08 13:26:43 +01:00
|
|
|
#define RTL_HASH(RTL) ((long) (RTL) & 0777777)
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
/* Add an entry to the hash table for RTL with hash code HASHCODE. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_hash_add_rtx (int hashcode, rtx rtl)
|
1992-03-06 23:25:46 +01:00
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
struct attr_hash *h;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
2003-07-19 16:47:15 +02:00
|
|
|
h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
|
1992-03-06 23:25:46 +01:00
|
|
|
h->hashcode = hashcode;
|
|
|
|
h->u.rtl = rtl;
|
|
|
|
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
|
|
|
|
attr_hash_table[hashcode % RTL_HASH_SIZE] = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add an entry to the hash table for STRING with hash code HASHCODE. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_hash_add_string (int hashcode, char *str)
|
1992-03-06 23:25:46 +01:00
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
struct attr_hash *h;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
2003-07-19 16:47:15 +02:00
|
|
|
h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
|
1992-03-06 23:25:46 +01:00
|
|
|
h->hashcode = -hashcode;
|
|
|
|
h->u.str = str;
|
|
|
|
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
|
|
|
|
attr_hash_table[hashcode % RTL_HASH_SIZE] = h;
|
|
|
|
}
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
/* Generate an RTL expression, but avoid duplicates.
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
Set the ATTR_PERMANENT_P flag for these permanent objects.
|
1992-05-05 23:48:14 +02:00
|
|
|
|
|
|
|
In some cases we cannot uniquify; then we return an ordinary
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
impermanent rtx with ATTR_PERMANENT_P clear.
|
1992-05-05 23:48:14 +02:00
|
|
|
|
2004-02-04 07:12:54 +01:00
|
|
|
Args are as follows:
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
rtx attr_rtx (code, [element1, ..., elementn]) */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_rtx_1 (enum rtx_code code, va_list p)
|
1992-03-06 23:25:46 +01:00
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
rtx rt_val = NULL_RTX;/* RTX to return to caller... */
|
1992-03-06 23:25:46 +01:00
|
|
|
int hashcode;
|
2001-10-11 05:16:15 +02:00
|
|
|
struct attr_hash *h;
|
1992-05-05 00:57:54 +02:00
|
|
|
struct obstack *old_obstack = rtl_obstack;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
/* For each of several cases, search the hash table for an existing entry.
|
|
|
|
Use that entry if one is found; otherwise create a new RTL and add it
|
|
|
|
to the table. */
|
|
|
|
|
alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes...
2004-02-07 Paolo Bonzini <bonzini@gnu.org>
* alias.c (rtx_equal_for_memref_p): Use predicates
to test rtx classes and new rtx class codes, possibly
splitting conditionals that tested against '<' and 'o'.
* caller-save.c (save_call_clobbered_regs): Likewise.
* combine.c (contains_muldiv, find_split_point, subst,
combine_simplify_rtx, simplify_if_then_else,
simplify_set, simplify_logical, expand_compound_operation,
make_compound_operation, if_then_else_cond, known_cond,
apply_distributive_law, cached_nonzero_bits,
cached_num_sign_bit_copies, simplify_shift_const,
gen_binary, simplify_comparison, update_table_tick,
record_value_for_reg, get_lsat_value_validate): Likewise.
* cse.c (mention_regs, find_best_addr, find_comparison_args,
fold_rtx, cse_insn, invalidate_memory, cse_basic_block):
Likewise.
* emit-rtl.c (copy_insn_1): Likewise.
* expr.c (force_operand): Likewise.
* final.c (final_scan_insn, get_mem_expr_from_op): Likewise.
* flow.c (notice_stack_pointer_modification_1,
invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond,
and_reg_cond, elim_reg_cond): Likewise.
* function.c (update_epilogue_consts): Likewise.
* genattrtab.c (attr_rtx_1): Likewise.
* genopinit.c (gen_insn): Likewise.
* integrate.c (subst_constants): Likewise.
* jump.c (reversed_comparison_code_parts,
reversed_comparison_code, delete_related_insns,
rtx_renumbered_equal_p): Likewise.
* local-alloc.c (block_alloc): Likewise.
* loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv,
canonicalize_condition): Likewise.
* loop-iv.c (simplify_using_conditions, iv_number_of_iterations):
Likewise.
* optabs.c (add_equal_node, expand_binop): Likewise.
* predict.c (estimate_probability): Likewise.
* ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, comparison_operator,
offsettable_address_p, constrain_operands): Likewise.
* reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat):
Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (stable_and_no_regs_but_for_p): Likewise.
* regrename.c (kill_autoinc_value): Likewise.
* reload.c (find_reusable_reload, find_reloads,
reg_overlap_mentioned_for_reload_p): Likewise.
* reload1.c (gen_reload, delete_address_reloads_1): Likewise.
* rtl.c (copy_rtx): Likewise.
* rtl.h (CONSTANT_P, INSN_P): Likewise.
* rtlanal.c (commutative_operand_precedence): Likewise.
* sched-deps.c (conditions_mutex_p): Likewise.
* sched-rgn.c (is_cfg_nonregular): Likewise.
* simplify-rtx.c (simplify_gen_binary,
simplify_gen_relational, simplify_replace_rtx,
simplify_unary_operation, simplify_binary_operation,
simplify_ternary_operation, simplify_rtx): Likewise.
* unroll.c (reg_dead_after_loop): Likewise.
* config/alpha/alpha.c (alpha_swapped_comparison_operator,
print_operand): Likewise.
* config/arc/arc.c (proper_comparison_operator): Likewise.
* config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode):
Likewise.
* config/avr/avr.c (_reg_unused_after): Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests,
frv_ifcvt_modify_insn, frv_pack_insn): Likewise.
* config/i386/i386.c (ix86_comparison_operator,
ix86_carry_flag_operator, fcmov_comparison_operator,
arith_or_logical_operator, print_operand,
ix86_expand_binary_operator, ix86_binary_operator_ok):
Likewise.
* config/i386/i386.md: Likewise.
* config/ia64/ia64.c (not_postinc_memory_operand,
ia64_print_operand, update_set_flags, errata_emit_nops):
Likewise.
* config/ia64/ia64.h (PREFERRED_RELOAD_CLASS,
CONSTRAINT_OK_FOR_S): Likewise.
* config/ip2k/ip2k.c (mdr_resequence_xy_yx,
mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref,
ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p,
ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator):
Likewise.
* config/iq2000/iq2000.c (cmp_op, symbolic_expression_p,
eqne_comparison_operator, signed_comparison_operator):
Likewise.
* config/mips/mips.c (cmp_op, symbolic_expression_p):
Likewise.
* config/mmix/mmix (mmix_foldable_comparison_operator,
mmix_comparison_operator): Likewise.
* config/pa/pa.c (hppa_legitimize_address): Likewise.
* config/rs6000/rs6000.c (stmw_operation,
branch_comparison_operator, trap_comparison_operator,
ccr_bit): Likewise.
* config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise.
* config/s390/s390.c (s390_alc_comparison,
s390_slb_comparison):L Likewise.
* config/sh/sh.c (gen_block_redirect, reg_unused_after):
Likewise.
* config/sparc/sparc.c (eq_or_neq, normal_comp_operator,
noov_compare_op, noov_compare64_op, v9_regcmp_op,
emit_hard_tfmode_operation, reg_unused_after)
* doc/md.texi, doc/rtl.texi: Likewise.
* ra-debug.c: Add 2004 to list of copyright years.
* unroll.c: Likewise.
* combine.c (simplify_logical): Remove dummy test,
(apply_distributive_law): Fix typo in comment.
GET_CODE (x) == AND so x is a commutative binary op.
* jump.c (delete_related_insns): simplify loop
condition, move testing of RTX codes inside the loop.
(rtx_renumbered_equal_p): do not use RTX_CODE.
* rtl.c (rtx_class): Declare as enum rtx_class.
* rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED):
Move to RTX_COMM_COMPARE class.
(HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE):
Move to RTX_CONST_OBJ class.
* rtl.h (enum rtx_class): New declaration,
(RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK,
RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT,
RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK,
RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT,
RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P,
ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P,
SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P,
OBJECT_P): New macros.
* config/sparc/sparc.c (noov_compare_op): Remove register
from parameter.
From-SVN: r78824
2004-03-03 09:35:33 +01:00
|
|
|
if (GET_RTX_CLASS (code) == RTX_UNARY)
|
1992-03-06 23:25:46 +01:00
|
|
|
{
|
|
|
|
rtx arg0 = va_arg (p, rtx);
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
/* A permanent object cannot point to impermanent ones. */
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (! ATTR_PERMANENT_P (arg0))
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
|
|
|
rt_val = rtx_alloc (code);
|
|
|
|
XEXP (rt_val, 0) = arg0;
|
|
|
|
return rt_val;
|
|
|
|
}
|
|
|
|
|
1992-08-30 04:41:36 +02:00
|
|
|
hashcode = ((HOST_WIDE_INT) code + RTL_HASH (arg0));
|
1992-03-06 23:25:46 +01:00
|
|
|
for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
|
|
|
|
if (h->hashcode == hashcode
|
|
|
|
&& GET_CODE (h->u.rtl) == code
|
|
|
|
&& XEXP (h->u.rtl, 0) == arg0)
|
2001-11-30 02:55:24 +01:00
|
|
|
return h->u.rtl;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
if (h == 0)
|
|
|
|
{
|
1992-05-05 00:57:54 +02:00
|
|
|
rtl_obstack = hash_obstack;
|
1992-03-06 23:25:46 +01:00
|
|
|
rt_val = rtx_alloc (code);
|
|
|
|
XEXP (rt_val, 0) = arg0;
|
|
|
|
}
|
|
|
|
}
|
alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes...
2004-02-07 Paolo Bonzini <bonzini@gnu.org>
* alias.c (rtx_equal_for_memref_p): Use predicates
to test rtx classes and new rtx class codes, possibly
splitting conditionals that tested against '<' and 'o'.
* caller-save.c (save_call_clobbered_regs): Likewise.
* combine.c (contains_muldiv, find_split_point, subst,
combine_simplify_rtx, simplify_if_then_else,
simplify_set, simplify_logical, expand_compound_operation,
make_compound_operation, if_then_else_cond, known_cond,
apply_distributive_law, cached_nonzero_bits,
cached_num_sign_bit_copies, simplify_shift_const,
gen_binary, simplify_comparison, update_table_tick,
record_value_for_reg, get_lsat_value_validate): Likewise.
* cse.c (mention_regs, find_best_addr, find_comparison_args,
fold_rtx, cse_insn, invalidate_memory, cse_basic_block):
Likewise.
* emit-rtl.c (copy_insn_1): Likewise.
* expr.c (force_operand): Likewise.
* final.c (final_scan_insn, get_mem_expr_from_op): Likewise.
* flow.c (notice_stack_pointer_modification_1,
invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond,
and_reg_cond, elim_reg_cond): Likewise.
* function.c (update_epilogue_consts): Likewise.
* genattrtab.c (attr_rtx_1): Likewise.
* genopinit.c (gen_insn): Likewise.
* integrate.c (subst_constants): Likewise.
* jump.c (reversed_comparison_code_parts,
reversed_comparison_code, delete_related_insns,
rtx_renumbered_equal_p): Likewise.
* local-alloc.c (block_alloc): Likewise.
* loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv,
canonicalize_condition): Likewise.
* loop-iv.c (simplify_using_conditions, iv_number_of_iterations):
Likewise.
* optabs.c (add_equal_node, expand_binop): Likewise.
* predict.c (estimate_probability): Likewise.
* ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, comparison_operator,
offsettable_address_p, constrain_operands): Likewise.
* reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat):
Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (stable_and_no_regs_but_for_p): Likewise.
* regrename.c (kill_autoinc_value): Likewise.
* reload.c (find_reusable_reload, find_reloads,
reg_overlap_mentioned_for_reload_p): Likewise.
* reload1.c (gen_reload, delete_address_reloads_1): Likewise.
* rtl.c (copy_rtx): Likewise.
* rtl.h (CONSTANT_P, INSN_P): Likewise.
* rtlanal.c (commutative_operand_precedence): Likewise.
* sched-deps.c (conditions_mutex_p): Likewise.
* sched-rgn.c (is_cfg_nonregular): Likewise.
* simplify-rtx.c (simplify_gen_binary,
simplify_gen_relational, simplify_replace_rtx,
simplify_unary_operation, simplify_binary_operation,
simplify_ternary_operation, simplify_rtx): Likewise.
* unroll.c (reg_dead_after_loop): Likewise.
* config/alpha/alpha.c (alpha_swapped_comparison_operator,
print_operand): Likewise.
* config/arc/arc.c (proper_comparison_operator): Likewise.
* config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode):
Likewise.
* config/avr/avr.c (_reg_unused_after): Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests,
frv_ifcvt_modify_insn, frv_pack_insn): Likewise.
* config/i386/i386.c (ix86_comparison_operator,
ix86_carry_flag_operator, fcmov_comparison_operator,
arith_or_logical_operator, print_operand,
ix86_expand_binary_operator, ix86_binary_operator_ok):
Likewise.
* config/i386/i386.md: Likewise.
* config/ia64/ia64.c (not_postinc_memory_operand,
ia64_print_operand, update_set_flags, errata_emit_nops):
Likewise.
* config/ia64/ia64.h (PREFERRED_RELOAD_CLASS,
CONSTRAINT_OK_FOR_S): Likewise.
* config/ip2k/ip2k.c (mdr_resequence_xy_yx,
mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref,
ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p,
ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator):
Likewise.
* config/iq2000/iq2000.c (cmp_op, symbolic_expression_p,
eqne_comparison_operator, signed_comparison_operator):
Likewise.
* config/mips/mips.c (cmp_op, symbolic_expression_p):
Likewise.
* config/mmix/mmix (mmix_foldable_comparison_operator,
mmix_comparison_operator): Likewise.
* config/pa/pa.c (hppa_legitimize_address): Likewise.
* config/rs6000/rs6000.c (stmw_operation,
branch_comparison_operator, trap_comparison_operator,
ccr_bit): Likewise.
* config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise.
* config/s390/s390.c (s390_alc_comparison,
s390_slb_comparison):L Likewise.
* config/sh/sh.c (gen_block_redirect, reg_unused_after):
Likewise.
* config/sparc/sparc.c (eq_or_neq, normal_comp_operator,
noov_compare_op, noov_compare64_op, v9_regcmp_op,
emit_hard_tfmode_operation, reg_unused_after)
* doc/md.texi, doc/rtl.texi: Likewise.
* ra-debug.c: Add 2004 to list of copyright years.
* unroll.c: Likewise.
* combine.c (simplify_logical): Remove dummy test,
(apply_distributive_law): Fix typo in comment.
GET_CODE (x) == AND so x is a commutative binary op.
* jump.c (delete_related_insns): simplify loop
condition, move testing of RTX codes inside the loop.
(rtx_renumbered_equal_p): do not use RTX_CODE.
* rtl.c (rtx_class): Declare as enum rtx_class.
* rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED):
Move to RTX_COMM_COMPARE class.
(HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE):
Move to RTX_CONST_OBJ class.
* rtl.h (enum rtx_class): New declaration,
(RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK,
RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT,
RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK,
RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT,
RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P,
ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P,
SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P,
OBJECT_P): New macros.
* config/sparc/sparc.c (noov_compare_op): Remove register
from parameter.
From-SVN: r78824
2004-03-03 09:35:33 +01:00
|
|
|
else if (GET_RTX_CLASS (code) == RTX_BIN_ARITH
|
|
|
|
|| GET_RTX_CLASS (code) == RTX_COMM_ARITH
|
|
|
|
|| GET_RTX_CLASS (code) == RTX_COMPARE
|
|
|
|
|| GET_RTX_CLASS (code) == RTX_COMM_COMPARE)
|
1992-03-06 23:25:46 +01:00
|
|
|
{
|
|
|
|
rtx arg0 = va_arg (p, rtx);
|
|
|
|
rtx arg1 = va_arg (p, rtx);
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
/* A permanent object cannot point to impermanent ones. */
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (! ATTR_PERMANENT_P (arg0) || ! ATTR_PERMANENT_P (arg1))
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
|
|
|
rt_val = rtx_alloc (code);
|
|
|
|
XEXP (rt_val, 0) = arg0;
|
|
|
|
XEXP (rt_val, 1) = arg1;
|
|
|
|
return rt_val;
|
|
|
|
}
|
|
|
|
|
1992-08-30 04:41:36 +02:00
|
|
|
hashcode = ((HOST_WIDE_INT) code + RTL_HASH (arg0) + RTL_HASH (arg1));
|
1992-03-06 23:25:46 +01:00
|
|
|
for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
|
|
|
|
if (h->hashcode == hashcode
|
|
|
|
&& GET_CODE (h->u.rtl) == code
|
|
|
|
&& XEXP (h->u.rtl, 0) == arg0
|
|
|
|
&& XEXP (h->u.rtl, 1) == arg1)
|
2001-11-30 02:55:24 +01:00
|
|
|
return h->u.rtl;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
if (h == 0)
|
|
|
|
{
|
1992-05-05 00:57:54 +02:00
|
|
|
rtl_obstack = hash_obstack;
|
1992-03-06 23:25:46 +01:00
|
|
|
rt_val = rtx_alloc (code);
|
|
|
|
XEXP (rt_val, 0) = arg0;
|
|
|
|
XEXP (rt_val, 1) = arg1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (GET_RTX_LENGTH (code) == 1
|
|
|
|
&& GET_RTX_FORMAT (code)[0] == 's')
|
|
|
|
{
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
char *arg0 = va_arg (p, char *);
|
1992-03-06 23:25:46 +01:00
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
arg0 = DEF_ATTR_STRING (arg0);
|
1992-05-05 23:48:14 +02:00
|
|
|
|
1992-08-30 04:41:36 +02:00
|
|
|
hashcode = ((HOST_WIDE_INT) code + RTL_HASH (arg0));
|
1992-03-06 23:25:46 +01:00
|
|
|
for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
|
|
|
|
if (h->hashcode == hashcode
|
|
|
|
&& GET_CODE (h->u.rtl) == code
|
|
|
|
&& XSTR (h->u.rtl, 0) == arg0)
|
2001-11-30 02:55:24 +01:00
|
|
|
return h->u.rtl;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
if (h == 0)
|
|
|
|
{
|
1992-05-05 00:57:54 +02:00
|
|
|
rtl_obstack = hash_obstack;
|
1992-03-06 23:25:46 +01:00
|
|
|
rt_val = rtx_alloc (code);
|
|
|
|
XSTR (rt_val, 0) = arg0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (GET_RTX_LENGTH (code) == 2
|
|
|
|
&& GET_RTX_FORMAT (code)[0] == 's'
|
|
|
|
&& GET_RTX_FORMAT (code)[1] == 's')
|
|
|
|
{
|
1992-05-05 23:48:14 +02:00
|
|
|
char *arg0 = va_arg (p, char *);
|
|
|
|
char *arg1 = va_arg (p, char *);
|
1992-03-06 23:25:46 +01:00
|
|
|
|
1992-08-30 04:41:36 +02:00
|
|
|
hashcode = ((HOST_WIDE_INT) code + RTL_HASH (arg0) + RTL_HASH (arg1));
|
1992-03-06 23:25:46 +01:00
|
|
|
for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
|
|
|
|
if (h->hashcode == hashcode
|
|
|
|
&& GET_CODE (h->u.rtl) == code
|
|
|
|
&& XSTR (h->u.rtl, 0) == arg0
|
|
|
|
&& XSTR (h->u.rtl, 1) == arg1)
|
2001-11-30 02:55:24 +01:00
|
|
|
return h->u.rtl;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
if (h == 0)
|
|
|
|
{
|
1992-05-05 00:57:54 +02:00
|
|
|
rtl_obstack = hash_obstack;
|
1992-03-06 23:25:46 +01:00
|
|
|
rt_val = rtx_alloc (code);
|
|
|
|
XSTR (rt_val, 0) = arg0;
|
|
|
|
XSTR (rt_val, 1) = arg1;
|
|
|
|
}
|
|
|
|
}
|
1992-05-05 23:48:14 +02:00
|
|
|
else if (code == CONST_INT)
|
|
|
|
{
|
1992-07-06 22:02:55 +02:00
|
|
|
HOST_WIDE_INT arg0 = va_arg (p, HOST_WIDE_INT);
|
1992-05-05 23:48:14 +02:00
|
|
|
if (arg0 == 0)
|
2001-11-30 02:55:24 +01:00
|
|
|
return false_rtx;
|
|
|
|
else if (arg0 == 1)
|
|
|
|
return true_rtx;
|
|
|
|
else
|
|
|
|
goto nohash;
|
1992-05-05 23:48:14 +02:00
|
|
|
}
|
1992-03-06 23:25:46 +01:00
|
|
|
else
|
|
|
|
{
|
2001-11-30 02:55:24 +01:00
|
|
|
int i; /* Array indices... */
|
|
|
|
const char *fmt; /* Current rtx's format... */
|
1992-05-05 23:48:14 +02:00
|
|
|
nohash:
|
1992-03-06 23:25:46 +01:00
|
|
|
rt_val = rtx_alloc (code); /* Allocate the storage space. */
|
2000-09-12 17:36:21 +02:00
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
fmt = GET_RTX_FORMAT (code); /* Find the right format... */
|
|
|
|
for (i = 0; i < GET_RTX_LENGTH (code); i++)
|
|
|
|
{
|
|
|
|
switch (*fmt++)
|
|
|
|
{
|
|
|
|
case '0': /* Unused field. */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'i': /* An integer? */
|
|
|
|
XINT (rt_val, i) = va_arg (p, int);
|
|
|
|
break;
|
|
|
|
|
1992-07-06 22:02:55 +02:00
|
|
|
case 'w': /* A wide integer? */
|
|
|
|
XWINT (rt_val, i) = va_arg (p, HOST_WIDE_INT);
|
|
|
|
break;
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
case 's': /* A string? */
|
|
|
|
XSTR (rt_val, i) = va_arg (p, char *);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'e': /* An expression? */
|
|
|
|
case 'u': /* An insn? Same except when printing. */
|
|
|
|
XEXP (rt_val, i) = va_arg (p, rtx);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'E': /* An RTX vector? */
|
|
|
|
XVEC (rt_val, i) = va_arg (p, rtvec);
|
|
|
|
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-03-06 23:25:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return rt_val;
|
|
|
|
}
|
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
rtl_obstack = old_obstack;
|
1992-03-06 23:25:46 +01:00
|
|
|
attr_hash_add_rtx (hashcode, rt_val);
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_PERMANENT_P (rt_val) = 1;
|
1992-03-06 23:25:46 +01:00
|
|
|
return rt_val;
|
2001-11-30 02:55:24 +01:00
|
|
|
}
|
1992-03-06 23:25:46 +01:00
|
|
|
|
2001-11-30 02:55:24 +01:00
|
|
|
static rtx
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
attr_rtx (enum rtx_code code, ...)
|
2001-11-30 02:55:24 +01:00
|
|
|
{
|
|
|
|
rtx result;
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
va_list p;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
va_start (p, code);
|
2001-11-30 02:55:24 +01:00
|
|
|
result = attr_rtx_1 (code, p);
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
va_end (p);
|
2001-11-30 02:55:24 +01:00
|
|
|
return result;
|
1992-03-06 23:25:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Create a new string printed with the printf line arguments into a space
|
|
|
|
of at most LEN bytes:
|
|
|
|
|
|
|
|
rtx attr_printf (len, format, [arg1, ..., argn]) */
|
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
char *
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
attr_printf (unsigned int len, const char *fmt, ...)
|
1992-03-06 23:25:46 +01: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
|
|
|
char str[256];
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
va_list p;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
va_start (p, fmt);
|
2003-06-01 18:02:11 +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
|
|
|
gcc_assert (len < sizeof str); /* Leave room for \0. */
|
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
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
vsprintf (str, fmt, p);
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
va_end (p);
|
1992-03-06 23:25:46 +01:00
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
return DEF_ATTR_STRING (str);
|
1992-03-06 23:25:46 +01:00
|
|
|
}
|
|
|
|
|
1999-08-24 15:34:04 +02:00
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_eq (const char *name, const char *value)
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
return attr_rtx (EQ_ATTR, DEF_ATTR_STRING (name), DEF_ATTR_STRING (value));
|
1992-05-05 23:48:14 +02:00
|
|
|
}
|
|
|
|
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
static const char *
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_numeral (int n)
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
|
|
|
return XSTR (make_numeric_value (n), 0);
|
|
|
|
}
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
/* Return a permanent (possibly shared) copy of a string STR (not assumed
|
|
|
|
to be null terminated) with LEN bytes. */
|
|
|
|
|
|
|
|
static char *
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_string (const char *str, int len)
|
1992-03-06 23:25:46 +01:00
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
struct attr_hash *h;
|
1992-03-06 23:25:46 +01:00
|
|
|
int hashcode;
|
|
|
|
int i;
|
2001-10-11 05:16:15 +02:00
|
|
|
char *new_str;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
/* Compute the hash code. */
|
2000-09-12 17:36:21 +02:00
|
|
|
hashcode = (len + 1) * 613 + (unsigned) str[0];
|
1992-03-06 23:25:46 +01:00
|
|
|
for (i = 1; i <= len; i += 2)
|
2000-09-12 17:36:21 +02:00
|
|
|
hashcode = ((hashcode * 613) + (unsigned) str[i]);
|
1992-03-06 23:25:46 +01:00
|
|
|
if (hashcode < 0)
|
|
|
|
hashcode = -hashcode;
|
|
|
|
|
|
|
|
/* Search the table for the string. */
|
|
|
|
for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
|
1992-05-05 23:48:14 +02:00
|
|
|
if (h->hashcode == -hashcode && h->u.str[0] == str[0]
|
1992-03-14 06:07:15 +01:00
|
|
|
&& !strncmp (h->u.str, str, len))
|
1992-03-06 23:25:46 +01:00
|
|
|
return h->u.str; /* <-- return if found. */
|
|
|
|
|
|
|
|
/* Not found; create a permanent copy and add it to the hash table. */
|
2003-07-19 16:47:15 +02:00
|
|
|
new_str = obstack_alloc (hash_obstack, len + 1);
|
alpha.c (check_float_value): Use memcpy, not bcopy.
* alpha.c (check_float_value): Use memcpy, not bcopy.
* arm.c (output_move_double): Likewise.
* arm.md: Likewise.
* m88k.c (legitimize_operand): Likewise.
* m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise.
* m88k.md: Likewise.
* mips.c (override_options): Likewise.
* mips.md: Likewise.
* romp.c (output_fpops): Likewise.
* rs6000.c (rs6000_override_options): Likewise.
* sh.md: Likewise.
* vax.c (check_float_value): Likewise.
* emit-rtl.c (copy_rtx_if_shared, init_emit_once): Likewise.
* expmed.c (synth_mult): Likewise.
* final.c (add_bb_string): Likewise.
* genattr.c (main): Likewise.
* genattrtab.c (attr_string, simplify_cond, copy_rtx_unchanging):
Likewise.
* jump.c (thread_jumps): Likewise.
* prefix.c (save_string): Likewise.
* real.h (REAL_VALUE_FROM_CONST_DOUBLE): Likewise.
* regclass.c (init_reg_sets, init_reg_sets_1): Likewise.
* reload1.c (reload, eliminate_regs): Likewise.
cp:
* decl.c (grokdeclarator, save_function_data): Use memcpy, not bcopy.
* lex.c (copy_lang_decl): Likewise.
java:
* decl.c (copy_lang_decl): Use memcpy, not bcopy.
* jcf-parse.c (jcf_figure_file_type): Likewise.
From-SVN: r37367
2000-11-10 17:01:28 +01:00
|
|
|
memcpy (new_str, str, len);
|
1992-03-06 23:25:46 +01:00
|
|
|
new_str[len] = '\0';
|
|
|
|
attr_hash_add_string (hashcode, new_str);
|
|
|
|
|
|
|
|
return new_str; /* Return the new string. */
|
|
|
|
}
|
1992-05-05 23:48:14 +02:00
|
|
|
|
|
|
|
/* Check two rtx's for equality of contents,
|
|
|
|
taking advantage of the fact that if both are hashed
|
|
|
|
then they can't be equal unless they are the same object. */
|
|
|
|
|
1999-08-24 15:34:04 +02:00
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_equal_p (rtx x, rtx y)
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
return (x == y || (! (ATTR_PERMANENT_P (x) && ATTR_PERMANENT_P (y))
|
1992-05-05 23:48:14 +02:00
|
|
|
&& rtx_equal_p (x, y)));
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
/* Copy an attribute value expression,
|
|
|
|
descending to all depths, but not copying any
|
|
|
|
permanent hashed subexpressions. */
|
|
|
|
|
1999-08-24 15:34:04 +02:00
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_copy_rtx (rtx orig)
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
rtx copy;
|
|
|
|
int i, j;
|
|
|
|
RTX_CODE code;
|
|
|
|
const char *format_ptr;
|
1992-05-05 23:48:14 +02:00
|
|
|
|
|
|
|
/* No need to copy a permanent object. */
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (ATTR_PERMANENT_P (orig))
|
1992-05-05 23:48:14 +02:00
|
|
|
return orig;
|
|
|
|
|
|
|
|
code = GET_CODE (orig);
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
case REG:
|
|
|
|
case CONST_INT:
|
|
|
|
case CONST_DOUBLE:
|
2002-02-19 03:53:41 +01:00
|
|
|
case CONST_VECTOR:
|
1992-05-05 23:48:14 +02:00
|
|
|
case SYMBOL_REF:
|
|
|
|
case CODE_LABEL:
|
|
|
|
case PC:
|
|
|
|
case CC0:
|
|
|
|
return orig;
|
1997-11-02 22:19:36 +01:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1992-05-05 23:48:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
copy = rtx_alloc (code);
|
|
|
|
PUT_MODE (copy, GET_MODE (orig));
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_IND_SIMPLIFIED_P (copy) = ATTR_IND_SIMPLIFIED_P (orig);
|
|
|
|
ATTR_CURR_SIMPLIFIED_P (copy) = ATTR_CURR_SIMPLIFIED_P (orig);
|
|
|
|
ATTR_PERMANENT_P (copy) = ATTR_PERMANENT_P (orig);
|
2000-09-12 17:36:21 +02:00
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
|
|
|
|
|
|
|
|
for (i = 0; i < GET_RTX_LENGTH (GET_CODE (copy)); i++)
|
|
|
|
{
|
|
|
|
switch (*format_ptr++)
|
|
|
|
{
|
|
|
|
case 'e':
|
|
|
|
XEXP (copy, i) = XEXP (orig, i);
|
|
|
|
if (XEXP (orig, i) != NULL)
|
|
|
|
XEXP (copy, i) = attr_copy_rtx (XEXP (orig, i));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
case 'V':
|
|
|
|
XVEC (copy, i) = XVEC (orig, i);
|
|
|
|
if (XVEC (orig, i) != NULL)
|
|
|
|
{
|
|
|
|
XVEC (copy, i) = rtvec_alloc (XVECLEN (orig, i));
|
|
|
|
for (j = 0; j < XVECLEN (copy, i); j++)
|
|
|
|
XVECEXP (copy, i, j) = attr_copy_rtx (XVECEXP (orig, i, j));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1992-07-06 22:02:55 +02:00
|
|
|
case 'n':
|
|
|
|
case 'i':
|
1992-05-05 23:48:14 +02:00
|
|
|
XINT (copy, i) = XINT (orig, i);
|
|
|
|
break;
|
1992-07-06 22:02:55 +02:00
|
|
|
|
|
|
|
case 'w':
|
|
|
|
XWINT (copy, i) = XWINT (orig, i);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 's':
|
|
|
|
case 'S':
|
|
|
|
XSTR (copy, i) = XSTR (orig, i);
|
|
|
|
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-05-05 23:48:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return copy;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given a test expression for an attribute, ensure it is validly formed.
|
1992-03-06 23:25:46 +01:00
|
|
|
IS_CONST indicates whether the expression is constant for each compiler
|
|
|
|
run (a constant expression may not test any particular insn).
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
Convert (eq_attr "att" "a1,a2") to (ior (eq_attr ... ) (eq_attrq ..))
|
|
|
|
and (eq_attr "att" "!a1") to (not (eq_attr "att" "a1")). Do the latter
|
|
|
|
test first so that (eq_attr "att" "!a1,a2,a3") works as expected.
|
|
|
|
|
|
|
|
Update the string address in EQ_ATTR expression to be the same used
|
|
|
|
in the attribute (or `alternative_name') to speed up subsequent
|
|
|
|
`find_attr' calls and eliminate most `strcmp' calls.
|
|
|
|
|
2001-10-10 13:33:39 +02:00
|
|
|
Return the new expression, if any. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
check_attr_test (rtx exp, int is_const, int lineno)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_desc *attr;
|
|
|
|
struct attr_value *av;
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
const char *name_ptr, *p;
|
1991-10-24 18:21:48 +01:00
|
|
|
rtx orexp, newexp;
|
|
|
|
|
|
|
|
switch (GET_CODE (exp))
|
|
|
|
{
|
|
|
|
case EQ_ATTR:
|
|
|
|
/* Handle negation test. */
|
|
|
|
if (XSTR (exp, 1)[0] == '!')
|
1992-03-06 23:25:46 +01:00
|
|
|
return check_attr_test (attr_rtx (NOT,
|
1992-05-05 23:48:14 +02:00
|
|
|
attr_eq (XSTR (exp, 0),
|
|
|
|
&XSTR (exp, 1)[1])),
|
2000-07-31 01:38:26 +02:00
|
|
|
is_const, lineno);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
else if (n_comma_elts (XSTR (exp, 1)) == 1)
|
|
|
|
{
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
attr = find_attr (&XSTR (exp, 0), 0);
|
1991-10-24 18:21:48 +01:00
|
|
|
if (attr == NULL)
|
|
|
|
{
|
|
|
|
if (! strcmp (XSTR (exp, 0), "alternative"))
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
return mk_attr_alt (1 << atoi (XSTR (exp, 1)));
|
1992-05-05 00:57:54 +02:00
|
|
|
else
|
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading
capital from diagnostics.
* c-lex.c (cb_file_change): Similarly.
* c-parse.in : Similarly.
* cfgrtl.c (verify_flow_info): Similarly.
* collect2.c: Similarly.
* cppfiles.c (find_include_file): Similarly.
* cppinit.c (cpp_handle_option): Similarly.
* cpplex.c (cpp_spell_token): Similarly.
* cppmain.c (do_preprocessing): Similarly.
* gcc.c (translate_options, process_command, do_spec1,
main, pfatal_execute): Similarly.
* genattr.c (main): Similarly.
* genattrtab.c (check_attr_test, operate_exp, simplify_test_exp,
write_test_expr, main): Similarly.
* gencodes.c (main): Similarly.
* genconfig.c (main): Similarly.
* genconstants.c (main): Similarly.
* genemit.c (main): Similarly.
* genextract.c (main): Similarly.
* genflags.c (main): Similarly.
* genopinit.c (main): Similarly.
* genoutput.c (process_template, main): Similarly.
* genpeep.c (main): Similarly.
* genrecog.c (main): Similarly.
* gensupport.c (is_predicable, identify_predicable_attribute,
alter_predicate_for_insn, init_md_reader_args, main): Similarly.
* ggc-page.c (alloc_anon): Similarly.
* mips-tfile.c (add_string, add_procedure, add_file, read_line,
parse_begin, parse_bend, parse_def, parse_end, parse_file,
parse_stabs_common, parse_stabs, write_varray, write_object,
read_seek, copy_object, main, error): Similarly.
* profile.c (compute_branch_probabilities): Similarly.
* reg-stack.c (check_asm_stack_operands): Similarly.
* reload.c (find_reloads): Similarly.
* reload1.c (spill_failure, failed_reload): Similarly.
* rtl-error.c (_fatal_insn_not_found): Similarly.
* toplev.c (read_integral_parameter, crash_signal,
decode_f_option, set_target_switch, parse_options_and_default_flags)
: Similarly.
* tradcif.y (parse_number, yylex): Similarly.
* tradcpp.c (main, fancy_abort): Similarly.
* tree.c (tree_check_failed): Similarly.
* varray.c (varray_check_failed): Similarly.
* xcoffout.c (xcoff_output_standard_types): Similarly.
cp:
* call.c (build_java_interface_fn_ref): Similarly.
* except.c (is_admissible_throw_operand): Similarly.
* init.c (build_java_class_ref): Similarly.
* xref.c (open_xref_file): Similarly.
objc:
* objc-act.c (get_object_ref, lookup_and_install_protocols,
build_objc_string_object, objc_declare_alias, build_ivar_chain,
finish_message_expr, build_protocol_expr, is_public,
start_class): Similarly.
testsuite:
* objc.dg/alias.m: Update.
* objc.dg/class-1.m: Update.
* objc.dg/const-str-1.m: Update.
* objc.dg/fwd-proto-1.m: Update.
* objc.dg/id-1.m: Update.
* objc.dg/super-class-1.m: Update.
From-SVN: r47518
2001-12-02 01:04:36 +01:00
|
|
|
fatal ("unknown attribute `%s' in EQ_ATTR", XSTR (exp, 0));
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
if (is_const && ! attr->is_const)
|
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading
capital from diagnostics.
* c-lex.c (cb_file_change): Similarly.
* c-parse.in : Similarly.
* cfgrtl.c (verify_flow_info): Similarly.
* collect2.c: Similarly.
* cppfiles.c (find_include_file): Similarly.
* cppinit.c (cpp_handle_option): Similarly.
* cpplex.c (cpp_spell_token): Similarly.
* cppmain.c (do_preprocessing): Similarly.
* gcc.c (translate_options, process_command, do_spec1,
main, pfatal_execute): Similarly.
* genattr.c (main): Similarly.
* genattrtab.c (check_attr_test, operate_exp, simplify_test_exp,
write_test_expr, main): Similarly.
* gencodes.c (main): Similarly.
* genconfig.c (main): Similarly.
* genconstants.c (main): Similarly.
* genemit.c (main): Similarly.
* genextract.c (main): Similarly.
* genflags.c (main): Similarly.
* genopinit.c (main): Similarly.
* genoutput.c (process_template, main): Similarly.
* genpeep.c (main): Similarly.
* genrecog.c (main): Similarly.
* gensupport.c (is_predicable, identify_predicable_attribute,
alter_predicate_for_insn, init_md_reader_args, main): Similarly.
* ggc-page.c (alloc_anon): Similarly.
* mips-tfile.c (add_string, add_procedure, add_file, read_line,
parse_begin, parse_bend, parse_def, parse_end, parse_file,
parse_stabs_common, parse_stabs, write_varray, write_object,
read_seek, copy_object, main, error): Similarly.
* profile.c (compute_branch_probabilities): Similarly.
* reg-stack.c (check_asm_stack_operands): Similarly.
* reload.c (find_reloads): Similarly.
* reload1.c (spill_failure, failed_reload): Similarly.
* rtl-error.c (_fatal_insn_not_found): Similarly.
* toplev.c (read_integral_parameter, crash_signal,
decode_f_option, set_target_switch, parse_options_and_default_flags)
: Similarly.
* tradcif.y (parse_number, yylex): Similarly.
* tradcpp.c (main, fancy_abort): Similarly.
* tree.c (tree_check_failed): Similarly.
* varray.c (varray_check_failed): Similarly.
* xcoffout.c (xcoff_output_standard_types): Similarly.
cp:
* call.c (build_java_interface_fn_ref): Similarly.
* except.c (is_admissible_throw_operand): Similarly.
* init.c (build_java_class_ref): Similarly.
* xref.c (open_xref_file): Similarly.
objc:
* objc-act.c (get_object_ref, lookup_and_install_protocols,
build_objc_string_object, objc_declare_alias, build_ivar_chain,
finish_message_expr, build_protocol_expr, is_public,
start_class): Similarly.
testsuite:
* objc.dg/alias.m: Update.
* objc.dg/class-1.m: Update.
* objc.dg/const-str-1.m: Update.
* objc.dg/fwd-proto-1.m: Update.
* objc.dg/id-1.m: Update.
* objc.dg/super-class-1.m: Update.
From-SVN: r47518
2001-12-02 01:04:36 +01:00
|
|
|
fatal ("constant expression uses insn attribute `%s' in EQ_ATTR",
|
Warning Fixes:
* Makefile.in (print-rtl.o): Depend on bitmap.h.
(dbxout.o): Depend on toplev.h.
($(SCHED_PREFIX)sched.o): Likewise.
($(out_object_file)): Likewise for system.h and toplev.h.
(cppmain.o): Depend on gansidecl.h.
(cpplib.o): Likewise.
(cpperror.o): Likewise.
(cppexp.o): Likewise.
(cpphash.o): Likewise.
(cppalloc.o): Likewise.
(fix-header.o): Depend on cpplib.h and cpphash.h.
(scan-decls.o): Depend on gansidecl.h.
* basic-block.h (free_regset_vector): Add prototype.
* cccp.c (check_precompiled): Mark parameter `fname' with
ATTRIBUTE_UNUSED.
(do_assert): Likewise for `op' and `keyword'.
(do_unassert): Likewise.
(do_line): Likewise for `keyword'.
(do_error): Likewise for `op' and `keyword'.
(do_warning): Likewise.
(do_ident): Likewise for `keyword'.
(do_pragma): Likewise for `limit', `op' and `keyword'.
(do_sccs): Likewise.
(do_if): Likewise for `keyword'.
(do_elif): Likewise.
(do_else): Likewise.
(do_endif): Likewise.
* collect2.c (getenv): Remove redundant prototype.
(collect_exit, collect_execute, dump_file): Likewise.
(dump_list): Wrap prototype and definition in COLLECT_EXPORT_LIST.
(dump_prefix_list): Hide prototype and definition.
* sparc.c: Include toplev.h.
(intreg_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED.
(symbolic_memory_operand): Likewise.
(sp64_medium_pic_operand): Likewise.
(data_segment_operand): Likewise.
(text_segment_operand): Likewise.
(splittable_symbolic_memory_operand): Likewise.
(splittable_immediate_memory_operand): Likewise.
(eq_or_neq): Likewise.
(normal_comp_operator): Likewise.
(noov_compare_op): Likewise.
(v9_regcmp_op): Likewise.
(v8plus_regcmp_op): Likewise.
(extend_op): Likewise.
(cc_arithop): Likewise.
(cc_arithopn): Likewise.
(small_int): Likewise.
(uns_small_int): Likewise.
(clobbered_register): Likewise.
(legitimize_pic_address): Likewise.
(delay_operand): Likewise.
(sparc_builtin_saveregs): Remove unused variable `stdarg'.
* sparc.h (order_regs_for_local_alloc, eligible_for_return_delay,
sparc_issue_rate, v8plus_regcmp_p): Add prototypes.
* sparc.md (cmpdi_v8plus): Add abort for default case in switch.
* cppalloc.c: Include gansidecl.h.
* cpperror.c: Include stdarg.h/varargs.h and gansidecl.h.
(cpp_file_line_for_message): Mark parameter `pfile' with
ATTRIBUTE_UNUSED.
(v_cpp_message): New function.
(cpp_message): Use it. Also convert to variable arguments.
(cpp_fatal): Likewise.
(cpp_pfatal_with_name): Constify parameter `name'.
* cppexp.c: Move gansidecl.h before cpplib.h.
* cpphash.c: Likewise.
* cpphash.h (hashf, delete_macro): Add prototypes.
* cpplib.c: Include stdarg.h/varargs.h and move gansidecl.h before
cpplib.h. Don't include errno.h.
(update_path): Add arguments to prototype.
(cpp_fatal, cpp_file_line_for_message, cpp_message, delete_macro,
cpp_print_containing_files): Remove redundant prototypes.
(cpp_hash_cleanup, add_import, append_include_chain,
make_assertion, path_include, initialize_builtins,
initialize_char_syntax, finclude, validate_else, comp_def_part,
lookup_import, redundant_include_p, is_system_include,
read_name_map, read_filename_string, open_include_file,
check_macro_name, compare_defs, compare_token_lists,
eval_if_expression, change_newlines): Add prototype arguments.
(hashf): Remove redundant prototype.
(read_token_list, free_token_list, safe_read, xcalloc, savestring,
conditional_skip, skip_if_group): Add prototype arguments.
(fdopen): Remove redundant prototype.
(do_define, do_line, do_include, do_undef, do_error, do_pragma,
do_ident, do_if, do_xifdef, do_else, do_elif, do_endif, do_sccs,
do_once, do_assert, do_unassert, do_warning): Add prototype arguments.
(struct directive): Add prototype arguments to function pointer
member `func'.
(handle_directive): Add missing arguments to call to `do_line'.
(do_include): Mark parameters `unused1' and `unused2' with
ATTRIBUTE_UNUSED.
(do_line): Likewise for `keyword' and new parameters `unused1' and
`unused2'.
(do_error): Likewise for `keyword'.
(do_warning): Likewise. Also add missing argument `pfile' in call
to cpp_pedwarn.
(do_once): Mark parameter `keyword', `unused1' and `unused2' with
ATTRIBUTE_UNUSED.
(do_ident): Likewise for `keyword', `buf' and `limit'.
(do_pragma): Likewise. Also add missing arguments in call to do_once.
(do_sccs): Mark parameter `keyword', `buf' and `limit' with
ATTRIBUTE_UNUSED.
(do_if): Likewise for `keyword'.
(do_elif): Likewise.
(eval_if_expression): Likewise for `buf' and `length'.
(do_xifdef): Likewise for `unused1' and `unused2'.
(do_else): Likewise for `keyword', `buf' and `limit'.
(do_endif): Likewise.
(parse_name): Add missing argument `pfile' in call to cpp_pedwarn.
(cpp_handle_options): Remove superfluous NULL argument in call to
cpp_fatal.
(cpp_handle_options): Likewise.
(do_assert): Mark parameter `keyword', `buf' and `limit' with
ATTRIBUTE_UNUSED.
(do_unassert): Likewise.
(cpp_print_file_and_line): Add missing argument `pfile' in call to
cpp_file_line_for_message.
(v_cpp_error): New function.
(cpp_error): Use it. Also accept variable arguments.
(v_cpp_warning): New function.
(cpp_warning): Use it. Also accept variable arguments.
(cpp_pedwarn): Accept variable arguments.
(v_cpp_error_with_line): New function
(cpp_error_with_line): Use it. Accept variable arguments.
(v_cpp_warning_with_line): New function.
(cpp_warning_with_line): Use it. Accept variable arguments. Hide
definition.
(cpp_pedwarn_with_line): Accept variable arguments.
(cpp_pedwarn_with_file_and_line): Likewise.
(cpp_error_from_errno): Constify parameter `name'. Add missing
argument `pfile' in call to cpp_file_line_for_message.
(cpp_perror_with_name): Constify parameter `name'.
* cpplib.h: Define PARAMS() in terms of PROTO().
(fatal): Remove redundant prototype.
(cpp_error, cpp_warning, cpp_pedwarn, cpp_error_with_line,
cpp_pedwarn_with_line, cpp_pedwarn_with_file_and_line,
cpp_error_from_errno, cpp_perror_with_name, cpp_pfatal_with_name,
cpp_fatal, cpp_message, cpp_pfatal_with_name,
cpp_file_line_for_message, cpp_print_containing_files): Add
arguments to prototypes.
(scan_decls, cpp_finish): Add prototypes.
* cppmain.c: Include gansidecl.h.
(main): Remove unused variable `i'.
* dbxout.c: Include toplev.h.
* demangle.h (do_tlink, collect_execute, collect_exit,
collect_wait, dump_file, file_exists): Add prototype.
* dwarf2out.c (dwarf_type_encoding_name, decl_start_label): Hide
prototype and definition.
(gen_unspecified_parameters_die): Don't assign results of call to
function new_die() to unused variable `parm_die'.
(dwarf2out_line): Mark parameter `filename' with ATTRIBUTE_UNUSED.
(dwarf2out_define): Likewise for `lineno' and `buffer'.
* dwarfout.c (output_unsigned_leb128, output_signed_leb128): Hide
prototype and definition.
(output_die): Add prototype arguments to function pointer arg.
(output_unspecified_parameters_die): Mark parameter `arg' with
ATTRIBUTE_UNUSED.
* except.c (output_exception_table_entry): Remove unused variable
`eh_entry'.
* except.h (expand_fixup_region_start, expand_fixup_region_end):
Add prototypes.
* expr.c (do_jump_by_parts_equality_rtx): Remove prototype.
* expr.h (do_jump_by_parts_equality_rtx): Add prototype.
* fix-header.c: Include stdarg.h/varargs.h, move gansidecl.h
before cpplib.h, include cpphash.h, remove redundant prototype of
cpp_fatal, don't define `const', add a prototype for `fatal'.
(cpp_file_line_for_message): Add missing arguments `pfile'.
(v_cpp_message): New function.
(cpp_message): Use it.
(v_fatal): New function.
(fatal, cpp_fatal): Use it.
(cpp_pfatal_with_name): Constify parameter `name'.
* flow.c (free_regset_vector): Remove redundant prototype.
* function.c (round_down): Wrap prototype and definition with
macro ARGS_GROW_DOWNWARD.
(record_insns): Wrap prototype and definition with
defined (HAVE_prologue) || defined (HAVE_epilogue).
* gansidecl.h (ATTRIBUTE_PRINTF_4, ATTRIBUTE_PRINTF_5): New macros.
* gen-protos.c: Include gansidecl.h.
(hashf): Don't make it static, constify parameter `name'.
* genattrtab.c (check_attr_test): Change XEXP() to XSTR() to match
specifier %s in calls to function `fatal'.
* haifa-sched.c: Include toplev.h.
(find_rgns): Remove unused variable `j'.
* integrate.c (note_modified_parmregs): Mark parameter `x' with
ATTRIBUTE_UNUSED.
(mark_stores): Likewise.
* jump.c (mark_modified_reg): Likewise.
* output.h (insn_current_reference_address): Add prototype.
(eh_frame_section): Likewise.
* print-rtl.c: Include bitmap.h.
* reload1.c (reload): Wrap variables `note' and `next' in macro
PRESERVE_DEATH_INFO_REGNO_P.
(forget_old_reloads_1): Mark parameter `ignored' with
ATTRIBUTE_UNUSED.
(choose_reload_regs): Remove unused variable `in'.
(reload_cse_invalidate_mem): Mark parameter `ignore' with
ATTRIBUTE_UNUSED.
(reload_cse_check_clobber): Likewise.
* rtl.h (expand_null_return, reg_classes_intersect_p): Add prototype.
(mark_elimination): Fix typo in prototype.
* scan-decls.c: Include gansidecl.h.
* tree.h (using_eh_for_cleanups, supports_one_only): Add prototype.
From-SVN: r19867
1998-05-19 10:42:48 +02:00
|
|
|
XSTR (exp, 0));
|
1992-03-06 23:25:46 +01:00
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
/* Copy this just to make it permanent,
|
|
|
|
so expressions using it can be permanent too. */
|
|
|
|
exp = attr_eq (XSTR (exp, 0), XSTR (exp, 1));
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-06-24 05:59:40 +02:00
|
|
|
/* It shouldn't be possible to simplify the value given to a
|
1992-05-07 22:01:01 +02:00
|
|
|
constant attribute, so don't expand this until it's time to
|
2000-09-12 17:36:21 +02:00
|
|
|
write the test expression. */
|
1992-05-07 22:01:01 +02:00
|
|
|
if (attr->is_const)
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_IND_SIMPLIFIED_P (exp) = 1;
|
1992-05-07 22:01:01 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
if (attr->is_numeric)
|
|
|
|
{
|
|
|
|
for (p = XSTR (exp, 1); *p; p++)
|
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
2001-10-21 23:32:15 +02:00
|
|
|
if (! ISDIGIT (*p))
|
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading
capital from diagnostics.
* c-lex.c (cb_file_change): Similarly.
* c-parse.in : Similarly.
* cfgrtl.c (verify_flow_info): Similarly.
* collect2.c: Similarly.
* cppfiles.c (find_include_file): Similarly.
* cppinit.c (cpp_handle_option): Similarly.
* cpplex.c (cpp_spell_token): Similarly.
* cppmain.c (do_preprocessing): Similarly.
* gcc.c (translate_options, process_command, do_spec1,
main, pfatal_execute): Similarly.
* genattr.c (main): Similarly.
* genattrtab.c (check_attr_test, operate_exp, simplify_test_exp,
write_test_expr, main): Similarly.
* gencodes.c (main): Similarly.
* genconfig.c (main): Similarly.
* genconstants.c (main): Similarly.
* genemit.c (main): Similarly.
* genextract.c (main): Similarly.
* genflags.c (main): Similarly.
* genopinit.c (main): Similarly.
* genoutput.c (process_template, main): Similarly.
* genpeep.c (main): Similarly.
* genrecog.c (main): Similarly.
* gensupport.c (is_predicable, identify_predicable_attribute,
alter_predicate_for_insn, init_md_reader_args, main): Similarly.
* ggc-page.c (alloc_anon): Similarly.
* mips-tfile.c (add_string, add_procedure, add_file, read_line,
parse_begin, parse_bend, parse_def, parse_end, parse_file,
parse_stabs_common, parse_stabs, write_varray, write_object,
read_seek, copy_object, main, error): Similarly.
* profile.c (compute_branch_probabilities): Similarly.
* reg-stack.c (check_asm_stack_operands): Similarly.
* reload.c (find_reloads): Similarly.
* reload1.c (spill_failure, failed_reload): Similarly.
* rtl-error.c (_fatal_insn_not_found): Similarly.
* toplev.c (read_integral_parameter, crash_signal,
decode_f_option, set_target_switch, parse_options_and_default_flags)
: Similarly.
* tradcif.y (parse_number, yylex): Similarly.
* tradcpp.c (main, fancy_abort): Similarly.
* tree.c (tree_check_failed): Similarly.
* varray.c (varray_check_failed): Similarly.
* xcoffout.c (xcoff_output_standard_types): Similarly.
cp:
* call.c (build_java_interface_fn_ref): Similarly.
* except.c (is_admissible_throw_operand): Similarly.
* init.c (build_java_class_ref): Similarly.
* xref.c (open_xref_file): Similarly.
objc:
* objc-act.c (get_object_ref, lookup_and_install_protocols,
build_objc_string_object, objc_declare_alias, build_ivar_chain,
finish_message_expr, build_protocol_expr, is_public,
start_class): Similarly.
testsuite:
* objc.dg/alias.m: Update.
* objc.dg/class-1.m: Update.
* objc.dg/const-str-1.m: Update.
* objc.dg/fwd-proto-1.m: Update.
* objc.dg/id-1.m: Update.
* objc.dg/super-class-1.m: Update.
From-SVN: r47518
2001-12-02 01:04:36 +01:00
|
|
|
fatal ("attribute `%s' takes only numeric values",
|
2000-09-12 17:36:21 +02:00
|
|
|
XSTR (exp, 0));
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
if (GET_CODE (av->value) == CONST_STRING
|
|
|
|
&& ! strcmp (XSTR (exp, 1), XSTR (av->value, 0)))
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (av == NULL)
|
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading
capital from diagnostics.
* c-lex.c (cb_file_change): Similarly.
* c-parse.in : Similarly.
* cfgrtl.c (verify_flow_info): Similarly.
* collect2.c: Similarly.
* cppfiles.c (find_include_file): Similarly.
* cppinit.c (cpp_handle_option): Similarly.
* cpplex.c (cpp_spell_token): Similarly.
* cppmain.c (do_preprocessing): Similarly.
* gcc.c (translate_options, process_command, do_spec1,
main, pfatal_execute): Similarly.
* genattr.c (main): Similarly.
* genattrtab.c (check_attr_test, operate_exp, simplify_test_exp,
write_test_expr, main): Similarly.
* gencodes.c (main): Similarly.
* genconfig.c (main): Similarly.
* genconstants.c (main): Similarly.
* genemit.c (main): Similarly.
* genextract.c (main): Similarly.
* genflags.c (main): Similarly.
* genopinit.c (main): Similarly.
* genoutput.c (process_template, main): Similarly.
* genpeep.c (main): Similarly.
* genrecog.c (main): Similarly.
* gensupport.c (is_predicable, identify_predicable_attribute,
alter_predicate_for_insn, init_md_reader_args, main): Similarly.
* ggc-page.c (alloc_anon): Similarly.
* mips-tfile.c (add_string, add_procedure, add_file, read_line,
parse_begin, parse_bend, parse_def, parse_end, parse_file,
parse_stabs_common, parse_stabs, write_varray, write_object,
read_seek, copy_object, main, error): Similarly.
* profile.c (compute_branch_probabilities): Similarly.
* reg-stack.c (check_asm_stack_operands): Similarly.
* reload.c (find_reloads): Similarly.
* reload1.c (spill_failure, failed_reload): Similarly.
* rtl-error.c (_fatal_insn_not_found): Similarly.
* toplev.c (read_integral_parameter, crash_signal,
decode_f_option, set_target_switch, parse_options_and_default_flags)
: Similarly.
* tradcif.y (parse_number, yylex): Similarly.
* tradcpp.c (main, fancy_abort): Similarly.
* tree.c (tree_check_failed): Similarly.
* varray.c (varray_check_failed): Similarly.
* xcoffout.c (xcoff_output_standard_types): Similarly.
cp:
* call.c (build_java_interface_fn_ref): Similarly.
* except.c (is_admissible_throw_operand): Similarly.
* init.c (build_java_class_ref): Similarly.
* xref.c (open_xref_file): Similarly.
objc:
* objc-act.c (get_object_ref, lookup_and_install_protocols,
build_objc_string_object, objc_declare_alias, build_ivar_chain,
finish_message_expr, build_protocol_expr, is_public,
start_class): Similarly.
testsuite:
* objc.dg/alias.m: Update.
* objc.dg/class-1.m: Update.
* objc.dg/const-str-1.m: Update.
* objc.dg/fwd-proto-1.m: Update.
* objc.dg/id-1.m: Update.
* objc.dg/super-class-1.m: Update.
From-SVN: r47518
2001-12-02 01:04:36 +01:00
|
|
|
fatal ("unknown value `%s' for `%s' attribute",
|
Warning Fixes:
* Makefile.in (print-rtl.o): Depend on bitmap.h.
(dbxout.o): Depend on toplev.h.
($(SCHED_PREFIX)sched.o): Likewise.
($(out_object_file)): Likewise for system.h and toplev.h.
(cppmain.o): Depend on gansidecl.h.
(cpplib.o): Likewise.
(cpperror.o): Likewise.
(cppexp.o): Likewise.
(cpphash.o): Likewise.
(cppalloc.o): Likewise.
(fix-header.o): Depend on cpplib.h and cpphash.h.
(scan-decls.o): Depend on gansidecl.h.
* basic-block.h (free_regset_vector): Add prototype.
* cccp.c (check_precompiled): Mark parameter `fname' with
ATTRIBUTE_UNUSED.
(do_assert): Likewise for `op' and `keyword'.
(do_unassert): Likewise.
(do_line): Likewise for `keyword'.
(do_error): Likewise for `op' and `keyword'.
(do_warning): Likewise.
(do_ident): Likewise for `keyword'.
(do_pragma): Likewise for `limit', `op' and `keyword'.
(do_sccs): Likewise.
(do_if): Likewise for `keyword'.
(do_elif): Likewise.
(do_else): Likewise.
(do_endif): Likewise.
* collect2.c (getenv): Remove redundant prototype.
(collect_exit, collect_execute, dump_file): Likewise.
(dump_list): Wrap prototype and definition in COLLECT_EXPORT_LIST.
(dump_prefix_list): Hide prototype and definition.
* sparc.c: Include toplev.h.
(intreg_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED.
(symbolic_memory_operand): Likewise.
(sp64_medium_pic_operand): Likewise.
(data_segment_operand): Likewise.
(text_segment_operand): Likewise.
(splittable_symbolic_memory_operand): Likewise.
(splittable_immediate_memory_operand): Likewise.
(eq_or_neq): Likewise.
(normal_comp_operator): Likewise.
(noov_compare_op): Likewise.
(v9_regcmp_op): Likewise.
(v8plus_regcmp_op): Likewise.
(extend_op): Likewise.
(cc_arithop): Likewise.
(cc_arithopn): Likewise.
(small_int): Likewise.
(uns_small_int): Likewise.
(clobbered_register): Likewise.
(legitimize_pic_address): Likewise.
(delay_operand): Likewise.
(sparc_builtin_saveregs): Remove unused variable `stdarg'.
* sparc.h (order_regs_for_local_alloc, eligible_for_return_delay,
sparc_issue_rate, v8plus_regcmp_p): Add prototypes.
* sparc.md (cmpdi_v8plus): Add abort for default case in switch.
* cppalloc.c: Include gansidecl.h.
* cpperror.c: Include stdarg.h/varargs.h and gansidecl.h.
(cpp_file_line_for_message): Mark parameter `pfile' with
ATTRIBUTE_UNUSED.
(v_cpp_message): New function.
(cpp_message): Use it. Also convert to variable arguments.
(cpp_fatal): Likewise.
(cpp_pfatal_with_name): Constify parameter `name'.
* cppexp.c: Move gansidecl.h before cpplib.h.
* cpphash.c: Likewise.
* cpphash.h (hashf, delete_macro): Add prototypes.
* cpplib.c: Include stdarg.h/varargs.h and move gansidecl.h before
cpplib.h. Don't include errno.h.
(update_path): Add arguments to prototype.
(cpp_fatal, cpp_file_line_for_message, cpp_message, delete_macro,
cpp_print_containing_files): Remove redundant prototypes.
(cpp_hash_cleanup, add_import, append_include_chain,
make_assertion, path_include, initialize_builtins,
initialize_char_syntax, finclude, validate_else, comp_def_part,
lookup_import, redundant_include_p, is_system_include,
read_name_map, read_filename_string, open_include_file,
check_macro_name, compare_defs, compare_token_lists,
eval_if_expression, change_newlines): Add prototype arguments.
(hashf): Remove redundant prototype.
(read_token_list, free_token_list, safe_read, xcalloc, savestring,
conditional_skip, skip_if_group): Add prototype arguments.
(fdopen): Remove redundant prototype.
(do_define, do_line, do_include, do_undef, do_error, do_pragma,
do_ident, do_if, do_xifdef, do_else, do_elif, do_endif, do_sccs,
do_once, do_assert, do_unassert, do_warning): Add prototype arguments.
(struct directive): Add prototype arguments to function pointer
member `func'.
(handle_directive): Add missing arguments to call to `do_line'.
(do_include): Mark parameters `unused1' and `unused2' with
ATTRIBUTE_UNUSED.
(do_line): Likewise for `keyword' and new parameters `unused1' and
`unused2'.
(do_error): Likewise for `keyword'.
(do_warning): Likewise. Also add missing argument `pfile' in call
to cpp_pedwarn.
(do_once): Mark parameter `keyword', `unused1' and `unused2' with
ATTRIBUTE_UNUSED.
(do_ident): Likewise for `keyword', `buf' and `limit'.
(do_pragma): Likewise. Also add missing arguments in call to do_once.
(do_sccs): Mark parameter `keyword', `buf' and `limit' with
ATTRIBUTE_UNUSED.
(do_if): Likewise for `keyword'.
(do_elif): Likewise.
(eval_if_expression): Likewise for `buf' and `length'.
(do_xifdef): Likewise for `unused1' and `unused2'.
(do_else): Likewise for `keyword', `buf' and `limit'.
(do_endif): Likewise.
(parse_name): Add missing argument `pfile' in call to cpp_pedwarn.
(cpp_handle_options): Remove superfluous NULL argument in call to
cpp_fatal.
(cpp_handle_options): Likewise.
(do_assert): Mark parameter `keyword', `buf' and `limit' with
ATTRIBUTE_UNUSED.
(do_unassert): Likewise.
(cpp_print_file_and_line): Add missing argument `pfile' in call to
cpp_file_line_for_message.
(v_cpp_error): New function.
(cpp_error): Use it. Also accept variable arguments.
(v_cpp_warning): New function.
(cpp_warning): Use it. Also accept variable arguments.
(cpp_pedwarn): Accept variable arguments.
(v_cpp_error_with_line): New function
(cpp_error_with_line): Use it. Accept variable arguments.
(v_cpp_warning_with_line): New function.
(cpp_warning_with_line): Use it. Accept variable arguments. Hide
definition.
(cpp_pedwarn_with_line): Accept variable arguments.
(cpp_pedwarn_with_file_and_line): Likewise.
(cpp_error_from_errno): Constify parameter `name'. Add missing
argument `pfile' in call to cpp_file_line_for_message.
(cpp_perror_with_name): Constify parameter `name'.
* cpplib.h: Define PARAMS() in terms of PROTO().
(fatal): Remove redundant prototype.
(cpp_error, cpp_warning, cpp_pedwarn, cpp_error_with_line,
cpp_pedwarn_with_line, cpp_pedwarn_with_file_and_line,
cpp_error_from_errno, cpp_perror_with_name, cpp_pfatal_with_name,
cpp_fatal, cpp_message, cpp_pfatal_with_name,
cpp_file_line_for_message, cpp_print_containing_files): Add
arguments to prototypes.
(scan_decls, cpp_finish): Add prototypes.
* cppmain.c: Include gansidecl.h.
(main): Remove unused variable `i'.
* dbxout.c: Include toplev.h.
* demangle.h (do_tlink, collect_execute, collect_exit,
collect_wait, dump_file, file_exists): Add prototype.
* dwarf2out.c (dwarf_type_encoding_name, decl_start_label): Hide
prototype and definition.
(gen_unspecified_parameters_die): Don't assign results of call to
function new_die() to unused variable `parm_die'.
(dwarf2out_line): Mark parameter `filename' with ATTRIBUTE_UNUSED.
(dwarf2out_define): Likewise for `lineno' and `buffer'.
* dwarfout.c (output_unsigned_leb128, output_signed_leb128): Hide
prototype and definition.
(output_die): Add prototype arguments to function pointer arg.
(output_unspecified_parameters_die): Mark parameter `arg' with
ATTRIBUTE_UNUSED.
* except.c (output_exception_table_entry): Remove unused variable
`eh_entry'.
* except.h (expand_fixup_region_start, expand_fixup_region_end):
Add prototypes.
* expr.c (do_jump_by_parts_equality_rtx): Remove prototype.
* expr.h (do_jump_by_parts_equality_rtx): Add prototype.
* fix-header.c: Include stdarg.h/varargs.h, move gansidecl.h
before cpplib.h, include cpphash.h, remove redundant prototype of
cpp_fatal, don't define `const', add a prototype for `fatal'.
(cpp_file_line_for_message): Add missing arguments `pfile'.
(v_cpp_message): New function.
(cpp_message): Use it.
(v_fatal): New function.
(fatal, cpp_fatal): Use it.
(cpp_pfatal_with_name): Constify parameter `name'.
* flow.c (free_regset_vector): Remove redundant prototype.
* function.c (round_down): Wrap prototype and definition with
macro ARGS_GROW_DOWNWARD.
(record_insns): Wrap prototype and definition with
defined (HAVE_prologue) || defined (HAVE_epilogue).
* gansidecl.h (ATTRIBUTE_PRINTF_4, ATTRIBUTE_PRINTF_5): New macros.
* gen-protos.c: Include gansidecl.h.
(hashf): Don't make it static, constify parameter `name'.
* genattrtab.c (check_attr_test): Change XEXP() to XSTR() to match
specifier %s in calls to function `fatal'.
* haifa-sched.c: Include toplev.h.
(find_rgns): Remove unused variable `j'.
* integrate.c (note_modified_parmregs): Mark parameter `x' with
ATTRIBUTE_UNUSED.
(mark_stores): Likewise.
* jump.c (mark_modified_reg): Likewise.
* output.h (insn_current_reference_address): Add prototype.
(eh_frame_section): Likewise.
* print-rtl.c: Include bitmap.h.
* reload1.c (reload): Wrap variables `note' and `next' in macro
PRESERVE_DEATH_INFO_REGNO_P.
(forget_old_reloads_1): Mark parameter `ignored' with
ATTRIBUTE_UNUSED.
(choose_reload_regs): Remove unused variable `in'.
(reload_cse_invalidate_mem): Mark parameter `ignore' with
ATTRIBUTE_UNUSED.
(reload_cse_check_clobber): Likewise.
* rtl.h (expand_null_return, reg_classes_intersect_p): Add prototype.
(mark_elimination): Fix typo in prototype.
* scan-decls.c: Include gansidecl.h.
* tree.h (using_eh_for_cleanups, supports_one_only): Add prototype.
From-SVN: r19867
1998-05-19 10:42:48 +02:00
|
|
|
XSTR (exp, 1), XSTR (exp, 0));
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
if (! strcmp (XSTR (exp, 0), "alternative"))
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
int set = 0;
|
|
|
|
|
|
|
|
name_ptr = XSTR (exp, 1);
|
|
|
|
while ((p = next_comma_elt (&name_ptr)) != NULL)
|
|
|
|
set |= 1 << atoi (p);
|
|
|
|
|
|
|
|
return mk_attr_alt (set);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Make an IOR tree of the possible values. */
|
|
|
|
orexp = false_rtx;
|
|
|
|
name_ptr = XSTR (exp, 1);
|
|
|
|
while ((p = next_comma_elt (&name_ptr)) != NULL)
|
|
|
|
{
|
|
|
|
newexp = attr_eq (XSTR (exp, 0), p);
|
|
|
|
orexp = insert_right_side (IOR, orexp, newexp, -2, -2);
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
return check_attr_test (orexp, is_const, lineno);
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1993-03-28 23:23:09 +02:00
|
|
|
case ATTR_FLAG:
|
|
|
|
break;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
case CONST_INT:
|
|
|
|
/* Either TRUE or FALSE. */
|
1992-07-06 22:02:55 +02:00
|
|
|
if (XWINT (exp, 0))
|
1991-10-24 18:21:48 +01:00
|
|
|
return true_rtx;
|
|
|
|
else
|
|
|
|
return false_rtx;
|
|
|
|
|
|
|
|
case IOR:
|
|
|
|
case AND:
|
2000-07-31 01:38:26 +02:00
|
|
|
XEXP (exp, 0) = check_attr_test (XEXP (exp, 0), is_const, lineno);
|
|
|
|
XEXP (exp, 1) = check_attr_test (XEXP (exp, 1), is_const, lineno);
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case NOT:
|
2000-07-31 01:38:26 +02:00
|
|
|
XEXP (exp, 0) = check_attr_test (XEXP (exp, 0), is_const, lineno);
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case MATCH_OPERAND:
|
1992-03-06 23:25:46 +01:00
|
|
|
if (is_const)
|
|
|
|
fatal ("RTL operator \"%s\" not valid in constant attribute test",
|
1998-04-14 23:00:57 +02:00
|
|
|
GET_RTX_NAME (GET_CODE (exp)));
|
1992-05-05 23:48:14 +02:00
|
|
|
/* These cases can't be simplified. */
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_IND_SIMPLIFIED_P (exp) = 1;
|
1992-05-05 23:48:14 +02:00
|
|
|
break;
|
2000-09-12 17:36:21 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
case LE: case LT: case GT: case GE:
|
|
|
|
case LEU: case LTU: case GTU: case GEU:
|
|
|
|
case NE: case EQ:
|
1992-05-05 23:48:14 +02:00
|
|
|
if (GET_CODE (XEXP (exp, 0)) == SYMBOL_REF
|
|
|
|
&& GET_CODE (XEXP (exp, 1)) == SYMBOL_REF)
|
|
|
|
exp = attr_rtx (GET_CODE (exp),
|
|
|
|
attr_rtx (SYMBOL_REF, XSTR (XEXP (exp, 0), 0)),
|
|
|
|
attr_rtx (SYMBOL_REF, XSTR (XEXP (exp, 1), 0)));
|
1991-10-24 18:21:48 +01:00
|
|
|
/* These cases can't be simplified. */
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_IND_SIMPLIFIED_P (exp) = 1;
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
case SYMBOL_REF:
|
|
|
|
if (is_const)
|
|
|
|
{
|
|
|
|
/* These cases are valid for constant attributes, but can't be
|
|
|
|
simplified. */
|
1992-05-05 23:48:14 +02:00
|
|
|
exp = attr_rtx (SYMBOL_REF, XSTR (exp, 0));
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_IND_SIMPLIFIED_P (exp) = 1;
|
1992-03-06 23:25:46 +01:00
|
|
|
break;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
default:
|
|
|
|
fatal ("RTL operator \"%s\" not valid in attribute test",
|
|
|
|
GET_RTX_NAME (GET_CODE (exp)));
|
|
|
|
}
|
|
|
|
|
|
|
|
return exp;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given an expression, ensure that it is validly formed and that all named
|
|
|
|
attribute values are valid for the given attribute. Issue a fatal error
|
1992-05-05 23:48:14 +02:00
|
|
|
if not. If no attribute is specified, assume a numeric attribute.
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
Return a perhaps modified replacement expression for the value. */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
check_attr_value (rtx exp, struct attr_desc *attr)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_value *av;
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
const char *p;
|
1991-10-24 18:21:48 +01:00
|
|
|
int i;
|
|
|
|
|
|
|
|
switch (GET_CODE (exp))
|
|
|
|
{
|
|
|
|
case CONST_INT:
|
|
|
|
if (attr && ! attr->is_numeric)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (attr->lineno,
|
|
|
|
"CONST_INT not valid for non-numeric attribute %s",
|
|
|
|
attr->name);
|
|
|
|
have_error = 1;
|
|
|
|
break;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2005-04-08 19:20:15 +02:00
|
|
|
if (INTVAL (exp) < 0)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (attr->lineno,
|
2000-09-12 17:36:21 +02:00
|
|
|
"negative numeric value specified for attribute %s",
|
|
|
|
attr->name);
|
2000-07-31 01:38:26 +02:00
|
|
|
have_error = 1;
|
|
|
|
break;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CONST_STRING:
|
|
|
|
if (! strcmp (XSTR (exp, 0), "*"))
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (attr == 0 || attr->is_numeric)
|
|
|
|
{
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
p = XSTR (exp, 0);
|
|
|
|
for (; *p; p++)
|
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
2001-10-21 23:32:15 +02:00
|
|
|
if (! ISDIGIT (*p))
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (attr ? attr->lineno : 0,
|
|
|
|
"non-numeric value for numeric attribute %s",
|
|
|
|
attr ? attr->name : "internal");
|
|
|
|
have_error = 1;
|
|
|
|
break;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
if (GET_CODE (av->value) == CONST_STRING
|
|
|
|
&& ! strcmp (XSTR (av->value, 0), XSTR (exp, 0)))
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (av == NULL)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (attr->lineno,
|
|
|
|
"unknown value `%s' for `%s' attribute",
|
|
|
|
XSTR (exp, 0), attr ? attr->name : "internal");
|
|
|
|
have_error = 1;
|
|
|
|
}
|
1992-05-05 23:48:14 +02:00
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
case IF_THEN_ELSE:
|
1992-03-06 23:25:46 +01:00
|
|
|
XEXP (exp, 0) = check_attr_test (XEXP (exp, 0),
|
2000-07-31 01:38:26 +02:00
|
|
|
attr ? attr->is_const : 0,
|
|
|
|
attr ? attr->lineno : 0);
|
1992-05-05 23:48:14 +02:00
|
|
|
XEXP (exp, 1) = check_attr_value (XEXP (exp, 1), attr);
|
|
|
|
XEXP (exp, 2) = check_attr_value (XEXP (exp, 2), attr);
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
case PLUS:
|
|
|
|
case MINUS:
|
|
|
|
case MULT:
|
|
|
|
case DIV:
|
|
|
|
case MOD:
|
|
|
|
if (attr && !attr->is_numeric)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (attr->lineno,
|
2000-09-12 17:36:21 +02:00
|
|
|
"invalid operation `%s' for non-numeric attribute value",
|
|
|
|
GET_RTX_NAME (GET_CODE (exp)));
|
2000-07-31 01:38:26 +02:00
|
|
|
have_error = 1;
|
|
|
|
break;
|
|
|
|
}
|
2004-01-06 17:51:21 +01:00
|
|
|
/* Fall through. */
|
1999-02-21 19:30:37 +01:00
|
|
|
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
case IOR:
|
|
|
|
case AND:
|
|
|
|
XEXP (exp, 0) = check_attr_value (XEXP (exp, 0), attr);
|
|
|
|
XEXP (exp, 1) = check_attr_value (XEXP (exp, 1), attr);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FFS:
|
[multiple changes]
2003-02-01 Richard Henderson <rth@redhat.com>
* optabs.c (expand_unop): Use word_mode for outmode of bit scaners.
* libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
__popcountsi2, __popcountdi2, __paritysi2 __paritydi2): Change
return type to Wtype.
* libgcc-std.ver (GCC_3.4): Fix inheritance.
* config/i386/i386.md (ffssi2): Use nonimmediate_operand for
expander input constraint.
2003-02-01 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
* optabs.h (optab_index): Add OTI_clz, OTI_ctz, OTI_popcount and
OTI_parity.
(clz_optab, ctz_optab, popcount_optab, parity_optab): New.
* optabs.c (widen_clz, expand_parity): New.
(expand_unop): Handle clz and parity. Hardcode SImode as outmode
for libcalls to clz, ctz, popcount, and parity.
(init_optabs): Init clz_optab, ctz_optab, popcount_optab and
parity_optab, and set up libfunc handlers.
* libgcc2.c (__clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
__popcountsi2, __popcountdi2, __paritysi2 __paritydi2,
__popcount_tab): New.
* libgcc2.h: Declare them.
* libgcc-std.ver (GCC_3.4): Add new functions from libgcc2.c.
* genopinit.c (optabs): Add clz_optab, ctz_optab, popcount_optab
and parity_optab.
* builtin-types.def (BT_FN_INT_LONG, BT_FN_INT_LONGLONG): New.
* builtins.def (BUILT_IN_CLZ, BUILT_IN_CTZ, BUILT_IN_POPCOUNT,
BUILT_IN_PARITY, BUILT_IN_FFSL, BUILT_IN_CLZL, BUILT_IN_CTZL,
BUILT_IN_POPCOUNTL, BUILT_IN_PARITYL, BUILT_IN_FFSLL,
BUILT_IN_CLZLL, BUILT_IN_CTZLL, BUILT_IN_POPCOUNTLL,
BUILT_IN_PARITYLL): New.
* builtins.c (expand_builtin_unop): Rename from expand_builtin_ffs
and add optab argument.
(expand_builtin): Expand BUILT_IN_{FFS,CLZ,POPCOUNT,PARITY}*.
* tree.def (CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR, PARITY_EXPR): New.
* expr.c (expand_expr): Handle them.
* fold-const.c (tree_expr_nonnegative_p): Likewise.
* rtl.def (CLZ, CTZ, POPCOUNT, PARITY): New.
* reload1.c (eliminate_regs): Handle them.
(elimination_effects): Likewise.
* function.c (instantiate_virtual_regs_1): Likewise
* genattrtab.c (check_attr_value): Likewise.
* simplify-rtx.c (simplify_unary_operation): Likewise.
* c-common.c (c_common_truthvalue_conversion): Handle POPCOUNT_EXPR.
* combine.c (combine_simplify_rtx): Handle POPCOUNT and PARITY.
(nonzero_bits): Handle CLZ, CTZ, POPCOUNT and PARITY.
* config/alpha/alpha.md (clzdi2, ctzdi2, popcountdi2): New.
* config/arm/arm.c (arm_init_builtins): Rename __builtin_clz to
__builtin_arm_clz.
* Makefile.in (LIB2FUNCS_1, LIB2FUNCS_2): Move...
* mklibgcc.in (lib2funcs): ...here and merge. Add new members.
* doc/extend.texi (Other Builtins): Add new builtins.
* doc/md.texi (Standard Names): Add new patterns.
From-SVN: r62252
2003-02-01 20:00:02 +01:00
|
|
|
case CLZ:
|
|
|
|
case CTZ:
|
|
|
|
case POPCOUNT:
|
|
|
|
case PARITY:
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
XEXP (exp, 0) = check_attr_value (XEXP (exp, 0), attr);
|
|
|
|
break;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
case COND:
|
|
|
|
if (XVECLEN (exp, 0) % 2 != 0)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (attr->lineno,
|
|
|
|
"first operand of COND must have even length");
|
|
|
|
have_error = 1;
|
|
|
|
break;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (exp, 0); i += 2)
|
|
|
|
{
|
1992-03-06 23:25:46 +01:00
|
|
|
XVECEXP (exp, 0, i) = check_attr_test (XVECEXP (exp, 0, i),
|
2000-07-31 01:38:26 +02:00
|
|
|
attr ? attr->is_const : 0,
|
|
|
|
attr ? attr->lineno : 0);
|
1992-05-05 23:48:14 +02:00
|
|
|
XVECEXP (exp, 0, i + 1)
|
|
|
|
= check_attr_value (XVECEXP (exp, 0, i + 1), attr);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
XEXP (exp, 1) = check_attr_value (XEXP (exp, 1), attr);
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
case ATTR:
|
|
|
|
{
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
struct attr_desc *attr2 = find_attr (&XSTR (exp, 0), 0);
|
1999-02-21 19:30:37 +01:00
|
|
|
if (attr2 == NULL)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (attr ? attr->lineno : 0,
|
|
|
|
"unknown attribute `%s' in ATTR",
|
|
|
|
XSTR (exp, 0));
|
|
|
|
have_error = 1;
|
|
|
|
}
|
|
|
|
else if (attr && attr->is_const && ! attr2->is_const)
|
|
|
|
{
|
|
|
|
message_with_line (attr->lineno,
|
|
|
|
"non-constant attribute `%s' referenced from `%s'",
|
|
|
|
XSTR (exp, 0), attr->name);
|
|
|
|
have_error = 1;
|
|
|
|
}
|
2000-09-12 17:36:21 +02:00
|
|
|
else if (attr
|
2005-04-08 19:20:15 +02:00
|
|
|
&& attr->is_numeric != attr2->is_numeric)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (attr->lineno,
|
|
|
|
"numeric attribute mismatch calling `%s' from `%s'",
|
|
|
|
XSTR (exp, 0), attr->name);
|
|
|
|
have_error = 1;
|
|
|
|
}
|
1999-02-21 19:30:37 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
case SYMBOL_REF:
|
1999-02-21 19:30:37 +01:00
|
|
|
/* A constant SYMBOL_REF is valid as a constant attribute test and
|
|
|
|
is expanded later by make_canonical into a COND. In a non-constant
|
|
|
|
attribute test, it is left be. */
|
|
|
|
return attr_rtx (SYMBOL_REF, XSTR (exp, 0));
|
1992-03-06 23:25:46 +01:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
default:
|
2000-07-31 01:38:26 +02:00
|
|
|
message_with_line (attr ? attr->lineno : 0,
|
|
|
|
"invalid operation `%s' for attribute value",
|
|
|
|
GET_RTX_NAME (GET_CODE (exp)));
|
|
|
|
have_error = 1;
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
1992-05-05 23:48:14 +02:00
|
|
|
|
|
|
|
return exp;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given an SET_ATTR_ALTERNATIVE expression, convert to the canonical SET.
|
2005-08-05 11:42:06 +02:00
|
|
|
It becomes a COND with each test being (eq_attr "alternative" "n") */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
convert_set_attr_alternative (rtx exp, struct insn_def *id)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
2000-07-31 01:38:26 +02:00
|
|
|
int num_alt = id->num_alternatives;
|
1991-10-24 18:21:48 +01:00
|
|
|
rtx condexp;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (XVECLEN (exp, 1) != num_alt)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (id->lineno,
|
2000-09-12 17:36:21 +02:00
|
|
|
"bad number of entries in SET_ATTR_ALTERNATIVE");
|
2000-07-31 01:38:26 +02:00
|
|
|
have_error = 1;
|
|
|
|
return NULL_RTX;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* Make a COND with all tests but the last. Select the last value via the
|
|
|
|
default. */
|
|
|
|
condexp = rtx_alloc (COND);
|
|
|
|
XVEC (condexp, 0) = rtvec_alloc ((num_alt - 1) * 2);
|
|
|
|
|
|
|
|
for (i = 0; i < num_alt - 1; i++)
|
|
|
|
{
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
const char *p;
|
1992-05-05 23:48:14 +02:00
|
|
|
p = attr_numeral (i);
|
1992-03-06 23:25:46 +01:00
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
XVECEXP (condexp, 0, 2 * i) = attr_eq (alternative_name, p);
|
1991-10-24 18:21:48 +01:00
|
|
|
XVECEXP (condexp, 0, 2 * i + 1) = XVECEXP (exp, 1, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
XEXP (condexp, 1) = XVECEXP (exp, 1, i);
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
return attr_rtx (SET, attr_rtx (ATTR, XSTR (exp, 0)), condexp);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given a SET_ATTR, convert to the appropriate SET. If a comma-separated
|
|
|
|
list of values is given, convert to SET_ATTR_ALTERNATIVE first. */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
convert_set_attr (rtx exp, struct insn_def *id)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
rtx newexp;
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
const char *name_ptr;
|
1991-10-24 18:21:48 +01:00
|
|
|
char *p;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
/* See how many alternative specified. */
|
|
|
|
n = n_comma_elts (XSTR (exp, 1));
|
|
|
|
if (n == 1)
|
1992-03-06 23:25:46 +01:00
|
|
|
return attr_rtx (SET,
|
|
|
|
attr_rtx (ATTR, XSTR (exp, 0)),
|
|
|
|
attr_rtx (CONST_STRING, XSTR (exp, 1)));
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
newexp = rtx_alloc (SET_ATTR_ALTERNATIVE);
|
|
|
|
XSTR (newexp, 0) = XSTR (exp, 0);
|
|
|
|
XVEC (newexp, 1) = rtvec_alloc (n);
|
|
|
|
|
|
|
|
/* Process each comma-separated name. */
|
|
|
|
name_ptr = XSTR (exp, 1);
|
|
|
|
n = 0;
|
|
|
|
while ((p = next_comma_elt (&name_ptr)) != NULL)
|
1992-03-06 23:25:46 +01:00
|
|
|
XVECEXP (newexp, 1, n++) = attr_rtx (CONST_STRING, p);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2000-07-31 01:38:26 +02:00
|
|
|
return convert_set_attr_alternative (newexp, id);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Scan all definitions, checking for validity. Also, convert any SET_ATTR
|
|
|
|
and SET_ATTR_ALTERNATIVE expressions to the corresponding SET
|
1996-07-04 00:07:53 +02:00
|
|
|
expressions. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
check_defs (void)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct insn_def *id;
|
|
|
|
struct attr_desc *attr;
|
|
|
|
int i;
|
|
|
|
rtx value;
|
|
|
|
|
|
|
|
for (id = defs; id; id = id->next)
|
|
|
|
{
|
|
|
|
if (XVEC (id->def, id->vec_idx) == NULL)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (id->def, id->vec_idx); i++)
|
|
|
|
{
|
|
|
|
value = XVECEXP (id->def, id->vec_idx, i);
|
|
|
|
switch (GET_CODE (value))
|
|
|
|
{
|
|
|
|
case SET:
|
|
|
|
if (GET_CODE (XEXP (value, 0)) != ATTR)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (id->lineno, "bad attribute set");
|
|
|
|
have_error = 1;
|
|
|
|
value = NULL_RTX;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SET_ATTR_ALTERNATIVE:
|
2000-07-31 01:38:26 +02:00
|
|
|
value = convert_set_attr_alternative (value, id);
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SET_ATTR:
|
2000-07-31 01:38:26 +02:00
|
|
|
value = convert_set_attr (value, id);
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2000-07-31 01:38:26 +02:00
|
|
|
message_with_line (id->lineno, "invalid attribute code %s",
|
|
|
|
GET_RTX_NAME (GET_CODE (value)));
|
|
|
|
have_error = 1;
|
|
|
|
value = NULL_RTX;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2000-07-31 01:38:26 +02:00
|
|
|
if (value == NULL_RTX)
|
|
|
|
continue;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if ((attr = find_attr (&XSTR (XEXP (value, 0), 0), 0)) == NULL)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (id->lineno, "unknown attribute %s",
|
|
|
|
XSTR (XEXP (value, 0), 0));
|
|
|
|
have_error = 1;
|
|
|
|
continue;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
XVECEXP (id->def, id->vec_idx, i) = value;
|
1992-05-05 23:48:14 +02:00
|
|
|
XEXP (value, 1) = check_attr_value (XEXP (value, 1), attr);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1992-03-06 23:25:46 +01:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given a valid expression for an attribute value, remove any IF_THEN_ELSE
|
|
|
|
expressions by converting them into a COND. This removes cases from this
|
|
|
|
program. Also, replace an attribute value of "*" with the default attribute
|
|
|
|
value. */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
make_canonical (struct attr_desc *attr, rtx exp)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
rtx newexp;
|
|
|
|
|
|
|
|
switch (GET_CODE (exp))
|
|
|
|
{
|
|
|
|
case CONST_INT:
|
|
|
|
exp = make_numeric_value (INTVAL (exp));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CONST_STRING:
|
|
|
|
if (! strcmp (XSTR (exp, 0), "*"))
|
|
|
|
{
|
|
|
|
if (attr == 0 || attr->default_val == 0)
|
2001-12-01 19:42:49 +01:00
|
|
|
fatal ("(attr_value \"*\") used in invalid context");
|
1991-10-24 18:21:48 +01:00
|
|
|
exp = attr->default_val->value;
|
|
|
|
}
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
else
|
|
|
|
XSTR (exp, 0) = DEF_ATTR_STRING (XSTR (exp, 0));
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
case SYMBOL_REF:
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (!attr->is_const || ATTR_IND_SIMPLIFIED_P (exp))
|
1992-03-06 23:25:46 +01:00
|
|
|
break;
|
1992-05-07 01:13:18 +02:00
|
|
|
/* The SYMBOL_REF is constant for a given run, so mark it as unchanging.
|
|
|
|
This makes the COND something that won't be considered an arbitrary
|
|
|
|
expression by walk_attr_value. */
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_IND_SIMPLIFIED_P (exp) = 1;
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
exp = check_attr_value (exp, attr);
|
|
|
|
break;
|
1992-03-06 23:25:46 +01:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
case IF_THEN_ELSE:
|
|
|
|
newexp = rtx_alloc (COND);
|
|
|
|
XVEC (newexp, 0) = rtvec_alloc (2);
|
|
|
|
XVECEXP (newexp, 0, 0) = XEXP (exp, 0);
|
|
|
|
XVECEXP (newexp, 0, 1) = XEXP (exp, 1);
|
|
|
|
|
|
|
|
XEXP (newexp, 1) = XEXP (exp, 2);
|
|
|
|
|
|
|
|
exp = newexp;
|
|
|
|
/* Fall through to COND case since this is now a COND. */
|
|
|
|
|
|
|
|
case COND:
|
1992-05-05 00:57:54 +02:00
|
|
|
{
|
|
|
|
int allsame = 1;
|
|
|
|
rtx defval;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* First, check for degenerate COND. */
|
1992-05-05 00:57:54 +02:00
|
|
|
if (XVECLEN (exp, 0) == 0)
|
|
|
|
return make_canonical (attr, XEXP (exp, 1));
|
|
|
|
defval = XEXP (exp, 1) = make_canonical (attr, XEXP (exp, 1));
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
for (i = 0; i < XVECLEN (exp, 0); i += 2)
|
|
|
|
{
|
1992-05-05 23:48:14 +02:00
|
|
|
XVECEXP (exp, 0, i) = copy_boolean (XVECEXP (exp, 0, i));
|
1992-05-05 00:57:54 +02:00
|
|
|
XVECEXP (exp, 0, i + 1)
|
|
|
|
= make_canonical (attr, XVECEXP (exp, 0, i + 1));
|
|
|
|
if (! rtx_equal_p (XVECEXP (exp, 0, i + 1), defval))
|
|
|
|
allsame = 0;
|
|
|
|
}
|
|
|
|
if (allsame)
|
|
|
|
return defval;
|
|
|
|
}
|
1997-11-02 22:19:36 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return exp;
|
|
|
|
}
|
1992-05-05 23:48:14 +02:00
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
copy_boolean (rtx exp)
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
|
|
|
if (GET_CODE (exp) == AND || GET_CODE (exp) == IOR)
|
|
|
|
return attr_rtx (GET_CODE (exp), copy_boolean (XEXP (exp, 0)),
|
|
|
|
copy_boolean (XEXP (exp, 1)));
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if (GET_CODE (exp) == MATCH_OPERAND)
|
|
|
|
{
|
|
|
|
XSTR (exp, 1) = DEF_ATTR_STRING (XSTR (exp, 1));
|
|
|
|
XSTR (exp, 2) = DEF_ATTR_STRING (XSTR (exp, 2));
|
|
|
|
}
|
|
|
|
else if (GET_CODE (exp) == EQ_ATTR)
|
|
|
|
{
|
|
|
|
XSTR (exp, 0) = DEF_ATTR_STRING (XSTR (exp, 0));
|
|
|
|
XSTR (exp, 1) = DEF_ATTR_STRING (XSTR (exp, 1));
|
|
|
|
}
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
return exp;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given a value and an attribute description, return a `struct attr_value *'
|
|
|
|
that represents that value. This is either an existing structure, if the
|
|
|
|
value has been previously encountered, or a newly-created structure.
|
|
|
|
|
|
|
|
`insn_code' is the code of an insn whose attribute has the specified
|
|
|
|
value (-2 if not processing an insn). We ensure that all insns for
|
|
|
|
a given value have the same number of alternatives if the value checks
|
|
|
|
alternatives. */
|
|
|
|
|
|
|
|
static struct attr_value *
|
2003-06-01 18:02:11 +02:00
|
|
|
get_attr_value (rtx value, struct attr_desc *attr, int insn_code)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_value *av;
|
|
|
|
int num_alt = 0;
|
|
|
|
|
|
|
|
value = make_canonical (attr, value);
|
|
|
|
if (compares_alternatives_p (value))
|
|
|
|
{
|
|
|
|
if (insn_code < 0 || insn_alternatives == NULL)
|
|
|
|
fatal ("(eq_attr \"alternatives\" ...) used in non-insn context");
|
|
|
|
else
|
|
|
|
num_alt = insn_alternatives[insn_code];
|
|
|
|
}
|
|
|
|
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
if (rtx_equal_p (value, av->value)
|
|
|
|
&& (num_alt == 0 || av->first_insn == NULL
|
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
|
|
|
|| insn_alternatives[av->first_insn->def->insn_code]))
|
1991-10-24 18:21:48 +01:00
|
|
|
return av;
|
|
|
|
|
2003-07-19 16:47:15 +02:00
|
|
|
av = oballoc (sizeof (struct attr_value));
|
1991-10-24 18:21:48 +01:00
|
|
|
av->value = value;
|
|
|
|
av->next = attr->first_value;
|
|
|
|
attr->first_value = av;
|
|
|
|
av->first_insn = NULL;
|
|
|
|
av->num_insns = 0;
|
|
|
|
av->has_asm_insn = 0;
|
|
|
|
|
|
|
|
return av;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* After all DEFINE_DELAYs have been read in, create internal attributes
|
|
|
|
to generate the required routines.
|
|
|
|
|
|
|
|
First, we compute the number of delay slots for each insn (as a COND of
|
|
|
|
each of the test expressions in DEFINE_DELAYs). Then, if more than one
|
|
|
|
delay type is specified, we compute a similar function giving the
|
|
|
|
DEFINE_DELAY ordinal for each insn.
|
|
|
|
|
|
|
|
Finally, for each [DEFINE_DELAY, slot #] pair, we compute an attribute that
|
|
|
|
tells whether a given insn can be in that delay slot.
|
|
|
|
|
1992-05-07 08:41:23 +02:00
|
|
|
Normal attribute filling and optimization expands these to contain the
|
1991-10-24 18:21:48 +01:00
|
|
|
information needed to handle delay slots. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
expand_delays (void)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct delay_desc *delay;
|
|
|
|
rtx condexp;
|
|
|
|
rtx newexp;
|
|
|
|
int i;
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
/* First, generate data for `num_delay_slots' function. */
|
|
|
|
|
|
|
|
condexp = rtx_alloc (COND);
|
|
|
|
XVEC (condexp, 0) = rtvec_alloc (num_delays * 2);
|
|
|
|
XEXP (condexp, 1) = make_numeric_value (0);
|
|
|
|
|
|
|
|
for (i = 0, delay = delays; delay; i += 2, delay = delay->next)
|
|
|
|
{
|
|
|
|
XVECEXP (condexp, 0, i) = XEXP (delay->def, 0);
|
|
|
|
XVECEXP (condexp, 0, i + 1)
|
|
|
|
= make_numeric_value (XVECLEN (delay->def, 1) / 3);
|
|
|
|
}
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
make_internal_attr (num_delay_slots_str, condexp, ATTR_NONE);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* If more than one delay type, do the same for computing the delay type. */
|
|
|
|
if (num_delays > 1)
|
|
|
|
{
|
|
|
|
condexp = rtx_alloc (COND);
|
|
|
|
XVEC (condexp, 0) = rtvec_alloc (num_delays * 2);
|
|
|
|
XEXP (condexp, 1) = make_numeric_value (0);
|
|
|
|
|
|
|
|
for (i = 0, delay = delays; delay; i += 2, delay = delay->next)
|
|
|
|
{
|
|
|
|
XVECEXP (condexp, 0, i) = XEXP (delay->def, 0);
|
|
|
|
XVECEXP (condexp, 0, i + 1) = make_numeric_value (delay->num);
|
|
|
|
}
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
make_internal_attr (delay_type_str, condexp, ATTR_SPECIAL);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
1992-05-07 08:41:23 +02:00
|
|
|
/* For each delay possibility and delay slot, compute an eligibility
|
|
|
|
attribute for non-annulled insns and for each type of annulled (annul
|
1991-10-24 18:21:48 +01:00
|
|
|
if true and annul if false). */
|
2000-09-12 17:36:21 +02:00
|
|
|
for (delay = delays; delay; delay = delay->next)
|
|
|
|
{
|
|
|
|
for (i = 0; i < XVECLEN (delay->def, 1); i += 3)
|
|
|
|
{
|
|
|
|
condexp = XVECEXP (delay->def, 1, i);
|
|
|
|
if (condexp == 0)
|
|
|
|
condexp = false_rtx;
|
|
|
|
newexp = attr_rtx (IF_THEN_ELSE, condexp,
|
|
|
|
make_numeric_value (1), make_numeric_value (0));
|
|
|
|
|
2001-09-07 18:52:26 +02:00
|
|
|
p = attr_printf (sizeof "*delay__" + MAX_DIGITS * 2,
|
|
|
|
"*delay_%d_%d", delay->num, i / 3);
|
2003-07-09 02:38:40 +02:00
|
|
|
make_internal_attr (p, newexp, ATTR_SPECIAL);
|
2000-09-12 17:36:21 +02:00
|
|
|
|
|
|
|
if (have_annul_true)
|
|
|
|
{
|
|
|
|
condexp = XVECEXP (delay->def, 1, i + 1);
|
|
|
|
if (condexp == 0) condexp = false_rtx;
|
|
|
|
newexp = attr_rtx (IF_THEN_ELSE, condexp,
|
|
|
|
make_numeric_value (1),
|
|
|
|
make_numeric_value (0));
|
2001-09-07 18:52:26 +02:00
|
|
|
p = attr_printf (sizeof "*annul_true__" + MAX_DIGITS * 2,
|
2000-09-12 17:36:21 +02:00
|
|
|
"*annul_true_%d_%d", delay->num, i / 3);
|
2003-07-09 02:38:40 +02:00
|
|
|
make_internal_attr (p, newexp, ATTR_SPECIAL);
|
2000-09-12 17:36:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (have_annul_false)
|
|
|
|
{
|
|
|
|
condexp = XVECEXP (delay->def, 1, i + 2);
|
|
|
|
if (condexp == 0) condexp = false_rtx;
|
|
|
|
newexp = attr_rtx (IF_THEN_ELSE, condexp,
|
|
|
|
make_numeric_value (1),
|
|
|
|
make_numeric_value (0));
|
2001-09-07 18:52:26 +02:00
|
|
|
p = attr_printf (sizeof "*annul_false__" + MAX_DIGITS * 2,
|
2000-09-12 17:36:21 +02:00
|
|
|
"*annul_false_%d_%d", delay->num, i / 3);
|
2003-07-09 02:38:40 +02:00
|
|
|
make_internal_attr (p, newexp, ATTR_SPECIAL);
|
2000-09-12 17:36:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Once all attributes and insns have been read and checked, we construct for
|
|
|
|
each attribute value a list of all the insns that have that value for
|
|
|
|
the attribute. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
fill_attr (struct attr_desc *attr)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_value *av;
|
|
|
|
struct insn_ent *ie;
|
|
|
|
struct insn_def *id;
|
|
|
|
int i;
|
|
|
|
rtx value;
|
|
|
|
|
1992-05-07 22:01:01 +02:00
|
|
|
/* Don't fill constant attributes. The value is independent of
|
|
|
|
any particular insn. */
|
|
|
|
if (attr->is_const)
|
|
|
|
return;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
for (id = defs; id; id = id->next)
|
|
|
|
{
|
|
|
|
/* If no value is specified for this insn for this attribute, use the
|
|
|
|
default. */
|
|
|
|
value = NULL;
|
|
|
|
if (XVEC (id->def, id->vec_idx))
|
|
|
|
for (i = 0; i < XVECLEN (id->def, id->vec_idx); i++)
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if (! strcmp_check (XSTR (XEXP (XVECEXP (id->def, id->vec_idx, i), 0), 0),
|
|
|
|
attr->name))
|
1991-10-24 18:21:48 +01:00
|
|
|
value = XEXP (XVECEXP (id->def, id->vec_idx, i), 1);
|
|
|
|
|
|
|
|
if (value == NULL)
|
|
|
|
av = attr->default_val;
|
|
|
|
else
|
|
|
|
av = get_attr_value (value, attr, id->insn_code);
|
|
|
|
|
2003-07-19 16:47:15 +02:00
|
|
|
ie = oballoc (sizeof (struct insn_ent));
|
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
|
|
|
ie->def = id;
|
1991-10-24 18:21:48 +01:00
|
|
|
insert_insn_ent (av, ie);
|
|
|
|
}
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1992-01-18 00:03:50 +01:00
|
|
|
/* Given an expression EXP, see if it is a COND or IF_THEN_ELSE that has a
|
|
|
|
test that checks relative positions of insns (uses MATCH_DUP or PC).
|
|
|
|
If so, replace it with what is obtained by passing the expression to
|
|
|
|
ADDRESS_FN. If not but it is a COND or IF_THEN_ELSE, call this routine
|
|
|
|
recursively on each value (including the default value). Otherwise,
|
|
|
|
return the value returned by NO_ADDRESS_FN applied to EXP. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
substitute_address (rtx exp, rtx (*no_address_fn) (rtx),
|
|
|
|
rtx (*address_fn) (rtx))
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
rtx newexp;
|
|
|
|
|
1992-01-18 00:03:50 +01:00
|
|
|
if (GET_CODE (exp) == COND)
|
|
|
|
{
|
|
|
|
/* See if any tests use addresses. */
|
|
|
|
address_used = 0;
|
|
|
|
for (i = 0; i < XVECLEN (exp, 0); i += 2)
|
|
|
|
walk_attr_value (XVECEXP (exp, 0, i));
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-01-18 00:03:50 +01:00
|
|
|
if (address_used)
|
|
|
|
return (*address_fn) (exp);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-01-18 00:03:50 +01:00
|
|
|
/* Make a new copy of this COND, replacing each element. */
|
|
|
|
newexp = rtx_alloc (COND);
|
|
|
|
XVEC (newexp, 0) = rtvec_alloc (XVECLEN (exp, 0));
|
|
|
|
for (i = 0; i < XVECLEN (exp, 0); i += 2)
|
|
|
|
{
|
|
|
|
XVECEXP (newexp, 0, i) = XVECEXP (exp, 0, i);
|
|
|
|
XVECEXP (newexp, 0, i + 1)
|
|
|
|
= substitute_address (XVECEXP (exp, 0, i + 1),
|
|
|
|
no_address_fn, address_fn);
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-01-18 00:03:50 +01:00
|
|
|
XEXP (newexp, 1) = substitute_address (XEXP (exp, 1),
|
|
|
|
no_address_fn, address_fn);
|
|
|
|
|
|
|
|
return newexp;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
1992-01-18 00:03:50 +01:00
|
|
|
else if (GET_CODE (exp) == IF_THEN_ELSE)
|
|
|
|
{
|
|
|
|
address_used = 0;
|
|
|
|
walk_attr_value (XEXP (exp, 0));
|
|
|
|
if (address_used)
|
|
|
|
return (*address_fn) (exp);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
return attr_rtx (IF_THEN_ELSE,
|
|
|
|
substitute_address (XEXP (exp, 0),
|
|
|
|
no_address_fn, address_fn),
|
|
|
|
substitute_address (XEXP (exp, 1),
|
|
|
|
no_address_fn, address_fn),
|
|
|
|
substitute_address (XEXP (exp, 2),
|
|
|
|
no_address_fn, address_fn));
|
1992-01-18 00:03:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return (*no_address_fn) (exp);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Make new attributes from the `length' attribute. The following are made,
|
|
|
|
each corresponding to a function called from `shorten_branches' or
|
|
|
|
`get_attr_length':
|
|
|
|
|
|
|
|
*insn_default_length This is the length of the insn to be returned
|
|
|
|
by `get_attr_length' before `shorten_branches'
|
|
|
|
has been called. In each case where the length
|
|
|
|
depends on relative addresses, the largest
|
|
|
|
possible is used. This routine is also used
|
|
|
|
to compute the initial size of the insn.
|
|
|
|
|
|
|
|
*insn_variable_length_p This returns 1 if the insn's length depends
|
|
|
|
on relative addresses, zero otherwise.
|
|
|
|
|
|
|
|
*insn_current_length This is only called when it is known that the
|
|
|
|
insn has a variable length and returns the
|
|
|
|
current length, based on relative addresses.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
make_length_attrs (void)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
static const char *new_names[] =
|
|
|
|
{
|
|
|
|
"*insn_default_length",
|
|
|
|
"*insn_variable_length_p",
|
|
|
|
"*insn_current_length"
|
|
|
|
};
|
2003-06-01 18:02:11 +02:00
|
|
|
static rtx (*const no_address_fn[]) (rtx) = {identity_fn, zero_fn, zero_fn};
|
|
|
|
static rtx (*const address_fn[]) (rtx) = {max_fn, one_fn, identity_fn};
|
Warning fixes:
* Makefile.in (c-lang.o): Depend on c-tree.h, c-lex.h and toplev.h.
(c-lex.o): Depend on output.h.
(c-common.o): Likewise.
(stmt.o): Likewise.
(calls.o): Likewise.
(integrate.o): Depend on toplev.h.
(regclass.o): Depend on output.h.
(final.o): Depend on reload.h.
* c-common.c: Include output.h.
(check_format_info): Remove unused variable `integral_format'.
* c-decl.c (print_lang_decl): Mark parameters `file', `node' and
`indent' with ATTRIBUTE_UNUSED.
(print_lang_type): Likewise.
(maybe_build_cleanup): Likewise for parameter `decl'.
(copy_lang_decl): Likewise for parameter `node'.
* c-lang.c: Include c-tree.h, c-lex.h and toplev.h.
(lang_print_xnode): Mark parameters `file', `node' and `indent'
with ATTRIBUTE_UNUSED.
(lookup_interface): Likewise for parameter `arg'.
(is_class_name): Likewise.
(maybe_objc_check_decl): Likewise for parameter `decl'.
(maybe_objc_comptypes): Likewise for parameters `lhs', `rhs' and
`reflexive'.
(maybe_objc_method_name): Likewise for parameter `decl'.
(build_objc_string): Likewise for parameters `len' and `str'.
* c-lex.c: Include output.h.
* c-lex.h (position_after_white_space): Correct typo in prototype.
* c-tree.h (finish_file, c_expand_start_cond, c_expand_start_else,
c_expand_end_cond, init_iterators): Add prototypes.
* caller-save.c (set_reg_live): Mark parameters `reg' and `setter'
with ATTRIBUTE_UNUSED.
* calls.c: Include output.h.
* cccp.c (pipe_closed): Mark parameter `signo' with
ATTRIBUTE_UNUSED.
* combine.c: Move inclusion of expr.h to after insn-config.h.
* iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Don't define
as empty, rather define as ((void)0).
* sparc.c (sparc_check_64): Add braces around ambiguous `else'.
Add parentheses around assignment used as truth value.
* cplus-dem.c (squangle_mop_up): Change return type to void.
(internal_cplus_demangle): Remove unused parameter `options'.
All callers changed.
(cplus_demangle_opname): Remove function wide variable `int i' and
replace with `size_t i' at each location where it is used.
(cplus_demangle_opname): change type of `i' from int to size_t.
* cppexp.c (right_shift): Mark parameter `pfile' with
ATTRIBUTE_UNUSED.
* cpphash.c (cpp_lookup): Likewise.
(cpp_hash_cleanup): Likewise.
* cpplib.c (parse_name): Add a prototype and make it static.
(null_underflow): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
(null_cleanup): Likewise for parameters `pbuf' and `pfile'.
(macro_cleanup): Likewise for parameter `pfile'.
(file_cleanup): Likewise.
* cpplib.h (cpp_reader_init, cpp_options_init, cpp_start_read,
cpp_read_check_assertion, skip_rest_of_line): Add prototypes.
* crtstuff.c (force_to_data, __CTOR_LIST__, force_to_data,
__DTOR_END__, __FRAME_END__): Mark with ATTRIBUTE_UNUSED.
* cse.c (cse_check_loop_start): Mark parameter `set' with
ATTRIBUTE_UNUSED.
* dbxout.c (flag_minimal_debug, have_used_extensions,
source_label_number): Move inside macro wrapper check against
defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO).
* dwarf2out.c (gen_entry_point_die): Hide prototype and definition.
* except.h (doing_eh): Provide prototype.
* expr.c: Move inclusion of expr.h to after insn-config.h.
* final.c: Include reload.h.
(shorten_branches): Cast the first argument of bzero to char *.
* fix-header.c (cpp_print_containing_files): Mark parameter
`pfile' with ATTRIBUTE_UNUSED.
(cpp_fatal): Likewise.
* flow.c (find_basic_blocks_1): Cast the first argument of bzero
to char *.
* genattrtab.c (make_length_attrs): Change the type of variable
`i' from int to size_t.
(zero_fn): Mark parameter `exp' with ATTRIBUTE_UNUSED.
(one_fn): Likewise.
* genextract.c (main): When generating insn-extract.c, mark
variable `junk' with ATTRIBUTE_UNUSED.
* gengenrtl.c (gencode): When generating genrtl.c, cast the first
argument of bzero to char*.
* integrate.c: Include toplev.h.
* libgcc2.c: Wrap `struct exception_table' and
`find_exception_handler' in macro DWARF2_UNWIND_INFO.
* objc/Make-lang.in (objc-act.o): Depend on toplev.h.
* objc/objc-act.c: Include toplev.h.
(lang_print_xnode): Mark parameters `file', `node' and `indent'
with ATTRIBUTE_UNUSED.
(finish_protocol): Likewise for parameter `protocol'.
* output.h (declare_weak): Add prototype.
(decode_reg_name): Don't wrap with TREE_CODE macro.
(assemble_alias): Add prototype.
* regclass.c: Include output.h.
* reload.h (reloads_conflict): Add prototype.
* rtl.h (print_rtl_single, mark_elimiation, reg_class_subset_p,
output_func_start_profiler): Add prototypes.
* rtlanal.c (reg_set_p_1): Mark parameters `x' and `pat' with
ATTRIBUTE_UNUSED.
* scan-decls.c: Include scan.h.
* scan.h (recognized_function, recognized_extern): Add prototypes.
* stmt.c: Include output.h.
* toplev.c (error_for_asm, warning_for_asm): Remove prototypes.
(output_lang_identify): Hide prototype and definition.
(float_signal): Mark parameter `signo' with ATTRIBUTE_UNUSED.
(pipe_closed): Likewise.
* toplev.h (count_error, strip_off_ending, error_for_asm,
warning_for_asm): Add prototypes.
From-SVN: r19712
1998-05-13 14:40:39 +02:00
|
|
|
size_t i;
|
1991-10-24 18:21:48 +01:00
|
|
|
struct attr_desc *length_attr, *new_attr;
|
|
|
|
struct attr_value *av, *new_av;
|
|
|
|
struct insn_ent *ie, *new_ie;
|
|
|
|
|
|
|
|
/* See if length attribute is defined. If so, it must be numeric. Make
|
|
|
|
it special so we don't output anything for it. */
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
length_attr = find_attr (&length_str, 0);
|
1991-10-24 18:21:48 +01:00
|
|
|
if (length_attr == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (! length_attr->is_numeric)
|
2001-12-01 19:42:49 +01:00
|
|
|
fatal ("length attribute must be numeric");
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
length_attr->is_const = 0;
|
1991-10-24 18:21:48 +01:00
|
|
|
length_attr->is_special = 1;
|
|
|
|
|
|
|
|
/* Make each new attribute, in turn. */
|
optabs.c (init_optabs): Initialize fixtab...
* optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab,
and extendtab within their proper array boundaries.
* emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds
for the entire array.
* config/arm/arm.c (arm_override_options): Use ARRAY_SIZE.
* config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise.
* config/avr/avr.c (order_regs_for_local_alloc): Likewise.
* config/fr30/fr30.c (fr30_print_operand): Likewise.
* config/i386/dgux.c (output_options): Likewise.
* config/i386/dgux.h (ASM_FILE_START): Likewise.
* config/m88k/m88k.c (output_options): Likewise.
* config/m88k/m88k.h (ASM_FILE_START): Likewise.
* config/mcore/mcore.c (mcore_output_inline_const_forced,
layout_mcore_frame, handle_structs_in_regs): Likewise.
* config/mips/mips.c (output_block_move): Likewise.
* config/rs6000/rs6000.c (rs6000_override_options,
rs6000_file_start): Likewise.
* config/sparc/sparc.c (sparc_add_gc_roots): Likewise.
* fixinc/fixfixes.c (FIX_TABLE_CT): Likewise.
* fixinc/fixtests.c (TEST_TABLE_CT): Likewise.
* builtins.c (expand_builtin_setjmp): Likewise.
* expr.c (safe_from_p): Likewise.
* flow.c (life_analysis): Likewise.
* fold-const.c (size_int_type_wide): Likewise.
* gcc.c (translate_options, init_spec, set_spec, main): Likewise.
* genattrtab.c (make_length_attrs): Likewise.
* genopinit.c (gen_insn): Likewise.
* genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise.
* global.c (global_alloc): Likewise.
* local-alloc.c (find_free_reg): Likewise.
* mips-tdump.c (print_symbol): Likewise.
* mips-tfile.c (parse_def, parse_input): Likewise.
* reload1.c (NUM_ELIMINABLE_REGS): Likewise.
* stmt.c (expand_nl_goto_receiver): Likewise.
* stor-layout.c (set_sizetype): Likewise.
* varasm.c (decode_reg_name): Likewise.
* toplev.c (decode_f_option, decode_W_option,
set_target_switch, print_switch_values): Likewise.
(NUM_ELEM): Remove macro.
(display_help, main): s/NUM_ELEM/ARRAY_SIZE/
From-SVN: r35949
2000-08-24 22:31:35 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE (new_names); i++)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
make_internal_attr (new_names[i],
|
|
|
|
substitute_address (length_attr->default_val->value,
|
|
|
|
no_address_fn[i], address_fn[i]),
|
2003-07-09 02:38:40 +02:00
|
|
|
ATTR_NONE);
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
new_attr = find_attr (&new_names[i], 0);
|
1991-10-24 18:21:48 +01:00
|
|
|
for (av = length_attr->first_value; av; av = av->next)
|
|
|
|
for (ie = av->first_insn; ie; ie = ie->next)
|
|
|
|
{
|
|
|
|
new_av = get_attr_value (substitute_address (av->value,
|
|
|
|
no_address_fn[i],
|
|
|
|
address_fn[i]),
|
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
|
|
|
new_attr, ie->def->insn_code);
|
2003-07-19 16:47:15 +02:00
|
|
|
new_ie = oballoc (sizeof (struct insn_ent));
|
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
|
|
|
new_ie->def = ie->def;
|
1991-10-24 18:21:48 +01:00
|
|
|
insert_insn_ent (new_av, new_ie);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Utility functions called from above routine. */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
identity_fn (rtx exp)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
return exp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
zero_fn (rtx exp ATTRIBUTE_UNUSED)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
return make_numeric_value (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
one_fn (rtx exp ATTRIBUTE_UNUSED)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
return make_numeric_value (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
max_fn (rtx exp)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1999-02-21 19:30:37 +01:00
|
|
|
int unknown;
|
|
|
|
return make_numeric_value (max_attr_value (exp, &unknown));
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_length_unit_log (void)
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
{
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
struct attr_desc *length_attr = find_attr (&length_str, 0);
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
struct attr_value *av;
|
|
|
|
struct insn_ent *ie;
|
|
|
|
unsigned int length_unit_log, length_or;
|
1999-02-21 19:30:37 +01:00
|
|
|
int unknown = 0;
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
|
|
|
|
if (length_attr == 0)
|
|
|
|
return;
|
1999-02-21 19:30:37 +01:00
|
|
|
length_or = or_attr_value (length_attr->default_val->value, &unknown);
|
|
|
|
for (av = length_attr->first_value; av; av = av->next)
|
|
|
|
for (ie = av->first_insn; ie; ie = ie->next)
|
|
|
|
length_or |= or_attr_value (av->value, &unknown);
|
|
|
|
|
|
|
|
if (unknown)
|
|
|
|
length_unit_log = 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
length_or = ~length_or;
|
|
|
|
for (length_unit_log = 0; length_or & 1; length_or >>= 1)
|
2000-09-12 17:36:21 +02:00
|
|
|
length_unit_log++;
|
1999-02-21 19:30:37 +01:00
|
|
|
}
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
printf ("int length_unit_log = %u;\n", length_unit_log);
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Take a COND expression and see if any of the conditions in it can be
|
|
|
|
simplified. If any are known true or known false for the particular insn
|
|
|
|
code, the COND can be further simplified.
|
|
|
|
|
|
|
|
Also call ourselves on any COND operations that are values of this COND.
|
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
We do not modify EXP; rather, we make and return a new rtx. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
simplify_cond (rtx exp, int insn_code, int insn_index)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
int i, j;
|
1992-05-05 00:57:54 +02:00
|
|
|
/* We store the desired contents here,
|
|
|
|
then build a new expression if they don't match EXP. */
|
|
|
|
rtx defval = XEXP (exp, 1);
|
1992-05-05 04:55:45 +02:00
|
|
|
rtx new_defval = XEXP (exp, 1);
|
1992-05-05 00:57:54 +02:00
|
|
|
int len = XVECLEN (exp, 0);
|
2003-07-19 16:47:15 +02:00
|
|
|
rtx *tests = xmalloc (len * sizeof (rtx));
|
1992-05-05 00:57:54 +02:00
|
|
|
int allsame = 1;
|
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
|
|
|
rtx ret;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
/* This lets us free all storage allocated below, if appropriate. */
|
2002-12-16 19:23:00 +01:00
|
|
|
obstack_finish (rtl_obstack);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
alpha.c (check_float_value): Use memcpy, not bcopy.
* alpha.c (check_float_value): Use memcpy, not bcopy.
* arm.c (output_move_double): Likewise.
* arm.md: Likewise.
* m88k.c (legitimize_operand): Likewise.
* m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise.
* m88k.md: Likewise.
* mips.c (override_options): Likewise.
* mips.md: Likewise.
* romp.c (output_fpops): Likewise.
* rs6000.c (rs6000_override_options): Likewise.
* sh.md: Likewise.
* vax.c (check_float_value): Likewise.
* emit-rtl.c (copy_rtx_if_shared, init_emit_once): Likewise.
* expmed.c (synth_mult): Likewise.
* final.c (add_bb_string): Likewise.
* genattr.c (main): Likewise.
* genattrtab.c (attr_string, simplify_cond, copy_rtx_unchanging):
Likewise.
* jump.c (thread_jumps): Likewise.
* prefix.c (save_string): Likewise.
* real.h (REAL_VALUE_FROM_CONST_DOUBLE): Likewise.
* regclass.c (init_reg_sets, init_reg_sets_1): Likewise.
* reload1.c (reload, eliminate_regs): Likewise.
cp:
* decl.c (grokdeclarator, save_function_data): Use memcpy, not bcopy.
* lex.c (copy_lang_decl): Likewise.
java:
* decl.c (copy_lang_decl): Use memcpy, not bcopy.
* jcf-parse.c (jcf_figure_file_type): Likewise.
From-SVN: r37367
2000-11-10 17:01:28 +01:00
|
|
|
memcpy (tests, XVEC (exp, 0)->elem, len * sizeof (rtx));
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
/* See if default value needs simplification. */
|
|
|
|
if (GET_CODE (defval) == COND)
|
1992-05-05 04:55:45 +02:00
|
|
|
new_defval = simplify_cond (defval, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
/* Simplify the subexpressions, and see what tests we can get rid of. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
for (i = 0; i < len; i += 2)
|
1992-05-05 00:57:54 +02:00
|
|
|
{
|
|
|
|
rtx newtest, newval;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
/* Simplify this test. */
|
2001-08-14 15:01:20 +02:00
|
|
|
newtest = simplify_test_exp_in_temp (tests[i], insn_code, insn_index);
|
1999-10-04 08:08:16 +02:00
|
|
|
tests[i] = newtest;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1999-10-04 08:08:16 +02:00
|
|
|
newval = tests[i + 1];
|
1992-05-05 00:57:54 +02:00
|
|
|
/* See if this value may need simplification. */
|
|
|
|
if (GET_CODE (newval) == COND)
|
|
|
|
newval = simplify_cond (newval, insn_code, insn_index);
|
|
|
|
|
|
|
|
/* Look for ways to delete or combine this test. */
|
|
|
|
if (newtest == true_rtx)
|
|
|
|
{
|
|
|
|
/* If test is true, make this value the default
|
|
|
|
and discard this + any following tests. */
|
|
|
|
len = i;
|
1999-10-04 08:08:16 +02:00
|
|
|
defval = tests[i + 1];
|
1992-05-05 04:55:45 +02:00
|
|
|
new_defval = newval;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
else if (newtest == false_rtx)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1992-05-05 00:57:54 +02:00
|
|
|
/* If test is false, discard it and its value. */
|
|
|
|
for (j = i; j < len - 2; j++)
|
1999-10-04 08:08:16 +02:00
|
|
|
tests[j] = tests[j + 2];
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
i -= 2;
|
1992-05-05 23:48:14 +02:00
|
|
|
len -= 2;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1999-10-04 08:08:16 +02:00
|
|
|
else if (i > 0 && attr_equal_p (newval, tests[i - 1]))
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
|
|
|
/* If this value and the value for the prev test are the same,
|
|
|
|
merge the tests. */
|
|
|
|
|
1999-10-04 08:08:16 +02:00
|
|
|
tests[i - 2]
|
|
|
|
= insert_right_side (IOR, tests[i - 2], newtest,
|
1992-05-05 23:48:14 +02:00
|
|
|
insn_code, insn_index);
|
|
|
|
|
|
|
|
/* Delete this test/value. */
|
|
|
|
for (j = i; j < len - 2; j++)
|
1999-10-04 08:08:16 +02:00
|
|
|
tests[j] = tests[j + 2];
|
1992-05-05 00:57:54 +02:00
|
|
|
len -= 2;
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
i -= 2;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
else
|
1999-10-04 08:08:16 +02:00
|
|
|
tests[i + 1] = newval;
|
1992-05-05 00:57:54 +02:00
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
/* If the last test in a COND has the same value
|
|
|
|
as the default value, that test isn't needed. */
|
|
|
|
|
1999-10-04 08:08:16 +02:00
|
|
|
while (len > 0 && attr_equal_p (tests[len - 1], new_defval))
|
1992-05-05 23:48:14 +02:00
|
|
|
len -= 2;
|
|
|
|
|
|
|
|
/* See if we changed anything. */
|
|
|
|
if (len != XVECLEN (exp, 0) || new_defval != XEXP (exp, 1))
|
|
|
|
allsame = 0;
|
|
|
|
else
|
|
|
|
for (i = 0; i < len; i++)
|
1999-10-04 08:08:16 +02:00
|
|
|
if (! attr_equal_p (tests[i], XVECEXP (exp, 0, i)))
|
1992-05-05 23:48:14 +02:00
|
|
|
{
|
|
|
|
allsame = 0;
|
|
|
|
break;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
if (len == 0)
|
|
|
|
{
|
|
|
|
if (GET_CODE (defval) == COND)
|
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 = simplify_cond (defval, insn_code, insn_index);
|
|
|
|
else
|
|
|
|
ret = defval;
|
1992-05-05 00:57:54 +02:00
|
|
|
}
|
1992-05-05 23:48:14 +02:00
|
|
|
else if (allsame)
|
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 = exp;
|
1992-05-05 00:57:54 +02:00
|
|
|
else
|
|
|
|
{
|
1992-05-05 23:48:14 +02:00
|
|
|
rtx newexp = rtx_alloc (COND);
|
1992-05-05 00:57:54 +02:00
|
|
|
|
|
|
|
XVEC (newexp, 0) = rtvec_alloc (len);
|
alpha.c (check_float_value): Use memcpy, not bcopy.
* alpha.c (check_float_value): Use memcpy, not bcopy.
* arm.c (output_move_double): Likewise.
* arm.md: Likewise.
* m88k.c (legitimize_operand): Likewise.
* m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise.
* m88k.md: Likewise.
* mips.c (override_options): Likewise.
* mips.md: Likewise.
* romp.c (output_fpops): Likewise.
* rs6000.c (rs6000_override_options): Likewise.
* sh.md: Likewise.
* vax.c (check_float_value): Likewise.
* emit-rtl.c (copy_rtx_if_shared, init_emit_once): Likewise.
* expmed.c (synth_mult): Likewise.
* final.c (add_bb_string): Likewise.
* genattr.c (main): Likewise.
* genattrtab.c (attr_string, simplify_cond, copy_rtx_unchanging):
Likewise.
* jump.c (thread_jumps): Likewise.
* prefix.c (save_string): Likewise.
* real.h (REAL_VALUE_FROM_CONST_DOUBLE): Likewise.
* regclass.c (init_reg_sets, init_reg_sets_1): Likewise.
* reload1.c (reload, eliminate_regs): Likewise.
cp:
* decl.c (grokdeclarator, save_function_data): Use memcpy, not bcopy.
* lex.c (copy_lang_decl): Likewise.
java:
* decl.c (copy_lang_decl): Use memcpy, not bcopy.
* jcf-parse.c (jcf_figure_file_type): Likewise.
From-SVN: r37367
2000-11-10 17:01:28 +01:00
|
|
|
memcpy (XVEC (newexp, 0)->elem, tests, len * sizeof (rtx));
|
1992-05-05 23:48:14 +02:00
|
|
|
XEXP (newexp, 1) = new_defval;
|
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 = newexp;
|
1991-10-24 18:21:48 +01: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
|
|
|
free (tests);
|
|
|
|
return ret;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Remove an insn entry from an attribute value. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
remove_insn_ent (struct attr_value *av, struct insn_ent *ie)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct insn_ent *previe;
|
|
|
|
|
|
|
|
if (av->first_insn == ie)
|
|
|
|
av->first_insn = ie->next;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (previe = av->first_insn; previe->next != ie; previe = previe->next)
|
|
|
|
;
|
|
|
|
previe->next = ie->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
av->num_insns--;
|
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
|
|
|
if (ie->def->insn_code == -1)
|
1991-10-24 18:21:48 +01:00
|
|
|
av->has_asm_insn = 0;
|
1994-10-12 16:31:29 +01:00
|
|
|
|
|
|
|
num_insn_ents--;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Insert an insn entry in an attribute value list. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
insert_insn_ent (struct attr_value *av, struct insn_ent *ie)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
ie->next = av->first_insn;
|
|
|
|
av->first_insn = ie;
|
|
|
|
av->num_insns++;
|
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
|
|
|
if (ie->def->insn_code == -1)
|
1991-10-24 18:21:48 +01:00
|
|
|
av->has_asm_insn = 1;
|
1994-10-12 16:31:29 +01:00
|
|
|
|
|
|
|
num_insn_ents++;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* This is a utility routine to take an expression that is a tree of either
|
|
|
|
AND or IOR expressions and insert a new term. The new term will be
|
|
|
|
inserted at the right side of the first node whose code does not match
|
|
|
|
the root. A new node will be created with the root's code. Its left
|
|
|
|
side will be the old right side and its right side will be the new
|
|
|
|
term.
|
|
|
|
|
|
|
|
If the `term' is itself a tree, all its leaves will be inserted. */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
insert_right_side (enum rtx_code code, rtx exp, rtx term, int insn_code, int insn_index)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
rtx newexp;
|
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
/* Avoid consing in some special cases. */
|
|
|
|
if (code == AND && term == true_rtx)
|
|
|
|
return exp;
|
|
|
|
if (code == AND && term == false_rtx)
|
|
|
|
return false_rtx;
|
|
|
|
if (code == AND && exp == true_rtx)
|
|
|
|
return term;
|
|
|
|
if (code == AND && exp == false_rtx)
|
|
|
|
return false_rtx;
|
|
|
|
if (code == IOR && term == true_rtx)
|
|
|
|
return true_rtx;
|
|
|
|
if (code == IOR && term == false_rtx)
|
|
|
|
return exp;
|
|
|
|
if (code == IOR && exp == true_rtx)
|
|
|
|
return true_rtx;
|
|
|
|
if (code == IOR && exp == false_rtx)
|
|
|
|
return term;
|
1992-05-05 23:48:14 +02:00
|
|
|
if (attr_equal_p (exp, term))
|
1992-05-05 00:57:54 +02:00
|
|
|
return exp;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
if (GET_CODE (term) == code)
|
|
|
|
{
|
|
|
|
exp = insert_right_side (code, exp, XEXP (term, 0),
|
|
|
|
insn_code, insn_index);
|
|
|
|
exp = insert_right_side (code, exp, XEXP (term, 1),
|
|
|
|
insn_code, insn_index);
|
|
|
|
|
|
|
|
return exp;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GET_CODE (exp) == code)
|
|
|
|
{
|
1992-05-05 00:57:54 +02:00
|
|
|
rtx new = insert_right_side (code, XEXP (exp, 1),
|
|
|
|
term, insn_code, insn_index);
|
|
|
|
if (new != XEXP (exp, 1))
|
|
|
|
/* Make a copy of this expression and call recursively. */
|
|
|
|
newexp = attr_rtx (code, XEXP (exp, 0), new);
|
|
|
|
else
|
|
|
|
newexp = exp;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Insert the new term. */
|
1992-03-06 23:25:46 +01:00
|
|
|
newexp = attr_rtx (code, exp, term);
|
1992-05-05 00:57:54 +02:00
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2001-08-14 15:01:20 +02:00
|
|
|
return simplify_test_exp_in_temp (newexp, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* If we have an expression which AND's a bunch of
|
|
|
|
(not (eq_attrq "alternative" "n"))
|
|
|
|
terms, we may have covered all or all but one of the possible alternatives.
|
|
|
|
If so, we can optimize. Similarly for IOR's of EQ_ATTR.
|
|
|
|
|
|
|
|
This routine is passed an expression and either AND or IOR. It returns a
|
1993-03-06 14:42:58 +01:00
|
|
|
bitmask indicating which alternatives are mentioned within EXP. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
compute_alternative_mask (rtx exp, enum rtx_code code)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
const char *string;
|
1991-10-24 18:21:48 +01:00
|
|
|
if (GET_CODE (exp) == code)
|
|
|
|
return compute_alternative_mask (XEXP (exp, 0), code)
|
|
|
|
| compute_alternative_mask (XEXP (exp, 1), code);
|
|
|
|
|
|
|
|
else if (code == AND && GET_CODE (exp) == NOT
|
|
|
|
&& GET_CODE (XEXP (exp, 0)) == EQ_ATTR
|
|
|
|
&& XSTR (XEXP (exp, 0), 0) == alternative_name)
|
1992-05-07 22:01:01 +02:00
|
|
|
string = XSTR (XEXP (exp, 0), 1);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
else if (code == IOR && GET_CODE (exp) == EQ_ATTR
|
|
|
|
&& XSTR (exp, 0) == alternative_name)
|
1992-05-07 22:01:01 +02:00
|
|
|
string = XSTR (exp, 1);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
else if (GET_CODE (exp) == EQ_ATTR_ALT)
|
|
|
|
{
|
|
|
|
if (code == AND && XINT (exp, 1))
|
|
|
|
return XINT (exp, 0);
|
|
|
|
|
|
|
|
if (code == IOR && !XINT (exp, 1))
|
|
|
|
return XINT (exp, 0);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
else
|
|
|
|
return 0;
|
1992-05-07 22:01:01 +02:00
|
|
|
|
|
|
|
if (string[1] == 0)
|
|
|
|
return 1 << (string[0] - '0');
|
|
|
|
return 1 << atoi (string);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Given I, a single-bit mask, return RTX to compare the `alternative'
|
|
|
|
attribute with the value represented by that bit. */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
make_alternative_compare (int mask)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
return mk_attr_alt (mask);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* If we are processing an (eq_attr "attr" "value") test, we find the value
|
|
|
|
of "attr" for this insn code. From that value, we can compute a test
|
|
|
|
showing when the EQ_ATTR will be true. This routine performs that
|
|
|
|
computation. If a test condition involves an address, we leave the EQ_ATTR
|
2000-09-12 17:36:21 +02:00
|
|
|
intact because addresses are only valid for the `length' attribute.
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1993-03-06 14:42:58 +01:00
|
|
|
EXP is the EQ_ATTR expression and VALUE is the value of that attribute
|
|
|
|
for the insn corresponding to INSN_CODE and INSN_INDEX. */
|
1992-05-05 00:57:54 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
rtx orexp, andexp;
|
|
|
|
rtx right;
|
|
|
|
rtx newexp;
|
|
|
|
int 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
|
|
|
switch (GET_CODE (value))
|
1991-10-24 18:21:48 +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
|
|
|
case CONST_STRING:
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if (! strcmp_check (XSTR (value, 0), XSTR (exp, 1)))
|
1991-10-24 18:21:48 +01:00
|
|
|
newexp = true_rtx;
|
|
|
|
else
|
|
|
|
newexp = false_rtx;
|
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
|
|
|
break;
|
|
|
|
|
|
|
|
case SYMBOL_REF:
|
|
|
|
{
|
|
|
|
char *p;
|
|
|
|
char string[256];
|
|
|
|
|
|
|
|
gcc_assert (GET_CODE (exp) == EQ_ATTR);
|
|
|
|
gcc_assert (strlen (XSTR (exp, 0)) + strlen (XSTR (exp, 1)) + 2
|
|
|
|
<= 256);
|
|
|
|
|
|
|
|
strcpy (string, XSTR (exp, 0));
|
|
|
|
strcat (string, "_");
|
|
|
|
strcat (string, XSTR (exp, 1));
|
|
|
|
for (p = string; *p; p++)
|
|
|
|
*p = TOUPPER (*p);
|
|
|
|
|
|
|
|
newexp = attr_rtx (EQ, value,
|
|
|
|
attr_rtx (SYMBOL_REF,
|
|
|
|
DEF_ATTR_STRING (string)));
|
|
|
|
break;
|
|
|
|
}
|
1991-10-24 18:21:48 +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
|
|
|
case COND:
|
|
|
|
/* We construct an IOR of all the cases for which the
|
|
|
|
requested attribute value is present. Since we start with
|
|
|
|
FALSE, if it is not present, FALSE will be returned.
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
Each case is the AND of the NOT's of the previous conditions with the
|
2000-09-12 17:36:21 +02:00
|
|
|
current condition; in the default case the current condition is TRUE.
|
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
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
For each possible COND value, call ourselves recursively.
|
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
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
The extra TRUE and FALSE expressions will be eliminated by another
|
1996-07-04 00:07:53 +02:00
|
|
|
call to the simplification routine. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
orexp = false_rtx;
|
|
|
|
andexp = true_rtx;
|
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (value, 0); i += 2)
|
|
|
|
{
|
2001-08-14 15:01:20 +02:00
|
|
|
rtx this = simplify_test_exp_in_temp (XVECEXP (value, 0, i),
|
|
|
|
insn_code, insn_index);
|
1992-05-05 00:57:54 +02:00
|
|
|
|
|
|
|
right = insert_right_side (AND, andexp, this,
|
1991-10-24 18:21:48 +01:00
|
|
|
insn_code, insn_index);
|
|
|
|
right = insert_right_side (AND, right,
|
1993-03-06 14:42:58 +01:00
|
|
|
evaluate_eq_attr (exp,
|
|
|
|
XVECEXP (value, 0,
|
|
|
|
i + 1),
|
|
|
|
insn_code, insn_index),
|
1991-10-24 18:21:48 +01:00
|
|
|
insn_code, insn_index);
|
|
|
|
orexp = insert_right_side (IOR, orexp, right,
|
|
|
|
insn_code, insn_index);
|
|
|
|
|
|
|
|
/* Add this condition into the AND expression. */
|
1992-05-05 00:57:54 +02:00
|
|
|
newexp = attr_rtx (NOT, this);
|
1991-10-24 18:21:48 +01:00
|
|
|
andexp = insert_right_side (AND, andexp, newexp,
|
|
|
|
insn_code, insn_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle the default case. */
|
|
|
|
right = insert_right_side (AND, andexp,
|
|
|
|
evaluate_eq_attr (exp, XEXP (value, 1),
|
1993-03-06 14:42:58 +01:00
|
|
|
insn_code, insn_index),
|
1991-10-24 18:21:48 +01:00
|
|
|
insn_code, insn_index);
|
|
|
|
newexp = insert_right_side (IOR, orexp, right, insn_code, insn_index);
|
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
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
gcc_unreachable ();
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
1992-04-30 04:20:02 +02:00
|
|
|
/* If uses an address, must return original expression. But set the
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_IND_SIMPLIFIED_P bit so we don't try to simplify it again. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
address_used = 0;
|
|
|
|
walk_attr_value (newexp);
|
|
|
|
|
|
|
|
if (address_used)
|
1992-04-30 04:20:02 +02:00
|
|
|
{
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (! ATTR_IND_SIMPLIFIED_P (exp))
|
1992-05-05 00:57:54 +02:00
|
|
|
return copy_rtx_unchanging (exp);
|
1992-04-30 04:20:02 +02:00
|
|
|
return exp;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
else
|
|
|
|
return newexp;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* This routine is called when an AND of a term with a tree of AND's is
|
|
|
|
encountered. If the term or its complement is present in the tree, it
|
|
|
|
can be replaced with TRUE or FALSE, respectively.
|
|
|
|
|
|
|
|
Note that (eq_attr "att" "v1") and (eq_attr "att" "v2") cannot both
|
2000-09-12 17:36:21 +02:00
|
|
|
be true and hence are complementary.
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
There is one special case: If we see
|
|
|
|
(and (not (eq_attr "att" "v1"))
|
|
|
|
(eq_attr "att" "v2"))
|
|
|
|
this can be replaced by (eq_attr "att" "v2"). To do this we need to
|
|
|
|
replace the term, not anything in the AND tree. So we pass a pointer to
|
|
|
|
the term. */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
rtx left, right;
|
|
|
|
rtx newexp;
|
|
|
|
rtx temp;
|
|
|
|
int left_eliminates_term, right_eliminates_term;
|
|
|
|
|
|
|
|
if (GET_CODE (exp) == AND)
|
|
|
|
{
|
2000-09-12 17:36:21 +02:00
|
|
|
left = simplify_and_tree (XEXP (exp, 0), pterm, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
right = simplify_and_tree (XEXP (exp, 1), pterm, insn_code, insn_index);
|
|
|
|
if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
|
|
|
|
{
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
newexp = attr_rtx (AND, left, right);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2001-08-14 15:01:20 +02:00
|
|
|
exp = simplify_test_exp_in_temp (newexp, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GET_CODE (exp) == IOR)
|
|
|
|
{
|
|
|
|
/* For the IOR case, we do the same as above, except that we can
|
|
|
|
only eliminate `term' if both sides of the IOR would do so. */
|
|
|
|
temp = *pterm;
|
2000-09-12 17:36:21 +02:00
|
|
|
left = simplify_and_tree (XEXP (exp, 0), &temp, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
left_eliminates_term = (temp == true_rtx);
|
|
|
|
|
|
|
|
temp = *pterm;
|
|
|
|
right = simplify_and_tree (XEXP (exp, 1), &temp, insn_code, insn_index);
|
|
|
|
right_eliminates_term = (temp == true_rtx);
|
|
|
|
|
|
|
|
if (left_eliminates_term && right_eliminates_term)
|
|
|
|
*pterm = true_rtx;
|
|
|
|
|
|
|
|
if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
|
|
|
|
{
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
newexp = attr_rtx (IOR, left, right);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2001-08-14 15:01:20 +02:00
|
|
|
exp = simplify_test_exp_in_temp (newexp, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for simplifications. Do some extra checking here since this
|
|
|
|
routine is called so many times. */
|
|
|
|
|
|
|
|
if (exp == *pterm)
|
|
|
|
return true_rtx;
|
|
|
|
|
|
|
|
else if (GET_CODE (exp) == NOT && XEXP (exp, 0) == *pterm)
|
|
|
|
return false_rtx;
|
|
|
|
|
|
|
|
else if (GET_CODE (*pterm) == NOT && exp == XEXP (*pterm, 0))
|
|
|
|
return false_rtx;
|
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
else if (GET_CODE (exp) == EQ_ATTR_ALT && GET_CODE (*pterm) == EQ_ATTR_ALT)
|
|
|
|
{
|
|
|
|
if (attr_alt_subset_p (*pterm, exp))
|
|
|
|
return true_rtx;
|
|
|
|
|
|
|
|
if (attr_alt_subset_of_compl_p (*pterm, exp))
|
|
|
|
return false_rtx;
|
|
|
|
|
|
|
|
if (attr_alt_subset_p (exp, *pterm))
|
|
|
|
*pterm = true_rtx;
|
|
|
|
|
|
|
|
return exp;
|
|
|
|
}
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
else if (GET_CODE (exp) == EQ_ATTR && GET_CODE (*pterm) == EQ_ATTR)
|
|
|
|
{
|
|
|
|
if (XSTR (exp, 0) != XSTR (*pterm, 0))
|
|
|
|
return exp;
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if (! strcmp_check (XSTR (exp, 1), XSTR (*pterm, 1)))
|
1991-10-24 18:21:48 +01:00
|
|
|
return true_rtx;
|
|
|
|
else
|
|
|
|
return false_rtx;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GET_CODE (*pterm) == EQ_ATTR && GET_CODE (exp) == NOT
|
|
|
|
&& GET_CODE (XEXP (exp, 0)) == EQ_ATTR)
|
|
|
|
{
|
|
|
|
if (XSTR (*pterm, 0) != XSTR (XEXP (exp, 0), 0))
|
|
|
|
return exp;
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if (! strcmp_check (XSTR (*pterm, 1), XSTR (XEXP (exp, 0), 1)))
|
1991-10-24 18:21:48 +01:00
|
|
|
return false_rtx;
|
|
|
|
else
|
|
|
|
return true_rtx;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GET_CODE (exp) == EQ_ATTR && GET_CODE (*pterm) == NOT
|
|
|
|
&& GET_CODE (XEXP (*pterm, 0)) == EQ_ATTR)
|
|
|
|
{
|
|
|
|
if (XSTR (exp, 0) != XSTR (XEXP (*pterm, 0), 0))
|
|
|
|
return exp;
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if (! strcmp_check (XSTR (exp, 1), XSTR (XEXP (*pterm, 0), 1)))
|
1991-10-24 18:21:48 +01:00
|
|
|
return false_rtx;
|
|
|
|
else
|
|
|
|
*pterm = true_rtx;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GET_CODE (exp) == NOT && GET_CODE (*pterm) == NOT)
|
|
|
|
{
|
1992-05-05 23:48:14 +02:00
|
|
|
if (attr_equal_p (XEXP (exp, 0), XEXP (*pterm, 0)))
|
1991-10-24 18:21:48 +01:00
|
|
|
return true_rtx;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GET_CODE (exp) == NOT)
|
|
|
|
{
|
1992-05-05 23:48:14 +02:00
|
|
|
if (attr_equal_p (XEXP (exp, 0), *pterm))
|
1991-10-24 18:21:48 +01:00
|
|
|
return false_rtx;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GET_CODE (*pterm) == NOT)
|
|
|
|
{
|
1992-05-05 23:48:14 +02:00
|
|
|
if (attr_equal_p (XEXP (*pterm, 0), exp))
|
1991-10-24 18:21:48 +01:00
|
|
|
return false_rtx;
|
|
|
|
}
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
else if (attr_equal_p (exp, *pterm))
|
1991-10-24 18:21:48 +01:00
|
|
|
return true_rtx;
|
|
|
|
|
|
|
|
return exp;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1992-05-07 08:41:23 +02:00
|
|
|
/* Similar to `simplify_and_tree', but for IOR trees. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
simplify_or_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
rtx left, right;
|
|
|
|
rtx newexp;
|
|
|
|
rtx temp;
|
|
|
|
int left_eliminates_term, right_eliminates_term;
|
|
|
|
|
|
|
|
if (GET_CODE (exp) == IOR)
|
|
|
|
{
|
2000-09-12 17:36:21 +02:00
|
|
|
left = simplify_or_tree (XEXP (exp, 0), pterm, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
right = simplify_or_tree (XEXP (exp, 1), pterm, insn_code, insn_index);
|
|
|
|
if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
|
|
|
|
{
|
1992-03-06 23:25:46 +01:00
|
|
|
newexp = attr_rtx (GET_CODE (exp), left, right);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2001-08-14 15:01:20 +02:00
|
|
|
exp = simplify_test_exp_in_temp (newexp, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GET_CODE (exp) == AND)
|
|
|
|
{
|
|
|
|
/* For the AND case, we do the same as above, except that we can
|
|
|
|
only eliminate `term' if both sides of the AND would do so. */
|
|
|
|
temp = *pterm;
|
2000-09-12 17:36:21 +02:00
|
|
|
left = simplify_or_tree (XEXP (exp, 0), &temp, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
left_eliminates_term = (temp == false_rtx);
|
|
|
|
|
|
|
|
temp = *pterm;
|
|
|
|
right = simplify_or_tree (XEXP (exp, 1), &temp, insn_code, insn_index);
|
|
|
|
right_eliminates_term = (temp == false_rtx);
|
|
|
|
|
|
|
|
if (left_eliminates_term && right_eliminates_term)
|
|
|
|
*pterm = false_rtx;
|
|
|
|
|
|
|
|
if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
|
|
|
|
{
|
1992-03-06 23:25:46 +01:00
|
|
|
newexp = attr_rtx (GET_CODE (exp), left, right);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2001-08-14 15:01:20 +02:00
|
|
|
exp = simplify_test_exp_in_temp (newexp, insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
if (attr_equal_p (exp, *pterm))
|
1991-10-24 18:21:48 +01:00
|
|
|
return false_rtx;
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
else if (GET_CODE (exp) == NOT && attr_equal_p (XEXP (exp, 0), *pterm))
|
1991-10-24 18:21:48 +01:00
|
|
|
return true_rtx;
|
|
|
|
|
1992-05-05 23:48:14 +02:00
|
|
|
else if (GET_CODE (*pterm) == NOT && attr_equal_p (XEXP (*pterm, 0), exp))
|
1991-10-24 18:21:48 +01:00
|
|
|
return true_rtx;
|
|
|
|
|
|
|
|
else if (GET_CODE (*pterm) == EQ_ATTR && GET_CODE (exp) == NOT
|
|
|
|
&& GET_CODE (XEXP (exp, 0)) == EQ_ATTR
|
|
|
|
&& XSTR (*pterm, 0) == XSTR (XEXP (exp, 0), 0))
|
|
|
|
*pterm = false_rtx;
|
|
|
|
|
|
|
|
else if (GET_CODE (exp) == EQ_ATTR && GET_CODE (*pterm) == NOT
|
|
|
|
&& GET_CODE (XEXP (*pterm, 0)) == EQ_ATTR
|
|
|
|
&& XSTR (exp, 0) == XSTR (XEXP (*pterm, 0), 0))
|
|
|
|
return false_rtx;
|
|
|
|
|
|
|
|
return exp;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2000-12-16 20:00:57 +01:00
|
|
|
/* Compute approximate cost of the expression. Used to decide whether
|
ChangeLog.2, [...]: Fix spelling errors.
* ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog.5, ChangeLog,
cfg.c, cfganal.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgrtl.c,
collect2.c, combine.c, config.in, configure, configure.in,
conflict.c, dwarf2out.c, dwarfout.c, except.c, final.c, flow.c,
genattrtab.c, ggc-page.c, jump.c, lcm.c, predict.c, reg-stack.c,
reload1.c, rtlanal.c, sched-rgn.c, toplev.c, unwind-dw2-fde.h: Fix
spelling errors.
From-SVN: r46928
2001-11-11 12:25:28 +01:00
|
|
|
expression is cheap enough for inline. */
|
2000-12-16 20:00:57 +01:00
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
attr_rtx_cost (rtx x)
|
2000-12-16 20:00:57 +01:00
|
|
|
{
|
|
|
|
int cost = 0;
|
|
|
|
enum rtx_code code;
|
|
|
|
if (!x)
|
|
|
|
return 0;
|
|
|
|
code = GET_CODE (x);
|
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
case MATCH_OPERAND:
|
|
|
|
if (XSTR (x, 1)[0])
|
|
|
|
return 10;
|
|
|
|
else
|
|
|
|
return 0;
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
case EQ_ATTR_ALT:
|
|
|
|
return 0;
|
|
|
|
|
2000-12-16 20:00:57 +01:00
|
|
|
case EQ_ATTR:
|
|
|
|
/* Alternatives don't result into function call. */
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if (!strcmp_check (XSTR (x, 0), alternative_name))
|
2000-12-16 20:00:57 +01:00
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
return 5;
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
const char *fmt = GET_RTX_FORMAT (code);
|
|
|
|
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
|
|
|
{
|
|
|
|
switch (fmt[i])
|
|
|
|
{
|
|
|
|
case 'V':
|
|
|
|
case 'E':
|
|
|
|
for (j = 0; j < XVECLEN (x, i); j++)
|
|
|
|
cost += attr_rtx_cost (XVECEXP (x, i, j));
|
|
|
|
break;
|
|
|
|
case 'e':
|
|
|
|
cost += attr_rtx_cost (XEXP (x, i));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return cost;
|
|
|
|
}
|
2001-08-14 15:01:20 +02:00
|
|
|
|
|
|
|
/* Simplify test expression and use temporary obstack in order to avoid
|
2003-01-17 15:24:24 +01:00
|
|
|
memory bloat. Use ATTR_IND_SIMPLIFIED to avoid unnecessary simplifications
|
|
|
|
and avoid unnecessary copying if possible. */
|
2001-08-14 15:01:20 +02:00
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
simplify_test_exp_in_temp (rtx exp, int insn_code, int insn_index)
|
2001-08-14 15:01:20 +02:00
|
|
|
{
|
|
|
|
rtx x;
|
|
|
|
struct obstack *old;
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (ATTR_IND_SIMPLIFIED_P (exp))
|
2001-08-14 15:01:20 +02:00
|
|
|
return exp;
|
|
|
|
old = rtl_obstack;
|
|
|
|
rtl_obstack = temp_obstack;
|
|
|
|
x = simplify_test_exp (exp, insn_code, insn_index);
|
|
|
|
rtl_obstack = old;
|
|
|
|
if (x == exp || rtl_obstack == temp_obstack)
|
|
|
|
return x;
|
|
|
|
return attr_copy_rtx (x);
|
|
|
|
}
|
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
/* Returns true if S1 is a subset of S2. */
|
|
|
|
|
|
|
|
static bool
|
|
|
|
attr_alt_subset_p (rtx s1, rtx s2)
|
|
|
|
{
|
|
|
|
switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
|
|
|
|
{
|
|
|
|
case (0 << 1) | 0:
|
|
|
|
return !(XINT (s1, 0) &~ XINT (s2, 0));
|
|
|
|
|
|
|
|
case (0 << 1) | 1:
|
|
|
|
return !(XINT (s1, 0) & XINT (s2, 0));
|
|
|
|
|
|
|
|
case (1 << 1) | 0:
|
|
|
|
return false;
|
|
|
|
|
|
|
|
case (1 << 1) | 1:
|
|
|
|
return !(XINT (s2, 0) &~ XINT (s1, 0));
|
|
|
|
|
|
|
|
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 ();
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Returns true if S1 is a subset of complement of S2. */
|
|
|
|
|
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
|
|
|
static bool
|
|
|
|
attr_alt_subset_of_compl_p (rtx s1, rtx s2)
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
{
|
|
|
|
switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
|
|
|
|
{
|
|
|
|
case (0 << 1) | 0:
|
|
|
|
return !(XINT (s1, 0) & XINT (s2, 0));
|
|
|
|
|
|
|
|
case (0 << 1) | 1:
|
|
|
|
return !(XINT (s1, 0) & ~XINT (s2, 0));
|
|
|
|
|
|
|
|
case (1 << 1) | 0:
|
|
|
|
return !(XINT (s2, 0) &~ XINT (s1, 0));
|
|
|
|
|
|
|
|
case (1 << 1) | 1:
|
|
|
|
return false;
|
|
|
|
|
|
|
|
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 ();
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return EQ_ATTR_ALT expression representing intersection of S1 and S2. */
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
attr_alt_intersection (rtx s1, rtx s2)
|
|
|
|
{
|
|
|
|
rtx result = rtx_alloc (EQ_ATTR_ALT);
|
|
|
|
|
|
|
|
switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
|
|
|
|
{
|
|
|
|
case (0 << 1) | 0:
|
|
|
|
XINT (result, 0) = XINT (s1, 0) & XINT (s2, 0);
|
|
|
|
break;
|
|
|
|
case (0 << 1) | 1:
|
|
|
|
XINT (result, 0) = XINT (s1, 0) & ~XINT (s2, 0);
|
|
|
|
break;
|
|
|
|
case (1 << 1) | 0:
|
|
|
|
XINT (result, 0) = XINT (s2, 0) & ~XINT (s1, 0);
|
|
|
|
break;
|
|
|
|
case (1 << 1) | 1:
|
|
|
|
XINT (result, 0) = XINT (s1, 0) | XINT (s2, 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 ();
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
}
|
|
|
|
XINT (result, 1) = XINT (s1, 1) & XINT (s2, 1);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return EQ_ATTR_ALT expression representing union of S1 and S2. */
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
attr_alt_union (rtx s1, rtx s2)
|
|
|
|
{
|
|
|
|
rtx result = rtx_alloc (EQ_ATTR_ALT);
|
|
|
|
|
|
|
|
switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
|
|
|
|
{
|
|
|
|
case (0 << 1) | 0:
|
|
|
|
XINT (result, 0) = XINT (s1, 0) | XINT (s2, 0);
|
|
|
|
break;
|
|
|
|
case (0 << 1) | 1:
|
|
|
|
XINT (result, 0) = XINT (s2, 0) & ~XINT (s1, 0);
|
|
|
|
break;
|
|
|
|
case (1 << 1) | 0:
|
|
|
|
XINT (result, 0) = XINT (s1, 0) & ~XINT (s2, 0);
|
|
|
|
break;
|
|
|
|
case (1 << 1) | 1:
|
|
|
|
XINT (result, 0) = XINT (s1, 0) & XINT (s2, 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 ();
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
XINT (result, 1) = XINT (s1, 1) | XINT (s2, 1);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return EQ_ATTR_ALT expression representing complement of S. */
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
attr_alt_complement (rtx s)
|
|
|
|
{
|
|
|
|
rtx result = rtx_alloc (EQ_ATTR_ALT);
|
|
|
|
|
|
|
|
XINT (result, 0) = XINT (s, 0);
|
|
|
|
XINT (result, 1) = 1 - XINT (s, 1);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return EQ_ATTR_ALT expression representing set containing elements set
|
|
|
|
in E. */
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
mk_attr_alt (int e)
|
|
|
|
{
|
|
|
|
rtx result = rtx_alloc (EQ_ATTR_ALT);
|
|
|
|
|
|
|
|
XINT (result, 0) = e;
|
|
|
|
XINT (result, 1) = 0;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given an expression, see if it can be simplified for a particular insn
|
|
|
|
code based on the values of other attributes being tested. This can
|
|
|
|
eliminate nested get_attr_... calls.
|
|
|
|
|
2000-09-12 17:36:21 +02:00
|
|
|
Note that if an endless recursion is specified in the patterns, the
|
1991-10-24 18:21:48 +01:00
|
|
|
optimization will loop. However, it will do so in precisely the cases where
|
|
|
|
an infinite recursion loop could occur during compilation. It's better that
|
|
|
|
it occurs here! */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
simplify_test_exp (rtx exp, int insn_code, int insn_index)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
rtx left, right;
|
|
|
|
struct attr_desc *attr;
|
|
|
|
struct attr_value *av;
|
|
|
|
struct insn_ent *ie;
|
|
|
|
int i;
|
|
|
|
rtx newexp = exp;
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
bool left_alt, right_alt;
|
1992-05-05 00:57:54 +02:00
|
|
|
|
|
|
|
/* Don't re-simplify something we already simplified. */
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (ATTR_IND_SIMPLIFIED_P (exp) || ATTR_CURR_SIMPLIFIED_P (exp))
|
1992-05-05 00:57:54 +02:00
|
|
|
return exp;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
switch (GET_CODE (exp))
|
|
|
|
{
|
|
|
|
case AND:
|
1992-05-05 05:06:39 +02:00
|
|
|
left = SIMPLIFY_TEST_EXP (XEXP (exp, 0), insn_code, insn_index);
|
1992-05-07 01:13:18 +02:00
|
|
|
if (left == false_rtx)
|
2000-10-13 08:26:46 +02:00
|
|
|
return false_rtx;
|
1992-05-05 05:06:39 +02:00
|
|
|
right = SIMPLIFY_TEST_EXP (XEXP (exp, 1), insn_code, insn_index);
|
2005-08-05 11:42:06 +02:00
|
|
|
if (right == false_rtx)
|
2000-10-13 08:26:46 +02:00
|
|
|
return false_rtx;
|
1992-05-05 05:06:39 +02:00
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
if (GET_CODE (left) == EQ_ATTR_ALT
|
|
|
|
&& GET_CODE (right) == EQ_ATTR_ALT)
|
|
|
|
{
|
|
|
|
exp = attr_alt_intersection (left, right);
|
|
|
|
return simplify_test_exp (exp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
|
1992-05-05 05:06:39 +02:00
|
|
|
/* If either side is an IOR and we have (eq_attr "alternative" ..")
|
|
|
|
present on both sides, apply the distributive law since this will
|
|
|
|
yield simplifications. */
|
|
|
|
if ((GET_CODE (left) == IOR || GET_CODE (right) == IOR)
|
|
|
|
&& compute_alternative_mask (left, IOR)
|
|
|
|
&& compute_alternative_mask (right, IOR))
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1992-05-05 05:06:39 +02:00
|
|
|
if (GET_CODE (left) == IOR)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1992-05-05 05:06:39 +02:00
|
|
|
rtx tem = left;
|
|
|
|
left = right;
|
|
|
|
right = tem;
|
|
|
|
}
|
|
|
|
|
|
|
|
newexp = attr_rtx (IOR,
|
|
|
|
attr_rtx (AND, left, XEXP (right, 0)),
|
|
|
|
attr_rtx (AND, left, XEXP (right, 1)));
|
|
|
|
|
|
|
|
return SIMPLIFY_TEST_EXP (newexp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Try with the term on both sides. */
|
|
|
|
right = simplify_and_tree (right, &left, insn_code, insn_index);
|
|
|
|
if (left == XEXP (exp, 0) && right == XEXP (exp, 1))
|
|
|
|
left = simplify_and_tree (left, &right, insn_code, insn_index);
|
|
|
|
|
|
|
|
if (left == false_rtx || right == false_rtx)
|
2000-10-13 08:26:46 +02:00
|
|
|
return false_rtx;
|
1992-05-05 05:06:39 +02:00
|
|
|
else if (left == true_rtx)
|
|
|
|
{
|
1992-05-06 04:37:42 +02:00
|
|
|
return right;
|
1992-05-05 05:06:39 +02:00
|
|
|
}
|
|
|
|
else if (right == true_rtx)
|
|
|
|
{
|
1992-05-06 04:37:42 +02:00
|
|
|
return left;
|
1992-05-05 05:06:39 +02:00
|
|
|
}
|
|
|
|
/* See if all or all but one of the insn's alternatives are specified
|
|
|
|
in this tree. Optimize if so. */
|
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
if (GET_CODE (left) == NOT)
|
|
|
|
left_alt = (GET_CODE (XEXP (left, 0)) == EQ_ATTR
|
|
|
|
&& XSTR (XEXP (left, 0), 0) == alternative_name);
|
|
|
|
else
|
|
|
|
left_alt = (GET_CODE (left) == EQ_ATTR_ALT
|
|
|
|
&& XINT (left, 1));
|
|
|
|
|
|
|
|
if (GET_CODE (right) == NOT)
|
|
|
|
right_alt = (GET_CODE (XEXP (right, 0)) == EQ_ATTR
|
|
|
|
&& XSTR (XEXP (right, 0), 0) == alternative_name);
|
|
|
|
else
|
|
|
|
right_alt = (GET_CODE (right) == EQ_ATTR_ALT
|
|
|
|
&& XINT (right, 1));
|
|
|
|
|
|
|
|
if (insn_code >= 0
|
|
|
|
&& (GET_CODE (left) == AND
|
|
|
|
|| left_alt
|
|
|
|
|| GET_CODE (right) == AND
|
|
|
|
|| right_alt))
|
1992-05-05 05:06:39 +02:00
|
|
|
{
|
|
|
|
i = compute_alternative_mask (exp, AND);
|
|
|
|
if (i & ~insn_alternatives[insn_code])
|
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading
capital from diagnostics.
* c-lex.c (cb_file_change): Similarly.
* c-parse.in : Similarly.
* cfgrtl.c (verify_flow_info): Similarly.
* collect2.c: Similarly.
* cppfiles.c (find_include_file): Similarly.
* cppinit.c (cpp_handle_option): Similarly.
* cpplex.c (cpp_spell_token): Similarly.
* cppmain.c (do_preprocessing): Similarly.
* gcc.c (translate_options, process_command, do_spec1,
main, pfatal_execute): Similarly.
* genattr.c (main): Similarly.
* genattrtab.c (check_attr_test, operate_exp, simplify_test_exp,
write_test_expr, main): Similarly.
* gencodes.c (main): Similarly.
* genconfig.c (main): Similarly.
* genconstants.c (main): Similarly.
* genemit.c (main): Similarly.
* genextract.c (main): Similarly.
* genflags.c (main): Similarly.
* genopinit.c (main): Similarly.
* genoutput.c (process_template, main): Similarly.
* genpeep.c (main): Similarly.
* genrecog.c (main): Similarly.
* gensupport.c (is_predicable, identify_predicable_attribute,
alter_predicate_for_insn, init_md_reader_args, main): Similarly.
* ggc-page.c (alloc_anon): Similarly.
* mips-tfile.c (add_string, add_procedure, add_file, read_line,
parse_begin, parse_bend, parse_def, parse_end, parse_file,
parse_stabs_common, parse_stabs, write_varray, write_object,
read_seek, copy_object, main, error): Similarly.
* profile.c (compute_branch_probabilities): Similarly.
* reg-stack.c (check_asm_stack_operands): Similarly.
* reload.c (find_reloads): Similarly.
* reload1.c (spill_failure, failed_reload): Similarly.
* rtl-error.c (_fatal_insn_not_found): Similarly.
* toplev.c (read_integral_parameter, crash_signal,
decode_f_option, set_target_switch, parse_options_and_default_flags)
: Similarly.
* tradcif.y (parse_number, yylex): Similarly.
* tradcpp.c (main, fancy_abort): Similarly.
* tree.c (tree_check_failed): Similarly.
* varray.c (varray_check_failed): Similarly.
* xcoffout.c (xcoff_output_standard_types): Similarly.
cp:
* call.c (build_java_interface_fn_ref): Similarly.
* except.c (is_admissible_throw_operand): Similarly.
* init.c (build_java_class_ref): Similarly.
* xref.c (open_xref_file): Similarly.
objc:
* objc-act.c (get_object_ref, lookup_and_install_protocols,
build_objc_string_object, objc_declare_alias, build_ivar_chain,
finish_message_expr, build_protocol_expr, is_public,
start_class): Similarly.
testsuite:
* objc.dg/alias.m: Update.
* objc.dg/class-1.m: Update.
* objc.dg/const-str-1.m: Update.
* objc.dg/fwd-proto-1.m: Update.
* objc.dg/id-1.m: Update.
* objc.dg/super-class-1.m: Update.
From-SVN: r47518
2001-12-02 01:04:36 +01:00
|
|
|
fatal ("invalid alternative specified for pattern number %d",
|
1992-05-05 05:06:39 +02:00
|
|
|
insn_index);
|
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* If all alternatives are excluded, this is false. */
|
1992-05-05 05:06:39 +02:00
|
|
|
i ^= insn_alternatives[insn_code];
|
|
|
|
if (i == 0)
|
|
|
|
return false_rtx;
|
|
|
|
else if ((i & (i - 1)) == 0 && insn_alternatives[insn_code] > 1)
|
|
|
|
{
|
|
|
|
/* If just one excluded, AND a comparison with that one to the
|
|
|
|
front of the tree. The others will be eliminated by
|
|
|
|
optimization. We do not want to do this if the insn has one
|
|
|
|
alternative and we have tested none of them! */
|
|
|
|
left = make_alternative_compare (i);
|
|
|
|
right = simplify_and_tree (exp, &left, insn_code, insn_index);
|
|
|
|
newexp = attr_rtx (AND, left, right);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
return SIMPLIFY_TEST_EXP (newexp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
}
|
1992-05-05 05:06:39 +02:00
|
|
|
|
|
|
|
if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
|
|
|
|
{
|
|
|
|
newexp = attr_rtx (AND, left, right);
|
|
|
|
return SIMPLIFY_TEST_EXP (newexp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
case IOR:
|
1992-05-05 05:06:39 +02:00
|
|
|
left = SIMPLIFY_TEST_EXP (XEXP (exp, 0), insn_code, insn_index);
|
1992-05-07 01:13:18 +02:00
|
|
|
if (left == true_rtx)
|
2000-10-13 08:26:46 +02:00
|
|
|
return true_rtx;
|
1992-05-05 05:06:39 +02:00
|
|
|
right = SIMPLIFY_TEST_EXP (XEXP (exp, 1), insn_code, insn_index);
|
1992-05-07 01:13:18 +02:00
|
|
|
if (right == true_rtx)
|
2000-10-13 08:26:46 +02:00
|
|
|
return true_rtx;
|
1992-05-05 05:06:39 +02:00
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
if (GET_CODE (left) == EQ_ATTR_ALT
|
|
|
|
&& GET_CODE (right) == EQ_ATTR_ALT)
|
|
|
|
{
|
|
|
|
exp = attr_alt_union (left, right);
|
|
|
|
return simplify_test_exp (exp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
|
1992-05-05 05:06:39 +02:00
|
|
|
right = simplify_or_tree (right, &left, insn_code, insn_index);
|
|
|
|
if (left == XEXP (exp, 0) && right == XEXP (exp, 1))
|
|
|
|
left = simplify_or_tree (left, &right, insn_code, insn_index);
|
|
|
|
|
|
|
|
if (right == true_rtx || left == true_rtx)
|
2000-10-13 08:26:46 +02:00
|
|
|
return true_rtx;
|
1992-05-05 05:06:39 +02:00
|
|
|
else if (left == false_rtx)
|
|
|
|
{
|
1992-05-06 04:37:42 +02:00
|
|
|
return right;
|
1992-05-05 05:06:39 +02:00
|
|
|
}
|
|
|
|
else if (right == false_rtx)
|
|
|
|
{
|
1992-05-06 04:37:42 +02:00
|
|
|
return left;
|
1992-05-05 05:06:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Test for simple cases where the distributive law is useful. I.e.,
|
|
|
|
convert (ior (and (x) (y))
|
|
|
|
(and (x) (z)))
|
|
|
|
to (and (x)
|
|
|
|
(ior (y) (z)))
|
|
|
|
*/
|
|
|
|
|
|
|
|
else if (GET_CODE (left) == AND && GET_CODE (right) == AND
|
2000-09-12 17:36:21 +02:00
|
|
|
&& attr_equal_p (XEXP (left, 0), XEXP (right, 0)))
|
1992-05-05 05:06:39 +02:00
|
|
|
{
|
|
|
|
newexp = attr_rtx (IOR, XEXP (left, 1), XEXP (right, 1));
|
|
|
|
|
|
|
|
left = XEXP (left, 0);
|
|
|
|
right = newexp;
|
|
|
|
newexp = attr_rtx (AND, left, right);
|
|
|
|
return SIMPLIFY_TEST_EXP (newexp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* See if all or all but one of the insn's alternatives are specified
|
|
|
|
in this tree. Optimize if so. */
|
|
|
|
|
|
|
|
else if (insn_code >= 0
|
2000-09-12 17:36:21 +02:00
|
|
|
&& (GET_CODE (left) == IOR
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
|| (GET_CODE (left) == EQ_ATTR_ALT
|
|
|
|
&& !XINT (left, 1))
|
2000-09-12 17:36:21 +02:00
|
|
|
|| (GET_CODE (left) == EQ_ATTR
|
|
|
|
&& XSTR (left, 0) == alternative_name)
|
|
|
|
|| GET_CODE (right) == IOR
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
|| (GET_CODE (right) == EQ_ATTR_ALT
|
|
|
|
&& !XINT (right, 1))
|
2000-09-12 17:36:21 +02:00
|
|
|
|| (GET_CODE (right) == EQ_ATTR
|
|
|
|
&& XSTR (right, 0) == alternative_name)))
|
1992-05-05 05:06:39 +02:00
|
|
|
{
|
|
|
|
i = compute_alternative_mask (exp, IOR);
|
|
|
|
if (i & ~insn_alternatives[insn_code])
|
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading
capital from diagnostics.
* c-lex.c (cb_file_change): Similarly.
* c-parse.in : Similarly.
* cfgrtl.c (verify_flow_info): Similarly.
* collect2.c: Similarly.
* cppfiles.c (find_include_file): Similarly.
* cppinit.c (cpp_handle_option): Similarly.
* cpplex.c (cpp_spell_token): Similarly.
* cppmain.c (do_preprocessing): Similarly.
* gcc.c (translate_options, process_command, do_spec1,
main, pfatal_execute): Similarly.
* genattr.c (main): Similarly.
* genattrtab.c (check_attr_test, operate_exp, simplify_test_exp,
write_test_expr, main): Similarly.
* gencodes.c (main): Similarly.
* genconfig.c (main): Similarly.
* genconstants.c (main): Similarly.
* genemit.c (main): Similarly.
* genextract.c (main): Similarly.
* genflags.c (main): Similarly.
* genopinit.c (main): Similarly.
* genoutput.c (process_template, main): Similarly.
* genpeep.c (main): Similarly.
* genrecog.c (main): Similarly.
* gensupport.c (is_predicable, identify_predicable_attribute,
alter_predicate_for_insn, init_md_reader_args, main): Similarly.
* ggc-page.c (alloc_anon): Similarly.
* mips-tfile.c (add_string, add_procedure, add_file, read_line,
parse_begin, parse_bend, parse_def, parse_end, parse_file,
parse_stabs_common, parse_stabs, write_varray, write_object,
read_seek, copy_object, main, error): Similarly.
* profile.c (compute_branch_probabilities): Similarly.
* reg-stack.c (check_asm_stack_operands): Similarly.
* reload.c (find_reloads): Similarly.
* reload1.c (spill_failure, failed_reload): Similarly.
* rtl-error.c (_fatal_insn_not_found): Similarly.
* toplev.c (read_integral_parameter, crash_signal,
decode_f_option, set_target_switch, parse_options_and_default_flags)
: Similarly.
* tradcif.y (parse_number, yylex): Similarly.
* tradcpp.c (main, fancy_abort): Similarly.
* tree.c (tree_check_failed): Similarly.
* varray.c (varray_check_failed): Similarly.
* xcoffout.c (xcoff_output_standard_types): Similarly.
cp:
* call.c (build_java_interface_fn_ref): Similarly.
* except.c (is_admissible_throw_operand): Similarly.
* init.c (build_java_class_ref): Similarly.
* xref.c (open_xref_file): Similarly.
objc:
* objc-act.c (get_object_ref, lookup_and_install_protocols,
build_objc_string_object, objc_declare_alias, build_ivar_chain,
finish_message_expr, build_protocol_expr, is_public,
start_class): Similarly.
testsuite:
* objc.dg/alias.m: Update.
* objc.dg/class-1.m: Update.
* objc.dg/const-str-1.m: Update.
* objc.dg/fwd-proto-1.m: Update.
* objc.dg/id-1.m: Update.
* objc.dg/super-class-1.m: Update.
From-SVN: r47518
2001-12-02 01:04:36 +01:00
|
|
|
fatal ("invalid alternative specified for pattern number %d",
|
1992-05-05 05:06:39 +02:00
|
|
|
insn_index);
|
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* If all alternatives are included, this is true. */
|
1992-05-05 05:06:39 +02:00
|
|
|
i ^= insn_alternatives[insn_code];
|
|
|
|
if (i == 0)
|
|
|
|
return true_rtx;
|
|
|
|
else if ((i & (i - 1)) == 0 && insn_alternatives[insn_code] > 1)
|
|
|
|
{
|
|
|
|
/* If just one excluded, IOR a comparison with that one to the
|
|
|
|
front of the tree. The others will be eliminated by
|
|
|
|
optimization. We do not want to do this if the insn has one
|
|
|
|
alternative and we have tested none of them! */
|
|
|
|
left = make_alternative_compare (i);
|
|
|
|
right = simplify_and_tree (exp, &left, insn_code, insn_index);
|
|
|
|
newexp = attr_rtx (IOR, attr_rtx (NOT, left), right);
|
|
|
|
|
|
|
|
return SIMPLIFY_TEST_EXP (newexp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
|
|
|
|
{
|
|
|
|
newexp = attr_rtx (IOR, left, right);
|
|
|
|
return SIMPLIFY_TEST_EXP (newexp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
case NOT:
|
1992-05-05 00:57:54 +02:00
|
|
|
if (GET_CODE (XEXP (exp, 0)) == NOT)
|
1992-05-07 01:13:18 +02:00
|
|
|
{
|
|
|
|
left = SIMPLIFY_TEST_EXP (XEXP (XEXP (exp, 0), 0),
|
|
|
|
insn_code, insn_index);
|
|
|
|
return left;
|
|
|
|
}
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
left = SIMPLIFY_TEST_EXP (XEXP (exp, 0), insn_code, insn_index);
|
|
|
|
if (GET_CODE (left) == NOT)
|
|
|
|
return XEXP (left, 0);
|
|
|
|
|
|
|
|
if (left == false_rtx)
|
2000-10-13 08:26:46 +02:00
|
|
|
return true_rtx;
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
if (left == true_rtx)
|
2000-10-13 08:26:46 +02:00
|
|
|
return false_rtx;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
if (GET_CODE (left) == EQ_ATTR_ALT)
|
|
|
|
{
|
|
|
|
exp = attr_alt_complement (left);
|
|
|
|
return simplify_test_exp (exp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Try to apply De`Morgan's laws. */
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
if (GET_CODE (left) == IOR)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1992-03-06 23:25:46 +01:00
|
|
|
newexp = attr_rtx (AND,
|
|
|
|
attr_rtx (NOT, XEXP (left, 0)),
|
|
|
|
attr_rtx (NOT, XEXP (left, 1)));
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
newexp = SIMPLIFY_TEST_EXP (newexp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
else if (GET_CODE (left) == AND)
|
|
|
|
{
|
1992-03-06 23:25:46 +01:00
|
|
|
newexp = attr_rtx (IOR,
|
|
|
|
attr_rtx (NOT, XEXP (left, 0)),
|
|
|
|
attr_rtx (NOT, XEXP (left, 1)));
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
newexp = SIMPLIFY_TEST_EXP (newexp, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
else if (left != XEXP (exp, 0))
|
|
|
|
{
|
1992-03-06 23:25:46 +01:00
|
|
|
newexp = attr_rtx (NOT, left);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
case EQ_ATTR_ALT:
|
|
|
|
if (!XINT (exp, 0))
|
|
|
|
return XINT (exp, 1) ? true_rtx : false_rtx;
|
|
|
|
break;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
case EQ_ATTR:
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
if (XSTR (exp, 0) == alternative_name)
|
|
|
|
{
|
|
|
|
newexp = mk_attr_alt (1 << atoi (XSTR (exp, 1)));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Look at the value for this insn code in the specified attribute.
|
|
|
|
We normally can replace this comparison with the condition that
|
2001-10-10 13:33:39 +02:00
|
|
|
would give this insn the values being tested for. */
|
2005-08-05 11:42:06 +02:00
|
|
|
if (insn_code >= 0
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
&& (attr = find_attr (&XSTR (exp, 0), 0)) != NULL)
|
1991-10-24 18:21:48 +01:00
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
for (ie = av->first_insn; ie; ie = ie->next)
|
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
|
|
|
if (ie->def->insn_code == insn_code)
|
2000-12-16 20:00:57 +01:00
|
|
|
{
|
|
|
|
rtx x;
|
|
|
|
x = evaluate_eq_attr (exp, av->value, insn_code, insn_index);
|
|
|
|
x = SIMPLIFY_TEST_EXP (x, insn_code, insn_index);
|
|
|
|
if (attr_rtx_cost(x) < 20)
|
2001-08-14 15:01:20 +02:00
|
|
|
return x;
|
2000-12-16 20:00:57 +01:00
|
|
|
}
|
1997-11-02 22:19:36 +01:00
|
|
|
break;
|
2000-09-12 17:36:21 +02:00
|
|
|
|
1997-11-02 22:19:36 +01:00
|
|
|
default:
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* We have already simplified this expression. Simplifying it again
|
|
|
|
won't buy anything unless we weren't given a valid insn code
|
|
|
|
to process (i.e., we are canonicalizing something.). */
|
2005-08-05 11:42:06 +02:00
|
|
|
if (insn_code != -2
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
&& ! ATTR_IND_SIMPLIFIED_P (newexp))
|
1992-05-07 01:13:18 +02:00
|
|
|
return copy_rtx_unchanging (newexp);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
return newexp;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Optimize the attribute lists by seeing if we can determine conditional
|
|
|
|
values from the known values of other attributes. This will save subroutine
|
|
|
|
calls during the compilation. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
optimize_attrs (void)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_desc *attr;
|
|
|
|
struct attr_value *av;
|
1992-08-17 19:45:19 +02:00
|
|
|
struct insn_ent *ie;
|
1991-10-24 18:21:48 +01:00
|
|
|
rtx newexp;
|
1992-05-06 04:37:42 +02:00
|
|
|
int i;
|
2000-09-12 17:36:21 +02:00
|
|
|
struct attr_value_list
|
|
|
|
{
|
|
|
|
struct attr_value *av;
|
|
|
|
struct insn_ent *ie;
|
|
|
|
struct attr_desc *attr;
|
|
|
|
struct attr_value_list *next;
|
|
|
|
};
|
1992-05-06 04:37:42 +02:00
|
|
|
struct attr_value_list **insn_code_values;
|
1994-10-12 16:31:29 +01:00
|
|
|
struct attr_value_list *ivbuf;
|
1992-05-06 04:37:42 +02:00
|
|
|
struct attr_value_list *iv;
|
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
/* For each insn code, make a list of all the insn_ent's for it,
|
|
|
|
for all values for all attributes. */
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
if (num_insn_ents == 0)
|
|
|
|
return;
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
/* Make 2 extra elements, for "code" values -2 and -1. */
|
|
|
|
insn_code_values = xcalloc ((insn_code_number + 2),
|
|
|
|
sizeof (struct attr_value_list *));
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
/* Offset the table address so we can index by -2 or -1. */
|
|
|
|
insn_code_values += 2;
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
iv = ivbuf = xmalloc (num_insn_ents * sizeof (struct attr_value_list));
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
for (i = 0; i < MAX_ATTRS_INDEX; i++)
|
|
|
|
for (attr = attrs[i]; attr; attr = attr->next)
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
for (ie = av->first_insn; ie; ie = ie->next)
|
|
|
|
{
|
|
|
|
iv->attr = attr;
|
|
|
|
iv->av = av;
|
|
|
|
iv->ie = ie;
|
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
|
|
|
iv->next = insn_code_values[ie->def->insn_code];
|
|
|
|
insn_code_values[ie->def->insn_code] = iv;
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
iv++;
|
|
|
|
}
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
/* Sanity check on num_insn_ents. */
|
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 (iv == ivbuf + num_insn_ents);
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
/* Process one insn code at a time. */
|
|
|
|
for (i = -2; i < insn_code_number; i++)
|
|
|
|
{
|
|
|
|
/* Clear the ATTR_CURR_SIMPLIFIED_P flag everywhere relevant.
|
|
|
|
We use it to mean "already simplified for this insn". */
|
|
|
|
for (iv = insn_code_values[i]; iv; iv = iv->next)
|
|
|
|
clear_struct_flag (iv->av->value);
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
for (iv = insn_code_values[i]; iv; iv = iv->next)
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
{
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
struct obstack *old = rtl_obstack;
|
|
|
|
|
|
|
|
attr = iv->attr;
|
|
|
|
av = iv->av;
|
|
|
|
ie = iv->ie;
|
|
|
|
if (GET_CODE (av->value) != COND)
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
continue;
|
1997-11-02 22:19:36 +01:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
rtl_obstack = temp_obstack;
|
|
|
|
newexp = av->value;
|
|
|
|
while (GET_CODE (newexp) == COND)
|
|
|
|
{
|
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
|
|
|
rtx newexp2 = simplify_cond (newexp, ie->def->insn_code,
|
|
|
|
ie->def->insn_index);
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
if (newexp2 == newexp)
|
|
|
|
break;
|
|
|
|
newexp = newexp2;
|
|
|
|
}
|
|
|
|
|
|
|
|
rtl_obstack = old;
|
|
|
|
if (newexp != av->value)
|
|
|
|
{
|
|
|
|
newexp = attr_copy_rtx (newexp);
|
|
|
|
remove_insn_ent (av, ie);
|
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
|
|
|
av = get_attr_value (newexp, attr, ie->def->insn_code);
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
iv->av = av;
|
|
|
|
insert_insn_ent (av, ie);
|
|
|
|
}
|
|
|
|
}
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
}
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
|
|
|
|
free (ivbuf);
|
|
|
|
free (insn_code_values - 2);
|
(simplify_by_exploding, find_and_mark_used_attributes,
unmark_used_attributes, add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux): New functions.
(struct function_unit): Add max_busy_cost, {min,max}_busy_delay.
(expand_units): Use simplify_by_exploding to simplify the
function_units_used attribute. Compute the ready cost attributes
as a COND in numeric order.
(gen_unit): Compute {min,max}_ready_cost and {min,max}_busy_delay.
(write_function_unit_info): Determine if there is only one busy
delay value by comparing the minimum and maximum busy delay.
Write the initializer for function_units in numeric order.
Write out the maximum busy delay field.
(attr_desc): Add negative_ok field.
(find_attr, make_internal_attr): Initialize negative_ok.
(check_attr_value): Allow negative values for CONST_STRING for
numeric attributes with negative_ok.
(encode_units_mask): Change the encoding of the function_units_used
result.
{....
From-SVN: r1848
1992-08-15 00:53:16 +02:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
/* Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions. */
|
1992-05-06 04:37:42 +02:00
|
|
|
|
1993-04-13 21:46:38 +02:00
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
clear_struct_flag (rtx x)
|
1992-05-06 04:37:42 +02:00
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
int i;
|
|
|
|
int j;
|
|
|
|
enum rtx_code code;
|
|
|
|
const char *fmt;
|
1992-05-06 04:37:42 +02:00
|
|
|
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_CURR_SIMPLIFIED_P (x) = 0;
|
|
|
|
if (ATTR_IND_SIMPLIFIED_P (x))
|
1992-05-06 04:37:42 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
code = GET_CODE (x);
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
case REG:
|
|
|
|
case CONST_INT:
|
|
|
|
case CONST_DOUBLE:
|
2002-02-19 03:53:41 +01:00
|
|
|
case CONST_VECTOR:
|
1992-05-06 04:37:42 +02:00
|
|
|
case SYMBOL_REF:
|
|
|
|
case CODE_LABEL:
|
|
|
|
case PC:
|
|
|
|
case CC0:
|
|
|
|
case EQ_ATTR:
|
1993-03-28 23:23:09 +02:00
|
|
|
case ATTR_FLAG:
|
1992-05-06 04:37:42 +02:00
|
|
|
return;
|
2000-09-12 17:36:21 +02:00
|
|
|
|
1997-11-02 22:19:36 +01:00
|
|
|
default:
|
|
|
|
break;
|
1992-05-06 04:37:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Compare the elements. If any pair of corresponding elements
|
|
|
|
fail to match, return 0 for the whole things. */
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
|
|
|
{
|
|
|
|
switch (fmt[i])
|
|
|
|
{
|
|
|
|
case 'V':
|
|
|
|
case 'E':
|
|
|
|
for (j = 0; j < XVECLEN (x, i); j++)
|
|
|
|
clear_struct_flag (XVECEXP (x, i, j));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'e':
|
|
|
|
clear_struct_flag (XEXP (x, i));
|
|
|
|
break;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
}
|
1992-05-07 01:13:18 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Create table entries for DEFINE_ATTR. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
gen_attr (rtx exp, int lineno)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_desc *attr;
|
|
|
|
struct attr_value *av;
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
const char *name_ptr;
|
1991-10-24 18:21:48 +01:00
|
|
|
char *p;
|
|
|
|
|
|
|
|
/* Make a new attribute structure. Check for duplicate by looking at
|
|
|
|
attr->default_val, since it is initialized by this routine. */
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
attr = find_attr (&XSTR (exp, 0), 1);
|
1991-10-24 18:21:48 +01:00
|
|
|
if (attr->default_val)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (lineno, "duplicate definition for attribute %s",
|
|
|
|
attr->name);
|
|
|
|
message_with_line (attr->lineno, "previous definition");
|
|
|
|
have_error = 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
attr->lineno = lineno;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
if (*XSTR (exp, 1) == '\0')
|
1999-02-21 19:30:37 +01:00
|
|
|
attr->is_numeric = 1;
|
1991-10-24 18:21:48 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
name_ptr = XSTR (exp, 1);
|
|
|
|
while ((p = next_comma_elt (&name_ptr)) != NULL)
|
|
|
|
{
|
2003-07-19 16:47:15 +02:00
|
|
|
av = oballoc (sizeof (struct attr_value));
|
1992-03-06 23:25:46 +01:00
|
|
|
av->value = attr_rtx (CONST_STRING, p);
|
1991-10-24 18:21:48 +01:00
|
|
|
av->next = attr->first_value;
|
|
|
|
attr->first_value = av;
|
|
|
|
av->first_insn = NULL;
|
|
|
|
av->num_insns = 0;
|
|
|
|
av->has_asm_insn = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
if (GET_CODE (XEXP (exp, 2)) == CONST)
|
|
|
|
{
|
|
|
|
attr->is_const = 1;
|
|
|
|
if (attr->is_numeric)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (lineno,
|
|
|
|
"constant attributes may not take numeric values");
|
|
|
|
have_error = 1;
|
|
|
|
}
|
|
|
|
|
1992-03-06 23:25:46 +01:00
|
|
|
/* Get rid of the CONST node. It is allowed only at top-level. */
|
|
|
|
XEXP (exp, 2) = XEXP (XEXP (exp, 2), 0);
|
|
|
|
}
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
if (! strcmp_check (attr->name, length_str) && ! attr->is_numeric)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
2000-09-12 17:36:21 +02:00
|
|
|
message_with_line (lineno,
|
|
|
|
"`length' attribute must take numeric values");
|
2000-07-31 01:38:26 +02:00
|
|
|
have_error = 1;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* Set up the default value. */
|
1992-05-05 23:48:14 +02:00
|
|
|
XEXP (exp, 2) = check_attr_value (XEXP (exp, 2), attr);
|
1991-10-24 18:21:48 +01:00
|
|
|
attr->default_val = get_attr_value (XEXP (exp, 2), attr, -2);
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given a pattern for DEFINE_PEEPHOLE or DEFINE_INSN, return the number of
|
|
|
|
alternatives in the constraints. Assume all MATCH_OPERANDs have the same
|
|
|
|
number of alternatives as this should be checked elsewhere. */
|
|
|
|
|
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
count_alternatives (rtx exp)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
int i, j, n;
|
rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.
* rtl.c (rtx_format): Likewise.
(copy_rtx, copy_most_rtx, read_rtx): Likewise.
(init_rtl): Use accessor macro, not `rtx_format'.
* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
char*.
* caller-save.c (mark_referenced_regs): Likewise.
* combine.c (subst, make_compound_operation, known_cond,
gen_rtx_combine, update_table_tick, get_last_value_validate,
use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.
* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
refers_to_p, canon_reg, fold_rtx, cse_process_notes,
count_reg_usage): Likewise.
* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
dump_edge_info, count_reg_references): Likewise.
* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
Likewise.
* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
add_label_notes): Likewise.
* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
clear_struct_flag, count_sub_rtxs, count_alternatives,
compares_alternatives_p, contained_in_p, walk_attr_value,
write_expr_attr_cache): Likewise.
* genconfig.c (walk_insn_part): Likewise.
* genemit.c (max_operand_1, gen_exp): Likewise.
* genextract.c (walk_rtx): Likewise.
* genflags.c (num_operands): Likewise.
* genoutput.c (scan_operands): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (add_to_sequence): Likewise.
* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
Likewise.
* integrate.c (save_constants, copy_for_inline,
copy_rtx_and_substitute, subst_constants, restore_constants):
Likewise.
* jump.c (mark_jump_label, invert_exp, redirect_exp,
rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.
* local-alloc.c (contains_replace_regs, memref_referenced_p):
Likewise.
* loop.c (record_excess_regs, rtx_equal_for_loop_p,
add_label_notes, replace_call_address, count_nonfixed_reads,
invariant_p, find_single_use_in_loop, find_mem_givs,
find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
Likewise.
* print-rtl.c (reg_names, print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
* reg-stack.c (stack_regs_mentioned_p, record_label_references,
record_reg_life_pat, swap_rtx_condition, goto_block_pat,
print_blocks): Likewise.
* regclass.c (fix_register, record_address_regs,
reg_scan_mark_refs): Likewise.
* regmove.c (stable_but_for_p): Likewise.
* reload.c (loc_mentioned_in_p, operands_match_p,
find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
copy_replacements, refers_to_regno_for_reload_p,
refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
reload_when_needed_name, reg_class_names, debug_reload_to_stream):
Likewise.
* reload1.c (eliminate_regs, scan_paradoxical_subregs,
delete_address_reloads_1, count_occurrences,
reload_cse_mem_conflict_p, reload_combine_note_use,
add_auto_inc_notes): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources):
Likewise.
* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
reg_mentioned_p, regs_set_between_p, modified_between_p,
modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.
* sched.c (sched_analyze_2, attach_deaths): Likewise.
* stupid.c (stupid_mark_refs): Likewise.
* unroll.c (remap_split_bivs): Likewise.
* varasm.c (mark_constants): Likewise.
* a29k/a29k.c (uses_local_reg_p): Likewise.
* alpha/alpha.c (summarize_insn): Likewise.
* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
eliminate_lr2ip): Likewise.
* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.
* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
reg_mentioned_in_mem): Likewise.
* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
symbolic_reference_mentioned_p): Likewise.
* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.
* sh/sh.c (regs_used, mark_use): Likewise.
* vax/vax.c (vax_rtx_cost): Likewise.
From-SVN: r28784
1999-08-21 01:05:25 +02:00
|
|
|
const char *fmt;
|
2000-09-12 17:36:21 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
if (GET_CODE (exp) == MATCH_OPERAND)
|
|
|
|
return n_comma_elts (XSTR (exp, 2));
|
|
|
|
|
|
|
|
for (i = 0, fmt = GET_RTX_FORMAT (GET_CODE (exp));
|
|
|
|
i < GET_RTX_LENGTH (GET_CODE (exp)); i++)
|
|
|
|
switch (*fmt++)
|
|
|
|
{
|
|
|
|
case 'e':
|
|
|
|
case 'u':
|
|
|
|
n = count_alternatives (XEXP (exp, i));
|
|
|
|
if (n)
|
|
|
|
return n;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
case 'V':
|
|
|
|
if (XVEC (exp, i) != NULL)
|
|
|
|
for (j = 0; j < XVECLEN (exp, i); j++)
|
|
|
|
{
|
|
|
|
n = count_alternatives (XVECEXP (exp, i, j));
|
|
|
|
if (n)
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-09-22 16:09:34 +02:00
|
|
|
/* Returns nonzero if the given expression contains an EQ_ATTR with the
|
1991-10-24 18:21:48 +01:00
|
|
|
`alternative' attribute. */
|
|
|
|
|
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
compares_alternatives_p (rtx exp)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
int i, j;
|
rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.
* rtl.c (rtx_format): Likewise.
(copy_rtx, copy_most_rtx, read_rtx): Likewise.
(init_rtl): Use accessor macro, not `rtx_format'.
* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
char*.
* caller-save.c (mark_referenced_regs): Likewise.
* combine.c (subst, make_compound_operation, known_cond,
gen_rtx_combine, update_table_tick, get_last_value_validate,
use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.
* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
refers_to_p, canon_reg, fold_rtx, cse_process_notes,
count_reg_usage): Likewise.
* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
dump_edge_info, count_reg_references): Likewise.
* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
Likewise.
* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
add_label_notes): Likewise.
* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
clear_struct_flag, count_sub_rtxs, count_alternatives,
compares_alternatives_p, contained_in_p, walk_attr_value,
write_expr_attr_cache): Likewise.
* genconfig.c (walk_insn_part): Likewise.
* genemit.c (max_operand_1, gen_exp): Likewise.
* genextract.c (walk_rtx): Likewise.
* genflags.c (num_operands): Likewise.
* genoutput.c (scan_operands): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (add_to_sequence): Likewise.
* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
Likewise.
* integrate.c (save_constants, copy_for_inline,
copy_rtx_and_substitute, subst_constants, restore_constants):
Likewise.
* jump.c (mark_jump_label, invert_exp, redirect_exp,
rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.
* local-alloc.c (contains_replace_regs, memref_referenced_p):
Likewise.
* loop.c (record_excess_regs, rtx_equal_for_loop_p,
add_label_notes, replace_call_address, count_nonfixed_reads,
invariant_p, find_single_use_in_loop, find_mem_givs,
find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
Likewise.
* print-rtl.c (reg_names, print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
* reg-stack.c (stack_regs_mentioned_p, record_label_references,
record_reg_life_pat, swap_rtx_condition, goto_block_pat,
print_blocks): Likewise.
* regclass.c (fix_register, record_address_regs,
reg_scan_mark_refs): Likewise.
* regmove.c (stable_but_for_p): Likewise.
* reload.c (loc_mentioned_in_p, operands_match_p,
find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
copy_replacements, refers_to_regno_for_reload_p,
refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
reload_when_needed_name, reg_class_names, debug_reload_to_stream):
Likewise.
* reload1.c (eliminate_regs, scan_paradoxical_subregs,
delete_address_reloads_1, count_occurrences,
reload_cse_mem_conflict_p, reload_combine_note_use,
add_auto_inc_notes): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources):
Likewise.
* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
reg_mentioned_p, regs_set_between_p, modified_between_p,
modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.
* sched.c (sched_analyze_2, attach_deaths): Likewise.
* stupid.c (stupid_mark_refs): Likewise.
* unroll.c (remap_split_bivs): Likewise.
* varasm.c (mark_constants): Likewise.
* a29k/a29k.c (uses_local_reg_p): Likewise.
* alpha/alpha.c (summarize_insn): Likewise.
* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
eliminate_lr2ip): Likewise.
* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.
* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
reg_mentioned_in_mem): Likewise.
* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
symbolic_reference_mentioned_p): Likewise.
* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.
* sh/sh.c (regs_used, mark_use): Likewise.
* vax/vax.c (vax_rtx_cost): Likewise.
From-SVN: r28784
1999-08-21 01:05:25 +02:00
|
|
|
const char *fmt;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
if (GET_CODE (exp) == EQ_ATTR && XSTR (exp, 0) == alternative_name)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
for (i = 0, fmt = GET_RTX_FORMAT (GET_CODE (exp));
|
|
|
|
i < GET_RTX_LENGTH (GET_CODE (exp)); i++)
|
|
|
|
switch (*fmt++)
|
|
|
|
{
|
|
|
|
case 'e':
|
|
|
|
case 'u':
|
|
|
|
if (compares_alternatives_p (XEXP (exp, i)))
|
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
for (j = 0; j < XVECLEN (exp, i); j++)
|
|
|
|
if (compares_alternatives_p (XVECEXP (exp, i, j)))
|
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-09-22 16:09:34 +02:00
|
|
|
/* Returns nonzero is INNER is contained in EXP. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
contained_in_p (rtx inner, rtx exp)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
int i, j;
|
rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.
* rtl.c (rtx_format): Likewise.
(copy_rtx, copy_most_rtx, read_rtx): Likewise.
(init_rtl): Use accessor macro, not `rtx_format'.
* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
char*.
* caller-save.c (mark_referenced_regs): Likewise.
* combine.c (subst, make_compound_operation, known_cond,
gen_rtx_combine, update_table_tick, get_last_value_validate,
use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.
* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
refers_to_p, canon_reg, fold_rtx, cse_process_notes,
count_reg_usage): Likewise.
* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
dump_edge_info, count_reg_references): Likewise.
* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
Likewise.
* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
add_label_notes): Likewise.
* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
clear_struct_flag, count_sub_rtxs, count_alternatives,
compares_alternatives_p, contained_in_p, walk_attr_value,
write_expr_attr_cache): Likewise.
* genconfig.c (walk_insn_part): Likewise.
* genemit.c (max_operand_1, gen_exp): Likewise.
* genextract.c (walk_rtx): Likewise.
* genflags.c (num_operands): Likewise.
* genoutput.c (scan_operands): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (add_to_sequence): Likewise.
* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
Likewise.
* integrate.c (save_constants, copy_for_inline,
copy_rtx_and_substitute, subst_constants, restore_constants):
Likewise.
* jump.c (mark_jump_label, invert_exp, redirect_exp,
rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.
* local-alloc.c (contains_replace_regs, memref_referenced_p):
Likewise.
* loop.c (record_excess_regs, rtx_equal_for_loop_p,
add_label_notes, replace_call_address, count_nonfixed_reads,
invariant_p, find_single_use_in_loop, find_mem_givs,
find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
Likewise.
* print-rtl.c (reg_names, print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
* reg-stack.c (stack_regs_mentioned_p, record_label_references,
record_reg_life_pat, swap_rtx_condition, goto_block_pat,
print_blocks): Likewise.
* regclass.c (fix_register, record_address_regs,
reg_scan_mark_refs): Likewise.
* regmove.c (stable_but_for_p): Likewise.
* reload.c (loc_mentioned_in_p, operands_match_p,
find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
copy_replacements, refers_to_regno_for_reload_p,
refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
reload_when_needed_name, reg_class_names, debug_reload_to_stream):
Likewise.
* reload1.c (eliminate_regs, scan_paradoxical_subregs,
delete_address_reloads_1, count_occurrences,
reload_cse_mem_conflict_p, reload_combine_note_use,
add_auto_inc_notes): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources):
Likewise.
* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
reg_mentioned_p, regs_set_between_p, modified_between_p,
modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.
* sched.c (sched_analyze_2, attach_deaths): Likewise.
* stupid.c (stupid_mark_refs): Likewise.
* unroll.c (remap_split_bivs): Likewise.
* varasm.c (mark_constants): Likewise.
* a29k/a29k.c (uses_local_reg_p): Likewise.
* alpha/alpha.c (summarize_insn): Likewise.
* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
eliminate_lr2ip): Likewise.
* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.
* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
reg_mentioned_in_mem): Likewise.
* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
symbolic_reference_mentioned_p): Likewise.
* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.
* sh/sh.c (regs_used, mark_use): Likewise.
* vax/vax.c (vax_rtx_cost): Likewise.
From-SVN: r28784
1999-08-21 01:05:25 +02:00
|
|
|
const char *fmt;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
if (rtx_equal_p (inner, exp))
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
for (i = 0, fmt = GET_RTX_FORMAT (GET_CODE (exp));
|
|
|
|
i < GET_RTX_LENGTH (GET_CODE (exp)); i++)
|
|
|
|
switch (*fmt++)
|
|
|
|
{
|
|
|
|
case 'e':
|
|
|
|
case 'u':
|
|
|
|
if (contained_in_p (inner, XEXP (exp, i)))
|
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
for (j = 0; j < XVECLEN (exp, i); j++)
|
|
|
|
if (contained_in_p (inner, XVECEXP (exp, i, j)))
|
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Process DEFINE_PEEPHOLE, DEFINE_INSN, and DEFINE_ASM_ATTRIBUTES. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
gen_insn (rtx exp, int lineno)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct insn_def *id;
|
|
|
|
|
2003-07-19 16:47:15 +02:00
|
|
|
id = oballoc (sizeof (struct insn_def));
|
1991-10-24 18:21:48 +01:00
|
|
|
id->next = defs;
|
|
|
|
defs = id;
|
|
|
|
id->def = exp;
|
2000-07-31 01:38:26 +02:00
|
|
|
id->lineno = lineno;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
switch (GET_CODE (exp))
|
|
|
|
{
|
|
|
|
case DEFINE_INSN:
|
2000-05-03 19:45:26 +02:00
|
|
|
id->insn_code = insn_code_number;
|
|
|
|
id->insn_index = insn_index_number;
|
1991-10-24 18:21:48 +01:00
|
|
|
id->num_alternatives = count_alternatives (exp);
|
|
|
|
if (id->num_alternatives == 0)
|
|
|
|
id->num_alternatives = 1;
|
|
|
|
id->vec_idx = 4;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DEFINE_PEEPHOLE:
|
2000-05-03 19:45:26 +02:00
|
|
|
id->insn_code = insn_code_number;
|
|
|
|
id->insn_index = insn_index_number;
|
1991-10-24 18:21:48 +01:00
|
|
|
id->num_alternatives = count_alternatives (exp);
|
|
|
|
if (id->num_alternatives == 0)
|
|
|
|
id->num_alternatives = 1;
|
|
|
|
id->vec_idx = 3;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DEFINE_ASM_ATTRIBUTES:
|
|
|
|
id->insn_code = -1;
|
|
|
|
id->insn_index = -1;
|
|
|
|
id->num_alternatives = 1;
|
|
|
|
id->vec_idx = 0;
|
|
|
|
got_define_asm_attributes = 1;
|
|
|
|
break;
|
2000-09-12 17:36:21 +02:00
|
|
|
|
1997-11-02 22:19:36 +01: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-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Process a DEFINE_DELAY. Validate the vector length, check if annul
|
|
|
|
true or annul false is specified, and make a `struct delay_desc'. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
gen_delay (rtx def, int lineno)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct delay_desc *delay;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (XVECLEN (def, 1) % 3 != 0)
|
2000-07-31 01:38:26 +02:00
|
|
|
{
|
|
|
|
message_with_line (lineno,
|
2000-09-12 17:36:21 +02:00
|
|
|
"number of elements in DEFINE_DELAY must be multiple of three");
|
2000-07-31 01:38:26 +02:00
|
|
|
have_error = 1;
|
|
|
|
return;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (def, 1); i += 3)
|
|
|
|
{
|
|
|
|
if (XVECEXP (def, 1, i + 1))
|
|
|
|
have_annul_true = 1;
|
|
|
|
if (XVECEXP (def, 1, i + 2))
|
|
|
|
have_annul_false = 1;
|
|
|
|
}
|
2000-09-12 17:36:21 +02:00
|
|
|
|
2003-07-19 16:47:15 +02:00
|
|
|
delay = oballoc (sizeof (struct delay_desc));
|
1991-10-24 18:21:48 +01:00
|
|
|
delay->def = def;
|
|
|
|
delay->num = ++num_delays;
|
|
|
|
delay->next = delays;
|
2000-07-31 01:38:26 +02:00
|
|
|
delay->lineno = lineno;
|
1991-10-24 18:21:48 +01:00
|
|
|
delays = delay;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1998-06-29 23:40:49 +02:00
|
|
|
/* Given a piece of RTX, print a C expression to test its truth value.
|
2000-09-12 17:36:21 +02:00
|
|
|
We use AND and IOR both for logical and bit-wise operations, so
|
1991-10-24 18:21:48 +01:00
|
|
|
interpret them as logical unless they are inside a comparison expression.
|
2002-09-22 16:09:34 +02:00
|
|
|
The first bit of FLAGS will be nonzero in that case.
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
|
|
|
|
Set the second bit of FLAGS to make references to attribute values use
|
|
|
|
a cached local variable instead of calling a function. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_test_expr (rtx exp, int flags)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
int comparison_operator = 0;
|
|
|
|
RTX_CODE code;
|
|
|
|
struct attr_desc *attr;
|
|
|
|
|
|
|
|
/* In order not to worry about operator precedence, surround our part of
|
|
|
|
the expression with parentheses. */
|
|
|
|
|
|
|
|
printf ("(");
|
|
|
|
code = GET_CODE (exp);
|
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
/* Binary operators. */
|
2004-06-26 07:25:38 +02:00
|
|
|
case GEU: case GTU:
|
|
|
|
case LEU: case LTU:
|
|
|
|
printf ("(unsigned) ");
|
|
|
|
/* Fall through. */
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
case EQ: case NE:
|
2004-06-26 07:25:38 +02:00
|
|
|
case GE: case GT:
|
|
|
|
case LE: case LT:
|
1991-10-24 18:21:48 +01:00
|
|
|
comparison_operator = 1;
|
|
|
|
|
|
|
|
case PLUS: case MINUS: case MULT: case DIV: case MOD:
|
|
|
|
case AND: case IOR: case XOR:
|
1994-04-10 14:03:37 +02:00
|
|
|
case ASHIFT: case LSHIFTRT: case ASHIFTRT:
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
write_test_expr (XEXP (exp, 0), flags | comparison_operator);
|
1991-10-24 18:21:48 +01:00
|
|
|
switch (code)
|
2000-09-12 17:36:21 +02:00
|
|
|
{
|
1991-10-24 18:21:48 +01:00
|
|
|
case EQ:
|
|
|
|
printf (" == ");
|
|
|
|
break;
|
|
|
|
case NE:
|
|
|
|
printf (" != ");
|
|
|
|
break;
|
|
|
|
case GE:
|
|
|
|
printf (" >= ");
|
|
|
|
break;
|
|
|
|
case GT:
|
|
|
|
printf (" > ");
|
|
|
|
break;
|
|
|
|
case GEU:
|
|
|
|
printf (" >= (unsigned) ");
|
|
|
|
break;
|
|
|
|
case GTU:
|
|
|
|
printf (" > (unsigned) ");
|
|
|
|
break;
|
|
|
|
case LE:
|
|
|
|
printf (" <= ");
|
|
|
|
break;
|
|
|
|
case LT:
|
|
|
|
printf (" < ");
|
|
|
|
break;
|
|
|
|
case LEU:
|
|
|
|
printf (" <= (unsigned) ");
|
|
|
|
break;
|
|
|
|
case LTU:
|
|
|
|
printf (" < (unsigned) ");
|
|
|
|
break;
|
|
|
|
case PLUS:
|
|
|
|
printf (" + ");
|
|
|
|
break;
|
|
|
|
case MINUS:
|
|
|
|
printf (" - ");
|
|
|
|
break;
|
|
|
|
case MULT:
|
|
|
|
printf (" * ");
|
|
|
|
break;
|
|
|
|
case DIV:
|
|
|
|
printf (" / ");
|
|
|
|
break;
|
|
|
|
case MOD:
|
1992-03-03 14:06:22 +01:00
|
|
|
printf (" %% ");
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
case AND:
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
if (flags & 1)
|
1991-10-24 18:21:48 +01:00
|
|
|
printf (" & ");
|
|
|
|
else
|
|
|
|
printf (" && ");
|
|
|
|
break;
|
|
|
|
case IOR:
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
if (flags & 1)
|
1991-10-24 18:21:48 +01:00
|
|
|
printf (" | ");
|
|
|
|
else
|
|
|
|
printf (" || ");
|
|
|
|
break;
|
|
|
|
case XOR:
|
|
|
|
printf (" ^ ");
|
|
|
|
break;
|
|
|
|
case ASHIFT:
|
|
|
|
printf (" << ");
|
|
|
|
break;
|
|
|
|
case LSHIFTRT:
|
|
|
|
case ASHIFTRT:
|
|
|
|
printf (" >> ");
|
|
|
|
break;
|
1997-11-02 22:19:36 +01: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 ();
|
2000-09-12 17:36:21 +02:00
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
write_test_expr (XEXP (exp, 1), flags | comparison_operator);
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case NOT:
|
|
|
|
/* Special-case (not (eq_attrq "alternative" "x")) */
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
if (! (flags & 1) && GET_CODE (XEXP (exp, 0)) == EQ_ATTR
|
1991-10-24 18:21:48 +01:00
|
|
|
&& XSTR (XEXP (exp, 0), 0) == alternative_name)
|
|
|
|
{
|
|
|
|
printf ("which_alternative != %s", XSTR (XEXP (exp, 0), 1));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Otherwise, fall through to normal unary operator. */
|
|
|
|
|
2000-09-12 17:36:21 +02:00
|
|
|
/* Unary operators. */
|
1991-10-24 18:21:48 +01:00
|
|
|
case ABS: case NEG:
|
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
case NOT:
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
if (flags & 1)
|
1991-10-24 18:21:48 +01:00
|
|
|
printf ("~ ");
|
|
|
|
else
|
|
|
|
printf ("! ");
|
|
|
|
break;
|
|
|
|
case ABS:
|
|
|
|
printf ("abs ");
|
|
|
|
break;
|
|
|
|
case NEG:
|
|
|
|
printf ("-");
|
|
|
|
break;
|
1997-11-02 22:19:36 +01: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-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
write_test_expr (XEXP (exp, 0), flags);
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
case EQ_ATTR_ALT:
|
|
|
|
{
|
|
|
|
int set = XINT (exp, 0), bit = 0;
|
|
|
|
|
|
|
|
if (flags & 1)
|
|
|
|
fatal ("EQ_ATTR_ALT not valid inside comparison");
|
|
|
|
|
|
|
|
if (!set)
|
|
|
|
fatal ("Empty EQ_ATTR_ALT should be optimized out");
|
|
|
|
|
|
|
|
if (!(set & (set - 1)))
|
|
|
|
{
|
|
|
|
if (!(set & 0xffff))
|
|
|
|
{
|
|
|
|
bit += 16;
|
|
|
|
set >>= 16;
|
|
|
|
}
|
|
|
|
if (!(set & 0xff))
|
|
|
|
{
|
|
|
|
bit += 8;
|
|
|
|
set >>= 8;
|
|
|
|
}
|
|
|
|
if (!(set & 0xf))
|
|
|
|
{
|
|
|
|
bit += 4;
|
|
|
|
set >>= 4;
|
|
|
|
}
|
|
|
|
if (!(set & 0x3))
|
|
|
|
{
|
|
|
|
bit += 2;
|
|
|
|
set >>= 2;
|
|
|
|
}
|
|
|
|
if (!(set & 1))
|
|
|
|
bit++;
|
|
|
|
|
|
|
|
printf ("which_alternative %s= %d",
|
|
|
|
XINT (exp, 1) ? "!" : "=", bit);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
printf ("%s((1 << which_alternative) & 0x%x)",
|
|
|
|
XINT (exp, 1) ? "!" : "", set);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Comparison test of an attribute with a value. Most of these will
|
|
|
|
have been removed by optimization. Handle "alternative"
|
|
|
|
specially and give error if EQ_ATTR present inside a comparison. */
|
|
|
|
case EQ_ATTR:
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
if (flags & 1)
|
1991-10-24 18:21:48 +01:00
|
|
|
fatal ("EQ_ATTR not valid inside comparison");
|
|
|
|
|
|
|
|
if (XSTR (exp, 0) == alternative_name)
|
|
|
|
{
|
|
|
|
printf ("which_alternative == %s", XSTR (exp, 1));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
attr = find_attr (&XSTR (exp, 0), 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 (attr);
|
1992-05-07 22:01:01 +02:00
|
|
|
|
|
|
|
/* Now is the time to expand the value of a constant attribute. */
|
|
|
|
if (attr->is_const)
|
|
|
|
{
|
|
|
|
write_test_expr (evaluate_eq_attr (exp, attr->default_val->value,
|
1993-03-06 23:52:30 +01:00
|
|
|
-2, -2),
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
flags);
|
1992-05-07 22:01:01 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
if (flags & 2)
|
|
|
|
printf ("attr_%s", attr->name);
|
|
|
|
else
|
|
|
|
printf ("get_attr_%s (insn)", attr->name);
|
|
|
|
printf (" == ");
|
|
|
|
write_attr_valueq (attr, XSTR (exp, 1));
|
1992-05-07 22:01:01 +02:00
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
1993-03-28 23:23:09 +02:00
|
|
|
/* Comparison test of flags for define_delays. */
|
|
|
|
case ATTR_FLAG:
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
if (flags & 1)
|
1993-03-28 23:23:09 +02:00
|
|
|
fatal ("ATTR_FLAG not valid inside comparison");
|
|
|
|
printf ("(flags & ATTR_FLAG_%s) != 0", XSTR (exp, 0));
|
|
|
|
break;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* See if an operand matches a predicate. */
|
|
|
|
case MATCH_OPERAND:
|
|
|
|
/* If only a mode is given, just ensure the mode matches the operand.
|
|
|
|
If neither a mode nor predicate is given, error. */
|
2000-09-12 17:36:21 +02:00
|
|
|
if (XSTR (exp, 1) == NULL || *XSTR (exp, 1) == '\0')
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
if (GET_MODE (exp) == VOIDmode)
|
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading
capital from diagnostics.
* c-lex.c (cb_file_change): Similarly.
* c-parse.in : Similarly.
* cfgrtl.c (verify_flow_info): Similarly.
* collect2.c: Similarly.
* cppfiles.c (find_include_file): Similarly.
* cppinit.c (cpp_handle_option): Similarly.
* cpplex.c (cpp_spell_token): Similarly.
* cppmain.c (do_preprocessing): Similarly.
* gcc.c (translate_options, process_command, do_spec1,
main, pfatal_execute): Similarly.
* genattr.c (main): Similarly.
* genattrtab.c (check_attr_test, operate_exp, simplify_test_exp,
write_test_expr, main): Similarly.
* gencodes.c (main): Similarly.
* genconfig.c (main): Similarly.
* genconstants.c (main): Similarly.
* genemit.c (main): Similarly.
* genextract.c (main): Similarly.
* genflags.c (main): Similarly.
* genopinit.c (main): Similarly.
* genoutput.c (process_template, main): Similarly.
* genpeep.c (main): Similarly.
* genrecog.c (main): Similarly.
* gensupport.c (is_predicable, identify_predicable_attribute,
alter_predicate_for_insn, init_md_reader_args, main): Similarly.
* ggc-page.c (alloc_anon): Similarly.
* mips-tfile.c (add_string, add_procedure, add_file, read_line,
parse_begin, parse_bend, parse_def, parse_end, parse_file,
parse_stabs_common, parse_stabs, write_varray, write_object,
read_seek, copy_object, main, error): Similarly.
* profile.c (compute_branch_probabilities): Similarly.
* reg-stack.c (check_asm_stack_operands): Similarly.
* reload.c (find_reloads): Similarly.
* reload1.c (spill_failure, failed_reload): Similarly.
* rtl-error.c (_fatal_insn_not_found): Similarly.
* toplev.c (read_integral_parameter, crash_signal,
decode_f_option, set_target_switch, parse_options_and_default_flags)
: Similarly.
* tradcif.y (parse_number, yylex): Similarly.
* tradcpp.c (main, fancy_abort): Similarly.
* tree.c (tree_check_failed): Similarly.
* varray.c (varray_check_failed): Similarly.
* xcoffout.c (xcoff_output_standard_types): Similarly.
cp:
* call.c (build_java_interface_fn_ref): Similarly.
* except.c (is_admissible_throw_operand): Similarly.
* init.c (build_java_class_ref): Similarly.
* xref.c (open_xref_file): Similarly.
objc:
* objc-act.c (get_object_ref, lookup_and_install_protocols,
build_objc_string_object, objc_declare_alias, build_ivar_chain,
finish_message_expr, build_protocol_expr, is_public,
start_class): Similarly.
testsuite:
* objc.dg/alias.m: Update.
* objc.dg/class-1.m: Update.
* objc.dg/const-str-1.m: Update.
* objc.dg/fwd-proto-1.m: Update.
* objc.dg/id-1.m: Update.
* objc.dg/super-class-1.m: Update.
From-SVN: r47518
2001-12-02 01:04:36 +01:00
|
|
|
fatal ("null MATCH_OPERAND specified as test");
|
1991-10-24 18:21:48 +01:00
|
|
|
else
|
|
|
|
printf ("GET_MODE (operands[%d]) == %smode",
|
|
|
|
XINT (exp, 0), GET_MODE_NAME (GET_MODE (exp)));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
printf ("%s (operands[%d], %smode)",
|
|
|
|
XSTR (exp, 1), XINT (exp, 0), GET_MODE_NAME (GET_MODE (exp)));
|
|
|
|
break;
|
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* Constant integer. */
|
1991-10-24 18:21:48 +01:00
|
|
|
case CONST_INT:
|
1998-01-29 00:25:15 +01:00
|
|
|
printf (HOST_WIDE_INT_PRINT_DEC, XWINT (exp, 0));
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* A random C expression. */
|
1991-10-24 18:21:48 +01:00
|
|
|
case SYMBOL_REF:
|
* 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 (XSTR (exp, 0));
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* The address of the branch target. */
|
|
|
|
case MATCH_DUP:
|
2000-07-31 01:38:26 +02:00
|
|
|
printf ("INSN_ADDRESSES_SET_P () ? INSN_ADDRESSES (INSN_UID (GET_CODE (operands[%d]) == LABEL_REF ? XEXP (operands[%d], 0) : operands[%d])) : 0",
|
1996-08-15 21:05:21 +02:00
|
|
|
XINT (exp, 0), XINT (exp, 0), XINT (exp, 0));
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PC:
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
/* The address of the current insn. We implement this actually as the
|
|
|
|
address of the current insn for backward branches, but the last
|
|
|
|
address of the next insn for forward branches, and both with
|
|
|
|
adjustments that account for the worst-case possible stretching of
|
|
|
|
intervening alignments between this insn and its destination. */
|
2000-09-12 17:36:21 +02:00
|
|
|
printf ("insn_current_reference_address (insn)");
|
1991-10-24 18:21:48 +01:00
|
|
|
break;
|
|
|
|
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
case CONST_STRING:
|
|
|
|
printf ("%s", XSTR (exp, 0));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IF_THEN_ELSE:
|
|
|
|
write_test_expr (XEXP (exp, 0), flags & 2);
|
|
|
|
printf (" ? ");
|
|
|
|
write_test_expr (XEXP (exp, 1), flags | 1);
|
|
|
|
printf (" : ");
|
|
|
|
write_test_expr (XEXP (exp, 2), flags | 1);
|
|
|
|
break;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
default:
|
|
|
|
fatal ("bad RTX code `%s' in attribute calculation\n",
|
|
|
|
GET_RTX_NAME (code));
|
|
|
|
}
|
|
|
|
|
|
|
|
printf (")");
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given an attribute value, return the maximum CONST_STRING argument
|
1999-02-21 19:30:37 +01:00
|
|
|
encountered. Set *UNKNOWNP and return INT_MAX if the value is unknown. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
max_attr_value (rtx exp, int *unknownp)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1999-02-21 19:30:37 +01:00
|
|
|
int current_max;
|
|
|
|
int i, n;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
switch (GET_CODE (exp))
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1999-02-21 19:30:37 +01:00
|
|
|
case CONST_STRING:
|
|
|
|
current_max = atoi (XSTR (exp, 0));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case COND:
|
|
|
|
current_max = max_attr_value (XEXP (exp, 1), unknownp);
|
1991-10-24 18:21:48 +01:00
|
|
|
for (i = 0; i < XVECLEN (exp, 0); i += 2)
|
|
|
|
{
|
1999-02-21 19:30:37 +01:00
|
|
|
n = max_attr_value (XVECEXP (exp, 0, i + 1), unknownp);
|
1991-10-24 18:21:48 +01:00
|
|
|
if (n > current_max)
|
|
|
|
current_max = n;
|
|
|
|
}
|
1999-02-21 19:30:37 +01:00
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
case IF_THEN_ELSE:
|
|
|
|
current_max = max_attr_value (XEXP (exp, 1), unknownp);
|
|
|
|
n = max_attr_value (XEXP (exp, 2), unknownp);
|
1991-10-24 18:21:48 +01:00
|
|
|
if (n > current_max)
|
|
|
|
current_max = n;
|
1999-02-21 19:30:37 +01:00
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
default:
|
|
|
|
*unknownp = 1;
|
|
|
|
current_max = INT_MAX;
|
|
|
|
break;
|
(struct attr_desc): Add unsigned_p field.
(struct function_unit_op): Add issue_delay, conflict_exp, and
issue_exp fields. Drop busyexp field.
(struct function_unit): Add needs_blockage_function,
needs_range_function, issue_delay, and max_blockage fields. Drop
costexp, and busy delay fields.
(enum operator): Add POS_MINUS_OP, EQ_OP, MIN_OP, RANGE_OP.
(operate_exp): Implement new ops.
(make_internal_attr): Set unsigned_p based on the value of SPECIAL.
(write_attr_get): Function is unsigned when unsigned_p is true.
(write_attr_valueq): Write hex value of large constants in a comment.
(simplify_by_exploding): Check for EXP having no EQ_ATTR expressions
and for all values as the default.
(find_and_mark_used_attributes): Add TERMS and NTERMS parameters.
(max_attr_value): Allow IF_THEN_ELSE.
(simplify_knowing, write_complex_function, extend_range): New
functions.
(gen_unit): Use local variables to name the fields. Change the
meaning of busy-delay to issue-delay.
(expand_units): Compute issue_exp. Write attributes for computing
`<name>_unit_blockage' and `<name>_unit_blockage_range' functions.
Compute max_blockage, and the needs_*_function values.
(write_function_unit_info): Write blockage function and conflict cost
functions using write_complex_function. Write new function_unit_desc
fields.
(expand_units): Use the normalized values of the
unit's CONDEXP and BUSYEXP.
From-SVN: r1952
1992-08-25 22:26:02 +02:00
|
|
|
}
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
return current_max;
|
|
|
|
}
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
|
|
|
|
/* Given an attribute value, return the result of ORing together all
|
1999-02-21 19:30:37 +01:00
|
|
|
CONST_STRING arguments encountered. Set *UNKNOWNP and return -1
|
|
|
|
if the numeric value is not known. */
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
|
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
or_attr_value (rtx exp, int *unknownp)
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
{
|
1999-02-21 19:30:37 +01:00
|
|
|
int current_or;
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
int i;
|
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
switch (GET_CODE (exp))
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
{
|
1999-02-21 19:30:37 +01:00
|
|
|
case CONST_STRING:
|
|
|
|
current_or = atoi (XSTR (exp, 0));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case COND:
|
|
|
|
current_or = or_attr_value (XEXP (exp, 1), unknownp);
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
for (i = 0; i < XVECLEN (exp, 0); i += 2)
|
1999-02-21 19:30:37 +01:00
|
|
|
current_or |= or_attr_value (XVECEXP (exp, 0, i + 1), unknownp);
|
|
|
|
break;
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
case IF_THEN_ELSE:
|
|
|
|
current_or = or_attr_value (XEXP (exp, 1), unknownp);
|
|
|
|
current_or |= or_attr_value (XEXP (exp, 2), unknownp);
|
|
|
|
break;
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
default:
|
|
|
|
*unknownp = 1;
|
|
|
|
current_or = -1;
|
|
|
|
break;
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return current_or;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Scan an attribute value, possibly a conditional, and record what actions
|
|
|
|
will be required to do any conditional tests in it.
|
|
|
|
|
|
|
|
Specifically, set
|
|
|
|
`must_extract' if we need to extract the insn operands
|
|
|
|
`must_constrain' if we must compute `which_alternative'
|
|
|
|
`address_used' if an address expression was used
|
1992-09-24 13:28:09 +02:00
|
|
|
`length_used' if an (eq_attr "length" ...) was used
|
1991-10-24 18:21:48 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
walk_attr_value (rtx exp)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
int i, j;
|
|
|
|
const char *fmt;
|
1991-10-24 18:21:48 +01:00
|
|
|
RTX_CODE code;
|
|
|
|
|
|
|
|
if (exp == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
code = GET_CODE (exp);
|
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
case SYMBOL_REF:
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (! ATTR_IND_SIMPLIFIED_P (exp))
|
1992-03-06 23:25:46 +01:00
|
|
|
/* Since this is an arbitrary expression, it can look at anything.
|
|
|
|
However, constant expressions do not depend on any particular
|
|
|
|
insn. */
|
|
|
|
must_extract = must_constrain = 1;
|
1991-10-24 18:21:48 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
case MATCH_OPERAND:
|
|
|
|
must_extract = 1;
|
|
|
|
return;
|
|
|
|
|
genattrtab.c (simplify_cond): Update indices correctly.
* genattrtab.c (simplify_cond): Update indices correctly.
(attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
(check_attr_test, encode_units_mask, compute_alternative_mask,
make_alternative_compare, simplify_and_tree,
attr_rtx_cost, simplify_test_exp, gen_attr,
write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
* rtl.def (EQ_ATTR_ALT): New.
From-SVN: r73873
2003-11-24 15:14:11 +01:00
|
|
|
case EQ_ATTR_ALT:
|
|
|
|
must_extract = must_constrain = 1;
|
|
|
|
break;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
case EQ_ATTR:
|
|
|
|
if (XSTR (exp, 0) == alternative_name)
|
|
|
|
must_extract = must_constrain = 1;
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
else if (strcmp_check (XSTR (exp, 0), length_str) == 0)
|
1992-09-24 13:28:09 +02:00
|
|
|
length_used = 1;
|
1991-10-24 18:21:48 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
case MATCH_DUP:
|
1995-05-12 13:13:25 +02:00
|
|
|
must_extract = 1;
|
|
|
|
address_used = 1;
|
|
|
|
return;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
case PC:
|
|
|
|
address_used = 1;
|
|
|
|
return;
|
1993-03-28 23:23:09 +02:00
|
|
|
|
|
|
|
case ATTR_FLAG:
|
|
|
|
return;
|
1997-11-02 22:19:36 +01:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0, fmt = GET_RTX_FORMAT (code); i < GET_RTX_LENGTH (code); i++)
|
|
|
|
switch (*fmt++)
|
|
|
|
{
|
|
|
|
case 'e':
|
|
|
|
case 'u':
|
|
|
|
walk_attr_value (XEXP (exp, i));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
if (XVEC (exp, i) != NULL)
|
|
|
|
for (j = 0; j < XVECLEN (exp, i); j++)
|
|
|
|
walk_attr_value (XVECEXP (exp, i, j));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Write out a function to obtain the attribute for a given INSN. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_attr_get (struct attr_desc *attr)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_value *av, *common_av;
|
|
|
|
|
|
|
|
/* Find the most used attribute value. Handle that as the `default' of the
|
1996-07-04 00:07:53 +02:00
|
|
|
switch we will generate. */
|
1991-10-24 18:21:48 +01:00
|
|
|
common_av = find_most_used (attr);
|
|
|
|
|
|
|
|
/* Write out start of function, then all values with explicit `case' lines,
|
|
|
|
then a `default', then the value with the most uses. */
|
2003-07-09 02:44:34 +02:00
|
|
|
if (attr->static_p)
|
|
|
|
printf ("static ");
|
(struct attr_desc): Add unsigned_p field.
(struct function_unit_op): Add issue_delay, conflict_exp, and
issue_exp fields. Drop busyexp field.
(struct function_unit): Add needs_blockage_function,
needs_range_function, issue_delay, and max_blockage fields. Drop
costexp, and busy delay fields.
(enum operator): Add POS_MINUS_OP, EQ_OP, MIN_OP, RANGE_OP.
(operate_exp): Implement new ops.
(make_internal_attr): Set unsigned_p based on the value of SPECIAL.
(write_attr_get): Function is unsigned when unsigned_p is true.
(write_attr_valueq): Write hex value of large constants in a comment.
(simplify_by_exploding): Check for EXP having no EQ_ATTR expressions
and for all values as the default.
(find_and_mark_used_attributes): Add TERMS and NTERMS parameters.
(max_attr_value): Allow IF_THEN_ELSE.
(simplify_knowing, write_complex_function, extend_range): New
functions.
(gen_unit): Use local variables to name the fields. Change the
meaning of busy-delay to issue-delay.
(expand_units): Compute issue_exp. Write attributes for computing
`<name>_unit_blockage' and `<name>_unit_blockage_range' functions.
Compute max_blockage, and the needs_*_function values.
(write_function_unit_info): Write blockage function and conflict cost
functions using write_complex_function. Write new function_unit_desc
fields.
(expand_units): Use the normalized values of the
unit's CONDEXP and BUSYEXP.
From-SVN: r1952
1992-08-25 22:26:02 +02:00
|
|
|
if (!attr->is_numeric)
|
1991-10-24 18:21:48 +01:00
|
|
|
printf ("enum attr_%s\n", attr->name);
|
(struct attr_desc): Add unsigned_p field.
(struct function_unit_op): Add issue_delay, conflict_exp, and
issue_exp fields. Drop busyexp field.
(struct function_unit): Add needs_blockage_function,
needs_range_function, issue_delay, and max_blockage fields. Drop
costexp, and busy delay fields.
(enum operator): Add POS_MINUS_OP, EQ_OP, MIN_OP, RANGE_OP.
(operate_exp): Implement new ops.
(make_internal_attr): Set unsigned_p based on the value of SPECIAL.
(write_attr_get): Function is unsigned when unsigned_p is true.
(write_attr_valueq): Write hex value of large constants in a comment.
(simplify_by_exploding): Check for EXP having no EQ_ATTR expressions
and for all values as the default.
(find_and_mark_used_attributes): Add TERMS and NTERMS parameters.
(max_attr_value): Allow IF_THEN_ELSE.
(simplify_knowing, write_complex_function, extend_range): New
functions.
(gen_unit): Use local variables to name the fields. Change the
meaning of busy-delay to issue-delay.
(expand_units): Compute issue_exp. Write attributes for computing
`<name>_unit_blockage' and `<name>_unit_blockage_range' functions.
Compute max_blockage, and the needs_*_function values.
(write_function_unit_info): Write blockage function and conflict cost
functions using write_complex_function. Write new function_unit_desc
fields.
(expand_units): Use the normalized values of the
unit's CONDEXP and BUSYEXP.
From-SVN: r1952
1992-08-25 22:26:02 +02:00
|
|
|
else
|
|
|
|
printf ("int\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* If the attribute name starts with a star, the remainder is the name of
|
|
|
|
the subroutine to use, instead of `get_attr_...'. */
|
|
|
|
if (attr->name[0] == '*')
|
2003-07-05 07:27:22 +02:00
|
|
|
printf ("%s (rtx insn ATTRIBUTE_UNUSED)\n", &attr->name[1]);
|
1992-03-06 23:25:46 +01:00
|
|
|
else if (attr->is_const == 0)
|
2003-07-05 07:27:22 +02:00
|
|
|
printf ("get_attr_%s (rtx insn ATTRIBUTE_UNUSED)\n", attr->name);
|
1992-03-06 23:25:46 +01:00
|
|
|
else
|
|
|
|
{
|
2003-07-05 07:27:22 +02:00
|
|
|
printf ("get_attr_%s (void)\n", attr->name);
|
1992-03-06 23:25:46 +01:00
|
|
|
printf ("{\n");
|
|
|
|
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
2005-08-06 23:11:54 +02:00
|
|
|
if (av->num_insns == 1)
|
1992-03-06 23:25:46 +01:00
|
|
|
write_attr_set (attr, 2, av->value, "return", ";",
|
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
|
|
|
true_rtx, av->first_insn->def->insn_code,
|
|
|
|
av->first_insn->def->insn_index);
|
2005-08-06 23:11:54 +02:00
|
|
|
else if (av->num_insns != 0)
|
|
|
|
write_attr_set (attr, 2, av->value, "return", ";",
|
|
|
|
true_rtx, -2, 0);
|
1992-03-06 23:25:46 +01:00
|
|
|
|
|
|
|
printf ("}\n\n");
|
|
|
|
return;
|
|
|
|
}
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
printf ("{\n");
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
printf (" switch (recog_memoized (insn))\n");
|
|
|
|
printf (" {\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
if (av != common_av)
|
|
|
|
write_attr_case (attr, av, 1, "return", ";", 4, true_rtx);
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
write_attr_case (attr, common_av, 0, "return", ";", 4, true_rtx);
|
|
|
|
printf (" }\n}\n\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Given an AND tree of known true terms (because we are inside an `if' with
|
|
|
|
that as the condition or are in an `else' clause) and an expression,
|
|
|
|
replace any known true terms with TRUE. Use `simplify_and_tree' to do
|
|
|
|
the bulk of the work. */
|
|
|
|
|
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
eliminate_known_true (rtx known_true, rtx exp, int insn_code, int insn_index)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
rtx term;
|
|
|
|
|
1992-05-05 05:06:39 +02:00
|
|
|
known_true = SIMPLIFY_TEST_EXP (known_true, insn_code, insn_index);
|
|
|
|
|
|
|
|
if (GET_CODE (known_true) == AND)
|
|
|
|
{
|
|
|
|
exp = eliminate_known_true (XEXP (known_true, 0), exp,
|
|
|
|
insn_code, insn_index);
|
|
|
|
exp = eliminate_known_true (XEXP (known_true, 1), exp,
|
|
|
|
insn_code, insn_index);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
term = known_true;
|
|
|
|
exp = simplify_and_tree (exp, &term, insn_code, insn_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
return exp;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Write out a series of tests and assignment statements to perform tests and
|
|
|
|
sets of an attribute value. We are passed an indentation amount and prefix
|
|
|
|
and suffix strings to write around each attribute value (e.g., "return"
|
|
|
|
and ";"). */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_attr_set (struct attr_desc *attr, int indent, rtx value,
|
|
|
|
const char *prefix, const char *suffix, rtx known_true,
|
|
|
|
int insn_code, int insn_index)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1999-02-21 19:30:37 +01:00
|
|
|
if (GET_CODE (value) == COND)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
/* Assume the default value will be the default of the COND unless we
|
|
|
|
find an always true expression. */
|
|
|
|
rtx default_val = XEXP (value, 1);
|
|
|
|
rtx our_known_true = known_true;
|
|
|
|
rtx newexp;
|
|
|
|
int first_if = 1;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (value, 0); i += 2)
|
|
|
|
{
|
|
|
|
rtx testexp;
|
|
|
|
rtx inner_true;
|
|
|
|
|
|
|
|
testexp = eliminate_known_true (our_known_true,
|
|
|
|
XVECEXP (value, 0, i),
|
|
|
|
insn_code, insn_index);
|
1992-03-06 23:25:46 +01:00
|
|
|
newexp = attr_rtx (NOT, testexp);
|
2000-09-12 17:36:21 +02:00
|
|
|
newexp = insert_right_side (AND, our_known_true, newexp,
|
|
|
|
insn_code, insn_index);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* If the test expression is always true or if the next `known_true'
|
|
|
|
expression is always false, this is the last case, so break
|
|
|
|
out and let this value be the `else' case. */
|
|
|
|
if (testexp == true_rtx || newexp == false_rtx)
|
|
|
|
{
|
|
|
|
default_val = XVECEXP (value, 0, i + 1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Compute the expression to pass to our recursive call as being
|
|
|
|
known true. */
|
|
|
|
inner_true = insert_right_side (AND, our_known_true,
|
|
|
|
testexp, insn_code, insn_index);
|
|
|
|
|
|
|
|
/* If this is always false, skip it. */
|
|
|
|
if (inner_true == false_rtx)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
write_indent (indent);
|
|
|
|
printf ("%sif ", first_if ? "" : "else ");
|
|
|
|
first_if = 0;
|
|
|
|
write_test_expr (testexp, 0);
|
|
|
|
printf ("\n");
|
|
|
|
write_indent (indent + 2);
|
|
|
|
printf ("{\n");
|
|
|
|
|
2000-09-12 17:36:21 +02:00
|
|
|
write_attr_set (attr, indent + 4,
|
1991-10-24 18:21:48 +01:00
|
|
|
XVECEXP (value, 0, i + 1), prefix, suffix,
|
|
|
|
inner_true, insn_code, insn_index);
|
|
|
|
write_indent (indent + 2);
|
|
|
|
printf ("}\n");
|
|
|
|
our_known_true = newexp;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! first_if)
|
|
|
|
{
|
|
|
|
write_indent (indent);
|
|
|
|
printf ("else\n");
|
|
|
|
write_indent (indent + 2);
|
|
|
|
printf ("{\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
write_attr_set (attr, first_if ? indent : indent + 4, default_val,
|
|
|
|
prefix, suffix, our_known_true, insn_code, insn_index);
|
|
|
|
|
|
|
|
if (! first_if)
|
|
|
|
{
|
|
|
|
write_indent (indent + 2);
|
|
|
|
printf ("}\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
1999-02-21 19:30:37 +01:00
|
|
|
{
|
|
|
|
write_indent (indent);
|
|
|
|
printf ("%s ", prefix);
|
|
|
|
write_attr_value (attr, value);
|
|
|
|
printf ("%s\n", suffix);
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2004-09-09 22:39:28 +02:00
|
|
|
/* Write a series of case statements for every instruction in list IE.
|
|
|
|
INDENT is the amount of indentation to write before each case. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
write_insn_cases (struct insn_ent *ie, int indent)
|
|
|
|
{
|
|
|
|
for (; ie != 0; ie = ie->next)
|
|
|
|
if (ie->def->insn_code != -1)
|
|
|
|
{
|
|
|
|
write_indent (indent);
|
|
|
|
if (GET_CODE (ie->def->def) == DEFINE_PEEPHOLE)
|
|
|
|
printf ("case %d: /* define_peephole, line %d */\n",
|
|
|
|
ie->def->insn_code, ie->def->lineno);
|
|
|
|
else
|
|
|
|
printf ("case %d: /* %s */\n",
|
|
|
|
ie->def->insn_code, XSTR (ie->def->def, 0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Write out the computation for one attribute value. */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_attr_case (struct attr_desc *attr, struct attr_value *av,
|
|
|
|
int write_case_lines, const char *prefix, const char *suffix,
|
|
|
|
int indent, rtx known_true)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
if (av->num_insns == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (av->has_asm_insn)
|
|
|
|
{
|
|
|
|
write_indent (indent);
|
|
|
|
printf ("case -1:\n");
|
|
|
|
write_indent (indent + 2);
|
|
|
|
printf ("if (GET_CODE (PATTERN (insn)) != ASM_INPUT\n");
|
|
|
|
write_indent (indent + 2);
|
|
|
|
printf (" && asm_noperands (PATTERN (insn)) < 0)\n");
|
|
|
|
write_indent (indent + 2);
|
|
|
|
printf (" fatal_insn_not_found (insn);\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (write_case_lines)
|
2004-09-09 22:39:28 +02:00
|
|
|
write_insn_cases (av->first_insn, indent);
|
1991-10-24 18:21:48 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
write_indent (indent);
|
|
|
|
printf ("default:\n");
|
|
|
|
}
|
|
|
|
|
1992-09-24 13:28:09 +02:00
|
|
|
/* See what we have to do to output this value. */
|
1991-10-24 18:21:48 +01:00
|
|
|
must_extract = must_constrain = address_used = 0;
|
|
|
|
walk_attr_value (av->value);
|
|
|
|
|
2000-09-12 01:54:11 +02:00
|
|
|
if (must_constrain)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
write_indent (indent + 2);
|
2000-09-12 01:54:11 +02:00
|
|
|
printf ("extract_constrain_insn_cached (insn);\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2000-09-12 01:54:11 +02:00
|
|
|
else if (must_extract)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
write_indent (indent + 2);
|
2000-09-12 01:54:11 +02:00
|
|
|
printf ("extract_insn_cached (insn);\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
2005-08-06 23:11:54 +02:00
|
|
|
if (av->num_insns == 1)
|
|
|
|
write_attr_set (attr, indent + 2, av->value, prefix, suffix,
|
|
|
|
known_true, av->first_insn->def->insn_code,
|
|
|
|
av->first_insn->def->insn_index);
|
|
|
|
else
|
|
|
|
write_attr_set (attr, indent + 2, av->value, prefix, suffix,
|
|
|
|
known_true, -2, 0);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
if (strncmp (prefix, "return", 6))
|
|
|
|
{
|
|
|
|
write_indent (indent + 2);
|
|
|
|
printf ("break;\n");
|
|
|
|
}
|
|
|
|
printf ("\n");
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
/* Search for uses of non-const attributes and write code to cache them. */
|
|
|
|
|
|
|
|
static int
|
2003-06-01 18:02:11 +02:00
|
|
|
write_expr_attr_cache (rtx p, struct attr_desc *attr)
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
{
|
rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.
* rtl.c (rtx_format): Likewise.
(copy_rtx, copy_most_rtx, read_rtx): Likewise.
(init_rtl): Use accessor macro, not `rtx_format'.
* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
char*.
* caller-save.c (mark_referenced_regs): Likewise.
* combine.c (subst, make_compound_operation, known_cond,
gen_rtx_combine, update_table_tick, get_last_value_validate,
use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.
* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
refers_to_p, canon_reg, fold_rtx, cse_process_notes,
count_reg_usage): Likewise.
* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
dump_edge_info, count_reg_references): Likewise.
* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
Likewise.
* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
add_label_notes): Likewise.
* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
clear_struct_flag, count_sub_rtxs, count_alternatives,
compares_alternatives_p, contained_in_p, walk_attr_value,
write_expr_attr_cache): Likewise.
* genconfig.c (walk_insn_part): Likewise.
* genemit.c (max_operand_1, gen_exp): Likewise.
* genextract.c (walk_rtx): Likewise.
* genflags.c (num_operands): Likewise.
* genoutput.c (scan_operands): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (add_to_sequence): Likewise.
* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
Likewise.
* integrate.c (save_constants, copy_for_inline,
copy_rtx_and_substitute, subst_constants, restore_constants):
Likewise.
* jump.c (mark_jump_label, invert_exp, redirect_exp,
rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.
* local-alloc.c (contains_replace_regs, memref_referenced_p):
Likewise.
* loop.c (record_excess_regs, rtx_equal_for_loop_p,
add_label_notes, replace_call_address, count_nonfixed_reads,
invariant_p, find_single_use_in_loop, find_mem_givs,
find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
Likewise.
* print-rtl.c (reg_names, print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
* reg-stack.c (stack_regs_mentioned_p, record_label_references,
record_reg_life_pat, swap_rtx_condition, goto_block_pat,
print_blocks): Likewise.
* regclass.c (fix_register, record_address_regs,
reg_scan_mark_refs): Likewise.
* regmove.c (stable_but_for_p): Likewise.
* reload.c (loc_mentioned_in_p, operands_match_p,
find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
copy_replacements, refers_to_regno_for_reload_p,
refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
reload_when_needed_name, reg_class_names, debug_reload_to_stream):
Likewise.
* reload1.c (eliminate_regs, scan_paradoxical_subregs,
delete_address_reloads_1, count_occurrences,
reload_cse_mem_conflict_p, reload_combine_note_use,
add_auto_inc_notes): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources):
Likewise.
* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
reg_mentioned_p, regs_set_between_p, modified_between_p,
modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.
* sched.c (sched_analyze_2, attach_deaths): Likewise.
* stupid.c (stupid_mark_refs): Likewise.
* unroll.c (remap_split_bivs): Likewise.
* varasm.c (mark_constants): Likewise.
* a29k/a29k.c (uses_local_reg_p): Likewise.
* alpha/alpha.c (summarize_insn): Likewise.
* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
eliminate_lr2ip): Likewise.
* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.
* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
reg_mentioned_in_mem): Likewise.
* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
symbolic_reference_mentioned_p): Likewise.
* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.
* sh/sh.c (regs_used, mark_use): Likewise.
* vax/vax.c (vax_rtx_cost): Likewise.
From-SVN: r28784
1999-08-21 01:05:25 +02:00
|
|
|
const char *fmt;
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
int i, ie, j, je;
|
|
|
|
|
|
|
|
if (GET_CODE (p) == EQ_ATTR)
|
|
|
|
{
|
|
|
|
if (XSTR (p, 0) != attr->name)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (!attr->is_numeric)
|
2001-10-11 05:16:15 +02:00
|
|
|
printf (" enum attr_%s ", attr->name);
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
else
|
2001-10-11 05:16:15 +02:00
|
|
|
printf (" int ");
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
|
|
|
|
printf ("attr_%s = get_attr_%s (insn);\n", attr->name, attr->name);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (GET_CODE (p));
|
|
|
|
ie = GET_RTX_LENGTH (GET_CODE (p));
|
|
|
|
for (i = 0; i < ie; i++)
|
|
|
|
{
|
|
|
|
switch (*fmt++)
|
|
|
|
{
|
|
|
|
case 'e':
|
|
|
|
if (write_expr_attr_cache (XEXP (p, i), attr))
|
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
je = XVECLEN (p, i);
|
|
|
|
for (j = 0; j < je; ++j)
|
|
|
|
if (write_expr_attr_cache (XVECEXP (p, i, j), attr))
|
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
/* Utilities to write in various forms. */
|
1998-06-16 12:48:57 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_attr_valueq (struct attr_desc *attr, const char *s)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
if (attr->is_numeric)
|
(struct attr_desc): Add unsigned_p field.
(struct function_unit_op): Add issue_delay, conflict_exp, and
issue_exp fields. Drop busyexp field.
(struct function_unit): Add needs_blockage_function,
needs_range_function, issue_delay, and max_blockage fields. Drop
costexp, and busy delay fields.
(enum operator): Add POS_MINUS_OP, EQ_OP, MIN_OP, RANGE_OP.
(operate_exp): Implement new ops.
(make_internal_attr): Set unsigned_p based on the value of SPECIAL.
(write_attr_get): Function is unsigned when unsigned_p is true.
(write_attr_valueq): Write hex value of large constants in a comment.
(simplify_by_exploding): Check for EXP having no EQ_ATTR expressions
and for all values as the default.
(find_and_mark_used_attributes): Add TERMS and NTERMS parameters.
(max_attr_value): Allow IF_THEN_ELSE.
(simplify_knowing, write_complex_function, extend_range): New
functions.
(gen_unit): Use local variables to name the fields. Change the
meaning of busy-delay to issue-delay.
(expand_units): Compute issue_exp. Write attributes for computing
`<name>_unit_blockage' and `<name>_unit_blockage_range' functions.
Compute max_blockage, and the needs_*_function values.
(write_function_unit_info): Write blockage function and conflict cost
functions using write_complex_function. Write new function_unit_desc
fields.
(expand_units): Use the normalized values of the
unit's CONDEXP and BUSYEXP.
From-SVN: r1952
1992-08-25 22:26:02 +02:00
|
|
|
{
|
1998-06-16 12:48:57 +02:00
|
|
|
int num = atoi (s);
|
|
|
|
|
|
|
|
printf ("%d", num);
|
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
if (num > 9 || num < 0)
|
1998-06-16 12:48:57 +02:00
|
|
|
printf (" /* 0x%x */", num);
|
(struct attr_desc): Add unsigned_p field.
(struct function_unit_op): Add issue_delay, conflict_exp, and
issue_exp fields. Drop busyexp field.
(struct function_unit): Add needs_blockage_function,
needs_range_function, issue_delay, and max_blockage fields. Drop
costexp, and busy delay fields.
(enum operator): Add POS_MINUS_OP, EQ_OP, MIN_OP, RANGE_OP.
(operate_exp): Implement new ops.
(make_internal_attr): Set unsigned_p based on the value of SPECIAL.
(write_attr_get): Function is unsigned when unsigned_p is true.
(write_attr_valueq): Write hex value of large constants in a comment.
(simplify_by_exploding): Check for EXP having no EQ_ATTR expressions
and for all values as the default.
(find_and_mark_used_attributes): Add TERMS and NTERMS parameters.
(max_attr_value): Allow IF_THEN_ELSE.
(simplify_knowing, write_complex_function, extend_range): New
functions.
(gen_unit): Use local variables to name the fields. Change the
meaning of busy-delay to issue-delay.
(expand_units): Compute issue_exp. Write attributes for computing
`<name>_unit_blockage' and `<name>_unit_blockage_range' functions.
Compute max_blockage, and the needs_*_function values.
(write_function_unit_info): Write blockage function and conflict cost
functions using write_complex_function. Write new function_unit_desc
fields.
(expand_units): Use the normalized values of the
unit's CONDEXP and BUSYEXP.
From-SVN: r1952
1992-08-25 22:26:02 +02:00
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
write_upcase (attr->name);
|
|
|
|
printf ("_");
|
|
|
|
write_upcase (s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_attr_value (struct attr_desc *attr, rtx value)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
1999-02-21 19:30:37 +01:00
|
|
|
int op;
|
|
|
|
|
|
|
|
switch (GET_CODE (value))
|
|
|
|
{
|
|
|
|
case CONST_STRING:
|
|
|
|
write_attr_valueq (attr, XSTR (value, 0));
|
|
|
|
break;
|
|
|
|
|
genattrtab.c (write_attr_value): Do not abort for CONST_INT operands.
* genattrtab.c (write_attr_value): Do not abort for CONST_INT operands.
* i386.c (ix86_attr_length_default): Kill.
(ix86_attr_length_immediate_default, ix86_attr_length_address_default):
New.
* i386-protos.h (ix86_attr_length_default): Kill
(ix86_attr_length_immediate_default, ix86_attr_length_address_default):
Add prototype
* i386.md (attribute type): Add "test".
(attribute length_prefix): Kill.
(attribute length_opcode): Kill.
(attribute i387, mode, length_immediate, length_address, prefix_data16,
prefix_rep, prefix_0f, modrm): New.
(attribute length): Compute using the new attributes.
(attribute pent_prefix): New.
(attribute pent_pair): Compute using pent_prefix.
(all insn patterns): Set mode,modrm and immediate_length attributes where
needed.
(cmpsi patterns): Compute sizes propertly for test instruction.
(movsi, movhi patterns): Compute sizes propertly for eax shortcuts.
(movstricthi_xor, movstrictqi_xor): New patterns.
(andsi/andhi): Use splitters to generate xor instructions.
(xorqi_ext_1): New pattern.
(movstricthi->movstricthi_xor peep2): New.
From-SVN: r34731
2000-06-27 12:24:38 +02:00
|
|
|
case CONST_INT:
|
|
|
|
printf (HOST_WIDE_INT_PRINT_DEC, INTVAL (value));
|
|
|
|
break;
|
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
case SYMBOL_REF:
|
* 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 (XSTR (value, 0));
|
1999-02-21 19:30:37 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR:
|
|
|
|
{
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
struct attr_desc *attr2 = find_attr (&XSTR (value, 0), 0);
|
2000-09-12 17:36:21 +02:00
|
|
|
printf ("get_attr_%s (%s)", attr2->name,
|
1999-02-21 19:30:37 +01:00
|
|
|
(attr2->is_const ? "" : "insn"));
|
|
|
|
}
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1999-02-21 19:30:37 +01:00
|
|
|
case PLUS:
|
|
|
|
op = '+';
|
|
|
|
goto do_operator;
|
|
|
|
case MINUS:
|
|
|
|
op = '-';
|
|
|
|
goto do_operator;
|
|
|
|
case MULT:
|
|
|
|
op = '*';
|
|
|
|
goto do_operator;
|
|
|
|
case DIV:
|
|
|
|
op = '/';
|
|
|
|
goto do_operator;
|
|
|
|
case MOD:
|
|
|
|
op = '%';
|
|
|
|
goto do_operator;
|
|
|
|
|
|
|
|
do_operator:
|
|
|
|
write_attr_value (attr, XEXP (value, 0));
|
|
|
|
putchar (' ');
|
|
|
|
putchar (op);
|
|
|
|
putchar (' ');
|
|
|
|
write_attr_value (attr, XEXP (value, 1));
|
|
|
|
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-02-21 19:30:37 +01:00
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_upcase (const char *str)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
while (*str)
|
2000-09-12 17:36:21 +02:00
|
|
|
{
|
|
|
|
/* The argument of TOUPPER should not have side effects. */
|
|
|
|
putchar (TOUPPER(*str));
|
|
|
|
str++;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_indent (int indent)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
for (; indent > 8; indent -= 8)
|
|
|
|
printf ("\t");
|
|
|
|
|
|
|
|
for (; indent; indent--)
|
|
|
|
printf (" ");
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Write a subroutine that is given an insn that requires a delay slot, a
|
2002-09-22 16:09:34 +02:00
|
|
|
delay slot ordinal, and a candidate insn. It returns nonzero if the
|
1991-10-24 18:21:48 +01:00
|
|
|
candidate can be placed in the specified delay slot of the insn.
|
|
|
|
|
|
|
|
We can write as many as three subroutines. `eligible_for_delay'
|
|
|
|
handles normal delay slots, `eligible_for_annul_true' indicates that
|
|
|
|
the specified insn can be annulled if the branch is true, and likewise
|
|
|
|
for `eligible_for_annul_false'.
|
|
|
|
|
1992-05-07 08:41:23 +02:00
|
|
|
KIND is a string distinguishing these three cases ("delay", "annul_true",
|
1991-10-24 18:21:48 +01:00
|
|
|
or "annul_false"). */
|
|
|
|
|
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_eligible_delay (const char *kind)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct delay_desc *delay;
|
|
|
|
int max_slots;
|
|
|
|
char str[50];
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
const char *pstr;
|
1991-10-24 18:21:48 +01:00
|
|
|
struct attr_desc *attr;
|
|
|
|
struct attr_value *av, *common_av;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Compute the maximum number of delay slots required. We use the delay
|
|
|
|
ordinal times this number plus one, plus the slot number as an index into
|
|
|
|
the appropriate predicate to test. */
|
|
|
|
|
|
|
|
for (delay = delays, max_slots = 0; delay; delay = delay->next)
|
|
|
|
if (XVECLEN (delay->def, 1) / 3 > max_slots)
|
|
|
|
max_slots = XVECLEN (delay->def, 1) / 3;
|
|
|
|
|
|
|
|
/* Write function prelude. */
|
|
|
|
|
|
|
|
printf ("int\n");
|
2003-07-05 07:27:22 +02:00
|
|
|
printf ("eligible_for_%s (rtx delay_insn ATTRIBUTE_UNUSED, int slot, rtx candidate_insn, int flags ATTRIBUTE_UNUSED)\n",
|
2000-09-12 17:36:21 +02:00
|
|
|
kind);
|
1991-10-24 18:21:48 +01:00
|
|
|
printf ("{\n");
|
|
|
|
printf (" rtx insn;\n");
|
|
|
|
printf ("\n");
|
2004-09-09 17:58:21 +02:00
|
|
|
printf (" gcc_assert (slot < %d);\n", max_slots);
|
1991-10-24 18:21:48 +01:00
|
|
|
printf ("\n");
|
Introduce H8SX support.
* expr.c (expand_strcpy): Renamed and moved to...
* builtins.c (expand_movstr): ... here. Tweak.
(expand_builtin_strcpy): Adjust. Use movstr if len can't be
computed or has side effects.
(expand_builtin_stpcpy): Likewise. Use strcpy if return value is
unused, or if mempcpy fails. Adjust the return value in the
latter case. Use movstr if everything else fails.
* doc/md.texi (movstr): Document.
(movmemM, clrmemM): Fix explanation of memory block operands.
* config/h8300/h8300.md (stpcpy): Renamed to...
(movstr): ... this. Adjust.
2004-07-07 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.md: Rename movstr*, except for movstrict*, to
movmem* and clrstr* to clrmem*.
2004-06-27 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.c (h8300_reg_class_from_letter): Map 'D' to
GENERAL_REGS, always.
(h8300_swap_into_er6, h8300_swap_into_er6): Handle the case of
getting the stack pointer as addr.
* config/h8300/h8300.h (PREDICATE_CODES): Remove constant rtxes
from general_operand_dst.
* config/h8300/h8300.md (movmd_internal_normal): New, normal-mode
variant of...
(movmd_internal): ... this. Add modes to operands. Disparage `D'
instead of requiring it to match only before reload.
(stpcpy_internal_normal): New, normal-mode variant of...
(stpcpy_internal): ... this. Add modes to operands. Disparage
`D' instead of requiring it to match only before reload.
* config/h8300/h8300-protos.h (h8300_legitimate_address_p): Add
mode argument.
* config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Pass it to...
* config/h8300/h8300.c (h8300_legitimate_address_p): Pass it to
h8300_get_index.
* config/h8300/h8300.md (attr type): Add call.
(attr can_delay): If type is call, set it no.
(call, call_value): Set type to call.
2004-06-21 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.md (logicalhi3_sn, logicalsi3_sn): New.
2004-06-16 Alexandre Oliva <aoliva@redhat.com>
* tree.c (get_narrower): Don't narrow integral types into
non-integral types.
* config/h8300/h8300.c (h8300_expand_epilogue): Initialize
frame_size *before* the first use.
* config/h8300/h8300.md (movstrictqi): Reintroduce post-increment
on input.
(peephole2): Don't widen instructions that push SP. Move
decrement of SP to the end of all stm-generating peepholes.
2003-07-24 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.md (insv): Prefer to use AND to clear a bitfield
and OR to set it to all ones.
2003-07-24 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.md (can_delay): Default to "no" for bit branches.
(call, call_value): Set can_delay to "no".
2003-07-22 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.md (extzv): Make subreg check more robust.
2003-07-21 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.md (*brabit): Remove.
* config/h8300/h8300.md (*brabc, *brabs): Remove mode from
zero_extract. Use bit_memory_operand as the predicate for
operand 1 and 'WU' as the constraint. Check the difference
between the base length and the final one when deciding which
type of branch to use.
2003-07-21 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.md (extzv): Remove mode from operands 0 and 1.
Use convert_move to extend the result for TARGET_H8300SX. Check
for QImode memory references. Optimize the case where the
destination is a paradoxical subreg.
2003-07-21 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.md (*movsf_h8sx): Add an r <- G alternative.
* config/h8300/h8300.md (andqi): Remove bclr from h8sx version.
2003-07-21 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.md: Include mova.md
(length_table): Add mova and mova_zero.
* config/h8300/h8300.c (print_operand): Handle '%o'. Print a length
after all constant addresses for '%R', '%X', '%T' and '%S'.
(h8300_mova_length): New function.
(h8300_insn_length_from_table): Use it to handle mova and mova_zero.
* config/h8300/t-h8300 (mova.md): Generate from genmova.sh. Add to
dependencies for s-config, etc.
* config/h8300/gemova.sh: New file.
* config/h8300/mova.md: Generated.
2003-07-20 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.c (h8300_bitfield_length): New.
(nibble_operand): Adjust.
(h8300_binary_length): Handle conditional binary op.
(h8300_insn_length_from_table): Handle bitfield and bitbranch.
* config/h8300/h8300.h: Change constraints W# and Y# to P#>X and
P#<X, respectively. The original P is now IP4>X. Introduced P#>0
and P#<0, unused so far. W and Y are now prefixes to multi-letter
constraints. WU is introduced as a variant of U that requires a
mem, and is therefore considered an EXTRA_MEMORY_CONSTRAINT.
* config/h8300/h8300.md (attr type): Added bitbranch.
(attr length_table): Added bitfield and bitbranch.
(attr length): Compute bitbranch length.
(andqi): Separate pattern for H8300SX. Use bfld for loading the
least-significant bit of a byte.
(brabit, brabc, brabs): New.
(insv, extzv): Emit bfst and bfld on H8300SX.
(bfld, bfst, seq, sne): New.
(bstzhireg, cmpstz, bstz, bistz): New.
(cmpcondbset, condbset, cmpcondbclr, condbclr): New.
(cmpcondbsetreg, condbsetreg, cmpcondbclrreg, condbclrreg): New.
2003-07-11 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.c (h8sx_binary_memory_operator): New function.
(h8sx_unary_memory_operator): New function.
* config/h8300/h8300.h (EXTRA_MEMORY_CONSTRAINT): Disable.
(PREDICATE_CODES): Add h8sx_{unary,binary}_memory_operator.
* config/h8300/h8300.md: Add peepholes to combine reloads and
arithmetic insns.
2003-07-10 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h830.md (cmpqi): Use 'i' rather than 'n' in constraints.
(*cmphi_h8300hs, *addqi3, *addhi3_h8sx, subhi3): Likewise.
(and?i, ior?i, xor?i): Likewise.
2003-07-10 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.c: Move enums and prototypes to head of file.
Various whitespace fixes.
(h8300_constant_length): New function, split out from...
(h8300_displacement_size): ...here. Rename h8300_displacement_length.
(h8300_classify_operand): Use IN_RANGE.
(h8300_classify_operand): Use h8300_constant_length.
(h8300_short_move_mem_p): Tighten size check.
(h8sx_mergeable_memrefs_p): Tighten equality check.
2003-06-30 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.h (TARGET_CPU_CPP_BUILTINS): Define __H8300SX__
for -msx.
* config/h8300/crti.asm: Use .h8300sx or .h8300sxn for -msx code.
* config/h8300/crtn.asm: Likewise.
* config/h8300/lib1funcs.asm: Likewise. Use 32-bit pointers
if __H8300SX__ is defined.
2003-06-27 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300-protos.h (h8300_get_index): Add mode parameter.
* config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Update accordingly.
(GO_IF_MODE_DEPENDENT_ADDRESS): Treat POST_DEC, PRE_INC and indexed
addresses as mode-dependent.
* config/h8300/h8300.c (print_operand_address): Update call to
h8300_get_index.
(h8300_get_index): Take a mode argument. Rework to fix an
earlier misunderstanding.
2003-06-26 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.c (zero_extendqisi2): Force the source operand
into a register if TARGET_H8300SX.
(*zero_extendqisi2_h8300hs, *extendqisi2_h8300): Disable for
TARGET_H8300SX. Also disable related define_splits.
(*zero_extendqisi2_h8sx, *extendqisi2_h8sx): New patterns.
2003-06-23 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.c (h8300_rtx_costs): Add h8sx handling.
2003-06-20 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.h (OK_FOR_Z): New macro.
(EXTRA_CONSTRAINT_STR): Check it.
* config/h8300/h8300.c (h8300_classify_operand): Accept null
class arguments.
(h8300_insn_length_from_table): Handle LENGTH_TABLE_MOV_IMM4.
* config/h8300/h8300.md (length_table): Add mov_imm4.
(movqi, movhi): Add Z <- W4 alternatives to h8sx patterns.
2003-06-20 Richard Sandiford <rsandifo@redhat.com>
* genattrtab.c (write_eligible_delay): Allow candidate_insn to
be a label.
* config/h8300/h8300.h (DELAY_SLOT_LENGTH): New macro.
* config/h8300/h8300.c (h8300_reorg): New function.
(TARGET_MACHINE_DEPENDENT_REORG): Define.
* config/h8300/h8300.md (length): Subtract the length of the
delay slot from (pc) when checking the range of forward branches.
(delay_slot, can_delay): New attributes.
(define_delay): Add bra/s handling.
(movmd_internal, return_h8sx, *return_1): Set can_delay to no.
(jump): Add delayed-branch handling.
2003-06-17 Richard Sandiford <rsandifo@redhat.com>
* expr.c (expand_strcpy): New function.
* builtins.c (expand_builtin_strcpy): Fall back on expand_strcpy.
(expand_builtin_stpcpy): Likewise.
* config/h8300/h8300-protos.h (h8sx_split_movmd): Remove.
(h8300_swap_into_er6, h8300_swap_out_of_er6): Declare.
* config/h8300/h8300.c (h8300_reg_class_from_letter): Tweak 'd'
handling to improve register allocation for -fno-omit-frame-pointer.
(h8sx_split_movmd): Delete, moving er6 handling into...
(h8300_swap_into_er6, h8300_swap_out_of_er6): ...these new functions.
* config/h8300/h8300.md (UNSPEC_STPCPY): New unspec constant.
(movmd): Add calls to copy_rtx.
(movmd_internal): In the second alternative, allow the initial and
final destination registers to be different . Update the splitter
accordingly. Call h8300_swap_into_er6 and h8300_swap_out_of_er6
instead of h8sx_split_movmd.
(stpcpy, movsd): New expanders.
(movsd_internal): New define_insn.
2003-06-13 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300-protos.h (h8300_reg_class_from_letter): Declare.
(h8sx_emit_movmd, h8sx_split_movmd): Declare.
* config/h8300/h8300.h (reg_class): Add COUNTER_REGS, SOURCE_REGS
and DESTINATION_REGS.
(REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly.
(REGNO_REG_CLASS): Map er4, er5 and er6 to the new classes.
(REG_CLASS_FROM_LETTER): Use h8300_reg_class_from_letter.
(h8300_move_ratio): Declare.
(MOVE_RATIO): Use it.
* config/h8300/h8300.c (h8300_move_ratio): New variable.
(h8300_init_once): Initialize it.
(h8300_reg_class_from_letter): New function.
(print_operand): Add an 'm' prefix for printing ".b", ".w" or ".l".
(h8sx_emit_movmd, h8sx_split_movmd): New functions.
* config/h8300/h8300.md (UNSPEC_MOVMD): New unspec constant.
(COUNTER_REG, SOURCE_REG, DESTINATION_REG): New register constants.
(movstrsi, movmd): New expanders.
(movmd_internal): New insn.
2003-06-06 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.h (EXTRA_MEMORY_CONSTRAINT): Define.
2003-06-04 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/elf.h (LINK_SPEC): Use -m h8300sxnelf for -msx -mn.
* config/h8300/h8300.c (asm_file_start): Use .h8300sxn likewise.
2003-06-03 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.c (nibble_operand): Fix warning.
* config/h8300/h8300.md (movstricthi): Set adjust_length to no.
(movsi_h8sx): Likewise here and the normal h8sx movhi pattern.
(movsf_h8300h): Disable for TARGET_H8300SX.
2003-06-03 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.h (PREDICATE_CODES): Add h8300_ldm_parallel,
h8300_stm_parallel and h8300_return_parallel.
* config/h8300/h8300.c (h8300_push_pop, h8300_stack_offset_p,
h8300_ldm_stm_regno, h8300_ldm_stm_parallel, h8300_ldm_parallel,
h8300_stm_parallel, h8300_return_parallel): New functions.
(h8300_expand_prologue): Don't enforce ldm/stm register alignment
if TARGET_H8300SX. Use h8300_push_pop.
(h8300_expand_epilogue): Likewise. Try to merge the return insn
and final pop when generating h8sx code. Always emit some form
of return insn.
* config/h8300/h8300.md: Don't enforce register alignment in
stm peepholes if TARGET_H8300SX.
(ldm_h8300s, stm_h8300s, return_h8sx): New patterns.
(ldm_h8300s_[234], stm_h8300_[234]): Disable.
(epilogue): Expect h8300_expand_epilogue to emit a return insn.
2003-06-03 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/t-h8300 (MULTILIB_OPTIONS): Add a -msx multilib.
(MULTILIB_DIRNAMES): Add a directory for it.
(MULTILIB_MATCHES): Delete.
2003-05-28 Richard Sandiford <rsandifo@redhat.com>
* final.c (walk_alter_subreg): Handle addresses with subregs
inside a ZERO_EXTEND or AND.
* config/h8300/h8300-protos.h (h8300_get_index): Declare.
* config/h8300/h8300.h (INDEX_REG_CLASS): Set to GENERAL_REGS
if TARGET_H8300SX.
(GO_IF_LEGITIMATE_ADDRESS): Use h8300_get_index.
* config/h8300/h8300.c (print_operand_address): Handle @(dd,RnL.b),
@(dd,Rn.w) and @(dd,ERn.L).
(h8300_displacement_size): Take the whole address as argument.
(h8300_classify_operand, h8300_short_move_mem_p): Adjust accordingly.
2003-05-28 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips-protos.h (h8300_operands_match_p): Declare.
(h8sx_mergeable_memrefs_p): Declare.
* config/h8300/h8300.h (HAVE_POST_DECREMENT): Define to TARGET_H8300SX.
(HAVE_PRE_INCREMENT): Likewise.
(GO_IF_LEGITIMATE_ADDRESS): Accept pre/post increment/decrement
addresses for TARGET_H8300SX,
* config/h8300/h8300.c (print_operand_address): Deal with PRE_INC
and POST_DEC.
(movb_length_table, movl_length_table): New tables.
(movw_length_table): Define to movb_length_table.
(h8300_displacement_size): New, split out from...
(h8300_classify_address): ...here. Handle pre/post inc/dec.
(h8300_short_immediate_length): Allow H8OP_MEM_COMPLEX operands.
(h8300_insn_length_from_table): Add cases for movb, movw and movl.
(h8sx_mergeable_memrefs_p, h8300_operands_match_p): New functions.
(output_plussi): Use add.l #xx:3,Rn and sub.l #xx:3,Rn for h8sx.
(compute_plussi_length, compute_plussi_cc): Update accordingly.
(h8sx_unary_shift_operator): Get the mode from the operator.
(binary_shift_operator): Likewise.
* config/h8300/h8300.md: If a peephole2 applies gen_lowpart to
a memory reference, check whether the reference is offsettable.
(length_table): Add movb, movw and movl.
(movqi): Add new h8sx pattern. Don't force one operand to be a
register when generating h8sx code.
(movhi, movsi, movsf): Likewise.
(movstrictqi): Use the length_table attribute.
(movstricthi): Likewise. Add h8sx alternative for mov.w #xx:3,Rn.
(addqi3): Split into a define_expand and define_insn. Don't accept
memory operands in the expander. Use h8300_operands_match_p to
check for matching operands in the define_insn.
(subqi3, negqi2, one_cmplqi2): Likewise.
(add[hs]i3): Don't accept memory operands in the expander. Likewise
in any patterns that are unused in h8sx code. In the h8sx patterns,
use h8300_operands_match_p to check whether operands match.
(sub[hs]i3, and[hi]3, ior[hs]i3, xor[hs]i3, neg[hsi]3,
one_cmpl[hs]i3): Likewise.
(andqi3, iorqi3, xorqi3): Likewise. Don't call fix_bit_operand
in the expander.
2003-05-23 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300-protos.h (expand_a_shift): Return a bool.
(h8300_insn_length_from_table): Add a second parameter.
(output_h8sx_shift): Declare.
* config/h8300/h8300.h (OK_FOR_W, OK_FOR_Y): New macros.
(EXTRA_CONSTRAINT): Replace with...
(EXTRA_CONSTRAINT_STR): ...this. Use OK_FOR_W and OK_FOR_Y.
(CONSTRAINT_LEN): Define, returning 2 for 'W' and 'Y'.
(PREDICATE_CODES): Add entries for h8sx_unary_shift_operator
and h8sx_binary_shift_operator.
* config/h8300/h8300.c (two_insn_adds_subs_operand): Return false
for TARGET_H8300SX.
(bit_operand): Replace use of EXTRA_CONSTRAINT with OK_FOR_U.
(bit_memory_operand, fix_bit_operand): Likewise.
(h8300_length_table_for_insn): Remove.
(h8300_classify_operand): Fix check for 16-bit operands in 32-bit
instructions.
(h8300_short_immediate_length, h8300_binary_length): New functions.
(h8300_insn_length_from_table): Add an opcodes parameter. Rework.
(output_plussi): Use sub to add negative constants.
(compute_plussi_length): Adjust accordingly.
(h8sx_single_shift_type): New enum.
(h8sx_single_shift, h8sx_unary_shift_operator,
h8sx_binary_shift_operator, output_h8sx_shift): New functions.
(expand_a_shift, expand_a_rotate): Emit nothing if the shift is a
single h8sx instruction. Return false in this case.
* config/h8300/h8300.md (length_table): Add short_immediate.
(length): Pass the operand array to h8300_insn_length_from_table.
(adjust_length): Assume "no" for insns with a length_table attribute.
(*cmphi_h8300hs, cmpsi): Add alternatives for #xx:3.
(*addhi3_h8300hs): Don't use for h8sx.
(*addhi3_h8sx): New pattern, with alternatives for add.w #xx:3
and sub.w #xx:3.
(ashl[qhs]i3, lshr[qhs]i3, ashr[qhs]i3, rotl[qhs]i3): Change operand
1's predicate to nonimmediate_operand. Only skip default expansion
if expand_a_shift or expand_a_rotate returns true. Add new patterns
for single h8sx shift instructions.
2003-05-22 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.c (nibble_operand): Split out of...
(reg_or_nibble_operand): ... this.
* config/h8300/h8300.h (PREDICATE_CODES): Added nibble_operand.
* config/h8300/h8300.md: (mulqihi3, mulhisi3, umulqihi3,
umulhisi3): Introduce expand, and introduce separate insns for
sign- or zero-extended REG and already-extended CONST_INT.
2003-05-20 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.c (h8300_unary_length): Fix miscounting.
* config/h8300/h8300.md (subqi3): Generalize for h8sx.
(subhi3): Likewise. Don't accept immediates for operand 1.
Remove the early clobber from second alternative of the h8300s pattern.
(subsi3): Generalize for h8sx. Force operand 2 into a register
on plain h8300 targets.
(subsi3_h8300): Use h8300_dst_operand for consistency with expander.
(subsi3_h8300h): Generalize for h8sx.
(one_cmplqi2, one_cmplhi2, one_cmplsi2): Likewise.
2003-05-19 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.c (reg_or_nibble_operand): New.
* config/h8300/h8300.h (PREDICATE_CODES): Adjust.
(TARGET_H8300SXMUL): New.
(CONST_OK_FOR_P): New.
(CONST_OK_FOR_LETTER_P): Adjust.
* config/h8300/h8300.md (mulqihi3, mulhisi3, umulqihi3,
umulhisi3): Accept 4-bit immediate on H8SX.
(mulhi3, mulsi3, smulsi3_highpart, umulsi3_highpart): New.
(udivsi3, divhi3, udivsi3, divsi3): New.
2003-05-19 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300-protos.h (h8300_insn_length_from_table): Declare.
* config/h8300/h8300.h (OK_FOR_Q): New macro.
(EXTRA_CONSTRAINT): Use it to check the 'Q' constraint.
(PREDICATE_CODES): Add h8300_src_operand and h8300_dst_operand.
Add ADDRESSOF to the bit_operand entry.
* config/h8300/h8300.c (h8300_dst_operand): New predicate.
(h8300_src_operand): Likewise.
(bit_operand): Check nonimmediate_operand rather than general_operand.
Accept any nonimmediate_operand in h8sx code.
(h8300_and_costs): Initialize operands[1].
(h8300_rtx_costs) <AND>: Return false if the operands aren't valid.
(h8300_operand_class): New enum.
(h8300_length_table): New typedef.
(addb_length_table, addw_length_table, addl_length_table,
logicl_length_table): New tables.
(logicb_length_table, logicw_length_table): New macros.
(h8300_classify_operand, h8300_length_from_table,
h8300_length_table_for_insn, h8300_unary_length,
h8300_insn_length_from_table): New functions.
(output_plussi): Only use adds and subs for register destinations.
Disable redundant clause.
(compute_plussi_cc): Likewise.
(compute_plussi_length): Likewise. Use h8300_length_from_table
to work out the length of an insn.
(output_logical_op): Only use narrower immediate instructions
if the destination is a register.
(compute_logical_op_cc): Likewise.
(compute_logical_op_length): Likewise. Use h8300_length_from_table.
(h8300_adjust_insn_length): Tighten check for reg<->mem moves.
* config/h8300/h8300.md (length_table): New attribute.
(length): When an instruction has a length_table attribute, use
h8300_insn_length_from_table to calculate its default length.
(cmpqi): Use h8300_dst_operand for the first operand and
h8300_src_operand for the second.
(cmphi, *cmphi_h8300hs, cmpsi, negqi2, neghi2, neghi2_h8300h, negsi2,
negsi2_h8300h, addqi3, addhi3, *addhi3_h8300, *addhi3_h8300hs, addsi3,
addsi_h8300, addsi_h8300h, andhi3, andsi3, iorhi3,
iorsi3, xorhi3, xorsi3): Likewise.
(andqi3): Use h8300_src_operand for operand 2. Adjust the condition
so that it allows any combination of operands for TARGET_H8300SX.
(iorqi3, xorqi3): Likewise.
(cmpqi): Use the length_table attribute.
(*cmphi_h8300hs, cmpsi, addqi, *addhi3_h8300hs, andqi3, iorqi3,
xorqi3, negqi2, neghi2_h8300h, negsi2_h8300h): Likewise.
(cmpqi): Add 'Q' constraint.
(*cmphi_h8300hs, cmpsi, addqi, *addhi3_h8300hs, addsi_h8300h, andqi3,
iorqi3, xorqi3, negqi2, neghi2_h8300h, negsi2_h8300h): Likewise.
2003-05-14 Richard Sandiford <rsandifo@redhat.com>
* config/h8300/h8300.h (MASK_H8300SX): New macro.
(TARGET_H8300S): True for both -ms and -msx.
(TARGET_H8300SX): New macro.
(TARGET_SWITCHES): Add entries for -msx and -mno-sx.
* config/h8300/h8300.c (asm_file_start): Write .h8300sx for -msx.
* config/h8300/elf.h (LINK_SPEC): Use -m h8300sxelf for -msx.
* config/h8300/t-h8300 (MULTILIB_MATCHES): Use -ms multilibs for -msx.
[Temporary change.]
2003-02-28 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.h (SIZE_TYPE, PTRDIFF_TYPE): Use short with
16-bit pointers and 32-bit ints.
* config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Accept
CONST_DOUBLE with mode no wider than SImode.
* config/h8300/h8300.md (extendqisi2_h8300): Add constraints for
output operand.
2003-02-27 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.c (general_operand_src): Match CONSTANT_P_RTX
or SUBREG thereof.
* config/h8300/h8300.h (PREDICATE_CODES): Adjust.
2003-02-22 Alexandre Oliva <aoliva@redhat.com>
* config/h8300/h8300.c (dosize): Truncate sign * size to Pmode.
From-SVN: r84257
2004-07-08 05:40:34 +02:00
|
|
|
/* Allow dbr_schedule to pass labels, etc. This can happen if try_split
|
|
|
|
converts a compound instruction into a loop. */
|
|
|
|
printf (" if (!INSN_P (candidate_insn))\n");
|
|
|
|
printf (" return 0;\n");
|
|
|
|
printf ("\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* If more than one delay type, find out which type the delay insn is. */
|
|
|
|
|
|
|
|
if (num_delays > 1)
|
|
|
|
{
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
attr = find_attr (&delay_type_str, 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 (attr);
|
1991-10-24 18:21:48 +01:00
|
|
|
common_av = find_most_used (attr);
|
|
|
|
|
|
|
|
printf (" insn = delay_insn;\n");
|
|
|
|
printf (" switch (recog_memoized (insn))\n");
|
|
|
|
printf (" {\n");
|
|
|
|
|
|
|
|
sprintf (str, " * %d;\n break;", max_slots);
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
if (av != common_av)
|
|
|
|
write_attr_case (attr, av, 1, "slot +=", str, 4, true_rtx);
|
|
|
|
|
|
|
|
write_attr_case (attr, common_av, 0, "slot +=", str, 4, true_rtx);
|
|
|
|
printf (" }\n\n");
|
|
|
|
|
|
|
|
/* Ensure matched. Otherwise, shouldn't have been called. */
|
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
|
|
|
printf (" gcc_assert (slot >= %d);\n\n", max_slots);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* If just one type of delay slot, write simple switch. */
|
|
|
|
if (num_delays == 1 && max_slots == 1)
|
|
|
|
{
|
|
|
|
printf (" insn = candidate_insn;\n");
|
|
|
|
printf (" switch (recog_memoized (insn))\n");
|
|
|
|
printf (" {\n");
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
attr = find_attr (&delay_1_0_str, 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 (attr);
|
1991-10-24 18:21:48 +01:00
|
|
|
common_av = find_most_used (attr);
|
|
|
|
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
if (av != common_av)
|
|
|
|
write_attr_case (attr, av, 1, "return", ";", 4, true_rtx);
|
|
|
|
|
|
|
|
write_attr_case (attr, common_av, 0, "return", ";", 4, true_rtx);
|
|
|
|
printf (" }\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Write a nested CASE. The first indicates which condition we need to
|
|
|
|
test, and the inner CASE tests the condition. */
|
|
|
|
printf (" insn = candidate_insn;\n");
|
|
|
|
printf (" switch (slot)\n");
|
|
|
|
printf (" {\n");
|
|
|
|
|
|
|
|
for (delay = delays; delay; delay = delay->next)
|
|
|
|
for (i = 0; i < XVECLEN (delay->def, 1); i += 3)
|
|
|
|
{
|
|
|
|
printf (" case %d:\n",
|
|
|
|
(i / 3) + (num_delays == 1 ? 0 : delay->num * max_slots));
|
|
|
|
printf (" switch (recog_memoized (insn))\n");
|
|
|
|
printf ("\t{\n");
|
|
|
|
|
|
|
|
sprintf (str, "*%s_%d_%d", kind, delay->num, i / 3);
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
pstr = str;
|
|
|
|
attr = find_attr (&pstr, 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 (attr);
|
1991-10-24 18:21:48 +01:00
|
|
|
common_av = find_most_used (attr);
|
|
|
|
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
if (av != common_av)
|
|
|
|
write_attr_case (attr, av, 1, "return", ";", 8, true_rtx);
|
|
|
|
|
|
|
|
write_attr_case (attr, common_av, 0, "return", ";", 8, true_rtx);
|
|
|
|
printf (" }\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
printf (" default:\n");
|
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
|
|
|
printf (" gcc_unreachable ();\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
printf (" }\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
printf ("}\n\n");
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* This page contains miscellaneous utility routines. */
|
|
|
|
|
|
|
|
/* Given a pointer to a (char *), return a malloc'ed string containing the
|
|
|
|
next comma-separated element. Advance the pointer to after the string
|
|
|
|
scanned, or the end-of-string. Return NULL if at end of string. */
|
|
|
|
|
|
|
|
static char *
|
2003-06-01 18:02:11 +02:00
|
|
|
next_comma_elt (const char **pstr)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
2002-05-12 20:43:33 +02:00
|
|
|
const char *start;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2002-05-12 20:43:33 +02:00
|
|
|
start = scan_comma_elt (pstr);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2002-05-12 20:43:33 +02:00
|
|
|
if (start == NULL)
|
|
|
|
return NULL;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2002-05-12 20:43:33 +02:00
|
|
|
return attr_string (start, *pstr - start);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return a `struct attr_desc' pointer for a given named attribute. If CREATE
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
is nonzero, build a new attribute, if one does not exist. *NAME_P is
|
|
|
|
replaced by a pointer to a canonical copy of the string. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
static struct attr_desc *
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
find_attr (const char **name_p, int create)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_desc *attr;
|
1992-05-07 01:13:18 +02:00
|
|
|
int index;
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
const char *name = *name_p;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* Before we resort to using `strcmp', see if the string address matches
|
|
|
|
anywhere. In most cases, it should have been canonicalized to do so. */
|
|
|
|
if (name == alternative_name)
|
|
|
|
return NULL;
|
|
|
|
|
1992-05-07 01:13:18 +02:00
|
|
|
index = name[0] & (MAX_ATTRS_INDEX - 1);
|
|
|
|
for (attr = attrs[index]; attr; attr = attr->next)
|
1991-10-24 18:21:48 +01:00
|
|
|
if (name == attr->name)
|
|
|
|
return attr;
|
|
|
|
|
|
|
|
/* Otherwise, do it the slow way. */
|
1992-05-07 01:13:18 +02:00
|
|
|
for (attr = attrs[index]; attr; attr = attr->next)
|
1992-05-05 23:48:14 +02:00
|
|
|
if (name[0] == attr->name[0] && ! strcmp (name, attr->name))
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
{
|
|
|
|
*name_p = attr->name;
|
|
|
|
return attr;
|
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
if (! create)
|
|
|
|
return NULL;
|
|
|
|
|
2003-07-19 16:47:15 +02:00
|
|
|
attr = oballoc (sizeof (struct attr_desc));
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
attr->name = DEF_ATTR_STRING (name);
|
1991-10-24 18:21:48 +01:00
|
|
|
attr->first_value = attr->default_val = NULL;
|
2005-04-08 19:20:15 +02:00
|
|
|
attr->is_numeric = attr->is_const = attr->is_special = 0;
|
|
|
|
attr->static_p = 0;
|
1992-05-07 01:13:18 +02:00
|
|
|
attr->next = attrs[index];
|
|
|
|
attrs[index] = attr;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
*name_p = attr->name;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
return attr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Create internal attribute with the given default value. */
|
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
void
|
2003-06-01 18:02:11 +02:00
|
|
|
make_internal_attr (const char *name, rtx value, int special)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_desc *attr;
|
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
attr = find_attr (&name, 1);
|
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 (!attr->default_val);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
attr->is_numeric = 1;
|
1992-03-06 23:25:46 +01:00
|
|
|
attr->is_const = 0;
|
2003-07-09 02:38:40 +02:00
|
|
|
attr->is_special = (special & ATTR_SPECIAL) != 0;
|
2003-07-09 02:44:34 +02:00
|
|
|
attr->static_p = (special & ATTR_STATIC) != 0;
|
1991-10-24 18:21:48 +01:00
|
|
|
attr->default_val = get_attr_value (value, attr, -2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Find the most used value of an attribute. */
|
|
|
|
|
|
|
|
static struct attr_value *
|
2003-06-01 18:02:11 +02:00
|
|
|
find_most_used (struct attr_desc *attr)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
struct attr_value *av;
|
|
|
|
struct attr_value *most_used;
|
|
|
|
int nuses;
|
|
|
|
|
|
|
|
most_used = NULL;
|
|
|
|
nuses = -1;
|
|
|
|
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
|
|
|
if (av->num_insns > nuses)
|
|
|
|
nuses = av->num_insns, most_used = av;
|
|
|
|
|
|
|
|
return most_used;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return (attr_value "n") */
|
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
make_numeric_value (int n)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
static rtx int_values[20];
|
|
|
|
rtx exp;
|
1992-03-06 23:25:46 +01:00
|
|
|
char *p;
|
1991-10-24 18:21:48 +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 (n >= 0);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
if (n < 20 && int_values[n])
|
|
|
|
return int_values[n];
|
|
|
|
|
1992-08-27 22:56:29 +02:00
|
|
|
p = attr_printf (MAX_DIGITS, "%d", n);
|
1992-03-06 23:25:46 +01:00
|
|
|
exp = attr_rtx (CONST_STRING, p);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
if (n < 20)
|
|
|
|
int_values[n] = exp;
|
|
|
|
|
|
|
|
return exp;
|
|
|
|
}
|
2003-06-01 18:02:11 +02:00
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
static rtx
|
2003-06-01 18:02:11 +02:00
|
|
|
copy_rtx_unchanging (rtx orig)
|
1992-05-05 00:57:54 +02:00
|
|
|
{
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
if (ATTR_IND_SIMPLIFIED_P (orig) || ATTR_CURR_SIMPLIFIED_P (orig))
|
1992-05-05 23:48:14 +02:00
|
|
|
return orig;
|
|
|
|
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_CURR_SIMPLIFIED_P (orig) = 1;
|
1992-05-06 04:37:42 +02:00
|
|
|
return orig;
|
1992-05-05 00:57:54 +02:00
|
|
|
}
|
|
|
|
|
1992-09-24 13:28:09 +02:00
|
|
|
/* Determine if an insn has a constant number of delay slots, i.e., the
|
|
|
|
number of delay slots is not a function of the length of the insn. */
|
|
|
|
|
1999-08-24 15:34:04 +02:00
|
|
|
static void
|
2003-06-01 18:02:11 +02:00
|
|
|
write_const_num_delay_slots (void)
|
1992-09-13 17:11:55 +02:00
|
|
|
{
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
struct attr_desc *attr = find_attr (&num_delay_slots_str, 0);
|
1992-09-13 17:11:55 +02:00
|
|
|
struct attr_value *av;
|
|
|
|
|
|
|
|
if (attr)
|
|
|
|
{
|
2003-07-05 07:27:22 +02:00
|
|
|
printf ("int\nconst_num_delay_slots (rtx insn)\n");
|
1992-09-13 17:11:55 +02:00
|
|
|
printf ("{\n");
|
|
|
|
printf (" switch (recog_memoized (insn))\n");
|
|
|
|
printf (" {\n");
|
|
|
|
|
|
|
|
for (av = attr->first_value; av; av = av->next)
|
1992-09-24 13:28:09 +02:00
|
|
|
{
|
|
|
|
length_used = 0;
|
|
|
|
walk_attr_value (av->value);
|
|
|
|
if (length_used)
|
2004-09-09 22:39:28 +02:00
|
|
|
write_insn_cases (av->first_insn, 4);
|
1992-09-24 13:28:09 +02:00
|
|
|
}
|
|
|
|
|
1992-09-13 17:11:55 +02:00
|
|
|
printf (" default:\n");
|
|
|
|
printf (" return 1;\n");
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
printf (" }\n}\n\n");
|
1992-09-13 17:11:55 +02:00
|
|
|
}
|
|
|
|
}
|
1999-09-15 16:13:50 +02:00
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
int
|
2003-06-01 18:02:11 +02:00
|
|
|
main (int argc, char **argv)
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
|
|
|
rtx desc;
|
|
|
|
struct attr_desc *attr;
|
|
|
|
struct insn_def *id;
|
|
|
|
rtx tem;
|
1992-05-07 01:13:18 +02:00
|
|
|
int i;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and bounds- check RTL accesses if --enable-checking.
1999-08-31 12:20 -0700 Zack Weinberg <zack@bitmover.com>
* rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and
bounds- check RTL accesses if --enable-checking.
(RTVEC_ELT): Bounds check if --enable-checking.
(XWINT, XINT, XSTR, XEXP, XVEC, XMODE, XBITMAP, XTREE,
XBBDEF): Use RTL_CHECK1/RTL_CHECK2 as appropriate.
(XVECEXP, XVECLEN): Define in terms of XVEC, RTVEC_ELT, and
GET_NUM_ELEM.
(X0WINT, X0INT, X0STR, X0EXP, X0VEC, X0MODE, X0BITMAP, X0TREE,
X0BBDEF, X0ADVFLAGS): New macros for accessing '0' slots of RTXes.
(ADDR_DIFF_VEC_FLAGS): Use X0ADVFLAGS.
(NOTE_SOURCE_FILE): Use X0STR.
(NOTE_BLOCK_NUMBER, NOTE_EH_HANDLER, LABEL_NUSES,
MEM_ALIAS_SET): Use X0INT.
(NOTE_RANGE_INFO, NOTE_LIVE_INFO, NOTE_BASIC_BLOCK,
JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, CONTAINING_INSN):
Use X0EXP.
* real.h (CONST_DOUBLE_CHAIN): Use X0EXP.
* rtl.c (copy_rtx, copy_most_rtx): Copy '0' slots with X0WINT.
(rtl_check_failed_bounds, rtl_check_failed_type1,
rtl_check_failed_type2, rtvec_check_failed_bounds): New
functions.
(fancy_abort): Fix comment.
* cse.c (canon_hash): Read CONST_DOUBLE data slots with XWINT.
(cse_insn): Decrement LABEL_NUSES for jump target before
deleting jump insn.
* emit-rtl.c (gen_rtx_CONST_DOUBLE): Use X0EXP for slot 1.
* final.c (alter_subreg): Compute regno before changing x to
REG; set REGNO(x) after changing it.
* flow.c (count_basic_blocks): Use XWINT to inspect EH_REGION
notes containing CONST_INTs.
(delete_eh_regions): Use NOTE_EH_HANDLER.
* function.c (put_reg_into_stack): Make reg a MEM before
initializing it.
(fixup_var_refs_insns): Save REG_NOTES (insn) in case we
delete insn.
(gen_mem_addressof): Make reg a MEM before initializing it.
* integrate.c (copy_rtx_and_substitute): Copy '0' slots with
X0WINT.
* local-alloc.c (update_equiv_regs): Zap REG_NOTES before
deleting an insn, not after.
(block_alloc): Only look at PATTERN(insn) if we have to, and
only if it's format class 'i'.
* loop.c (check_dbra_loop): Check bl->biv->add_val is a
CONST_INT before using its INTVAL.
* print-rtl.c (print_rtx): Use X0STR.
* regmove.c (fixup_match_1): Don't look at PATTERN of
non-class-'i' insn chain elements.
* reload.c (loc_mentioned_in_p): Take address of
in->fld[1].rtx directly.
* reload1.c (reload): Change reg to a MEM before initializing
it.
* varasm.c (mark_constant_pool): Skip CONST_DOUBLES, which
have no names.
* config/i386/i386.md (decrement_and_branch_if_zero): Fix typo.
From-SVN: r29008
1999-08-31 21:39:10 +02:00
|
|
|
progname = "genattrtab";
|
|
|
|
|
2001-11-14 21:17:08 +01:00
|
|
|
if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
|
Makefile.in (gensupport.o): Compile for the host.
* Makefile.in (gensupport.o): Compile for the host.
(host-prefix gensuuprt.o): Remove.
(genflags.o): Depend on gensupport.h and OBSTACK_H.
(genattrtab.o): Likewise.
(gencodes.o): Depend on gensupport.h.
(genemit.o, genopinit.o, genrecog.o, genextract.o): Likewise.
(genpeep.o, genattr.o, genoutput.o): Likewise.
* gensupport.c (obstack, rtl_obstack): New.
(init_md_reader): Initialize rtl_obstack.
* gensupport.h (rtl_obstack): Declare.
(message_with_line): Declare.
* genattr.c: Remove all traces of obstack manipulation.
* gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise.
* genopinit.c, genoutput.c, genpeep.c, genrecog.c: Likewise.
* genattrtab.c (obstack, rtl_obstack): Remove.
(main): Don't init rtl_obstack.
* genflags.c: Likewise.
* genrecog.c (message_with_line): Move ...
* gensupport.c: ... here.
From-SVN: r33742
2000-05-07 00:30:13 +02:00
|
|
|
return (FATAL_EXIT_CODE);
|
|
|
|
|
1992-05-05 00:57:54 +02:00
|
|
|
obstack_init (hash_obstack);
|
1992-05-05 23:48:14 +02:00
|
|
|
obstack_init (temp_obstack);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* Set up true and false rtx's */
|
1992-05-05 23:48:14 +02:00
|
|
|
true_rtx = rtx_alloc (CONST_INT);
|
1992-07-06 22:02:55 +02:00
|
|
|
XWINT (true_rtx, 0) = 1;
|
1992-05-05 23:48:14 +02:00
|
|
|
false_rtx = rtx_alloc (CONST_INT);
|
1992-07-06 22:02:55 +02:00
|
|
|
XWINT (false_rtx, 0) = 0;
|
rtl.h (RTX_FLAG): New macro.
* rtl.h (RTX_FLAG): New macro.
* emit-rtl.c (copy_most_rtx): Use macros to access rtx flags.
* final.c (alter_subreg): Use macro to access rtx flag.
* integrate.c (copy_rtx_and_substitute): Use new access macro.
* print-rtl.c (print_rtx): Use new access macro.
* cse.c (insert): Check rtx code before accessing flag.
* genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P,
ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New.
(attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test,
convert_const_symbol_ref, make_canonical, make_alternative_compare,
evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp,
simplify_test_exp, optimize_attrs, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, simplify_with_current_value,
simplify_with_current_value_aux, clear_struct_flag, walk_attr_value,
copy_rtx_unchanging, main): Use new access macros.
From-SVN: r52645
2002-04-23 01:22:33 +02:00
|
|
|
ATTR_IND_SIMPLIFIED_P (true_rtx) = ATTR_IND_SIMPLIFIED_P (false_rtx) = 1;
|
|
|
|
ATTR_PERMANENT_P (true_rtx) = ATTR_PERMANENT_P (false_rtx) = 1;
|
1992-05-05 23:48:14 +02:00
|
|
|
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
alternative_name = DEF_ATTR_STRING ("alternative");
|
|
|
|
length_str = DEF_ATTR_STRING ("length");
|
|
|
|
delay_type_str = DEF_ATTR_STRING ("*delay_type");
|
|
|
|
delay_1_0_str = DEF_ATTR_STRING ("*delay_1_0");
|
|
|
|
num_delay_slots_str = DEF_ATTR_STRING ("*num_delay_slots");
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
printf ("/* Generated automatically by the program `genattrtab'\n\
|
|
|
|
from the machine description file `md'. */\n\n");
|
|
|
|
|
|
|
|
/* Read the machine description. */
|
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
initiate_automaton_gen (argc, argv);
|
1991-10-24 18:21:48 +01:00
|
|
|
while (1)
|
|
|
|
{
|
2000-07-31 01:38:26 +02:00
|
|
|
int lineno;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2000-07-31 01:38:26 +02:00
|
|
|
desc = read_md_rtx (&lineno, &insn_code_number);
|
2000-05-03 19:45:26 +02:00
|
|
|
if (desc == NULL)
|
|
|
|
break;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
2000-05-03 19:45:26 +02:00
|
|
|
switch (GET_CODE (desc))
|
1991-10-24 18:21:48 +01:00
|
|
|
{
|
2000-09-12 17:36:21 +02:00
|
|
|
case DEFINE_INSN:
|
|
|
|
case DEFINE_PEEPHOLE:
|
|
|
|
case DEFINE_ASM_ATTRIBUTES:
|
|
|
|
gen_insn (desc, lineno);
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2000-09-12 17:36:21 +02:00
|
|
|
case DEFINE_ATTR:
|
|
|
|
gen_attr (desc, lineno);
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2000-09-12 17:36:21 +02:00
|
|
|
case DEFINE_DELAY:
|
|
|
|
gen_delay (desc, lineno);
|
|
|
|
break;
|
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case DEFINE_CPU_UNIT:
|
|
|
|
gen_cpu_unit (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case DEFINE_QUERY_CPU_UNIT:
|
|
|
|
gen_query_cpu_unit (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case DEFINE_BYPASS:
|
|
|
|
gen_bypass (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case EXCLUSION_SET:
|
|
|
|
gen_excl_set (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case PRESENCE_SET:
|
|
|
|
gen_presence_set (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2003-01-10 00:15:34 +01:00
|
|
|
case FINAL_PRESENCE_SET:
|
|
|
|
gen_final_presence_set (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case ABSENCE_SET:
|
|
|
|
gen_absence_set (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2003-01-10 00:15:34 +01:00
|
|
|
case FINAL_ABSENCE_SET:
|
|
|
|
gen_final_absence_set (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case DEFINE_AUTOMATON:
|
|
|
|
gen_automaton (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case AUTOMATA_OPTION:
|
|
|
|
gen_automata_option (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case DEFINE_RESERVATION:
|
|
|
|
gen_reserv (desc);
|
|
|
|
break;
|
2003-06-01 18:02:11 +02:00
|
|
|
|
2002-04-30 00:34:36 +02:00
|
|
|
case DEFINE_INSN_RESERVATION:
|
|
|
|
gen_insn_reserv (desc);
|
|
|
|
break;
|
|
|
|
|
2000-09-12 17:36:21 +02:00
|
|
|
default:
|
|
|
|
break;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
2000-05-03 19:45:26 +02:00
|
|
|
if (GET_CODE (desc) != DEFINE_ASM_ATTRIBUTES)
|
2000-09-12 17:36:21 +02:00
|
|
|
insn_index_number++;
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
2000-07-31 01:38:26 +02:00
|
|
|
if (have_error)
|
|
|
|
return FATAL_EXIT_CODE;
|
|
|
|
|
2000-05-03 19:45:26 +02:00
|
|
|
insn_code_number++;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* If we didn't have a DEFINE_ASM_ATTRIBUTES, make a null one. */
|
|
|
|
if (! got_define_asm_attributes)
|
|
|
|
{
|
|
|
|
tem = rtx_alloc (DEFINE_ASM_ATTRIBUTES);
|
|
|
|
XVEC (tem, 0) = rtvec_alloc (0);
|
2000-07-31 01:38:26 +02:00
|
|
|
gen_insn (tem, 0);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Expand DEFINE_DELAY information into new attribute. */
|
|
|
|
if (num_delays)
|
|
|
|
expand_delays ();
|
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
/* Build DFA, output some functions and expand DFA information
|
|
|
|
to new attributes. */
|
|
|
|
if (num_dfa_decls)
|
|
|
|
expand_automata ();
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
printf ("#include \"config.h\"\n");
|
1998-04-02 00:44:48 +02:00
|
|
|
printf ("#include \"system.h\"\n");
|
2002-12-16 19:23:00 +01:00
|
|
|
printf ("#include \"coretypes.h\"\n");
|
|
|
|
printf ("#include \"tm.h\"\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
printf ("#include \"rtl.h\"\n");
|
1999-09-20 12:00:03 +02:00
|
|
|
printf ("#include \"tm_p.h\"\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
printf ("#include \"insn-config.h\"\n");
|
|
|
|
printf ("#include \"recog.h\"\n");
|
|
|
|
printf ("#include \"regs.h\"\n");
|
|
|
|
printf ("#include \"real.h\"\n");
|
|
|
|
printf ("#include \"output.h\"\n");
|
|
|
|
printf ("#include \"insn-attr.h\"\n");
|
Makefile.in (toplev.o): Depend on $(EXPR_H).
* Makefile.in (toplev.o): Depend on $(EXPR_H).
(insn-extract.o, insn-attrtab.o): Depend on toplev.h.
* gansidecl.h: Define ATTRIBUTE_NORETURN.
* genattrtab.c: Have insn-attrtab.c include toplev.h.
* genextract.c: Have insn-extract.c include toplev.h.
* rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
* toplev.c: Include expr.h.
(really_sorry, fancy_abort): Remove prototypes.
(set_target_switch): Add argument in prototype.
(vfatal): Mark prototype with ATTRIBUTE_NORETURN.
(v_really_sorry): Likewise.
(print_version, print_single_switch, print_switch_values): Make
static and add prototype arguments.
(decl_printable_name): Add prototype arguments.
(lang_expand_expr_t): New typedef.
(lang_expand_expr): Declare as a lang_expand_expr_t.
(incomplete_decl_finalize_hook): Add prototype argument.
(decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
(botch): Likewise for variable `s'.
(rest_of_type_compilation): Mark variables `type' and `toplev'
with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
(display_help): Make variable `i' an `unsigned long'.
(main): Remove unused parameter `envp'.
Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
Cast -1 when comparing it with a `size_t'.
* toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
prototype with ATTRIBUTE_NORETURN.
(fatal_insn_not_found, fatal_insn, really_sorry,
push_float_handler, pop_float_handler): Add prototypes.
(fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
(do_abort, botch): Add prototypes.
From-SVN: r22293
1998-09-06 07:56:20 +02:00
|
|
|
printf ("#include \"toplev.h\"\n");
|
2001-04-13 23:10:16 +02:00
|
|
|
printf ("#include \"flags.h\"\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
|
|
|
printf ("#include \"function.h\"\n");
|
2000-09-12 17:36:21 +02:00
|
|
|
printf ("\n");
|
1999-09-12 03:51:28 +02:00
|
|
|
printf ("#define operands recog_data.operand\n\n");
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* Make `insn_alternatives'. */
|
2003-07-19 16:47:15 +02:00
|
|
|
insn_alternatives = oballoc (insn_code_number * sizeof (int));
|
1991-10-24 18:21:48 +01:00
|
|
|
for (id = defs; id; id = id->next)
|
|
|
|
if (id->insn_code >= 0)
|
|
|
|
insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1;
|
|
|
|
|
1992-05-07 01:13:18 +02:00
|
|
|
/* Make `insn_n_alternatives'. */
|
2003-07-19 16:47:15 +02:00
|
|
|
insn_n_alternatives = oballoc (insn_code_number * sizeof (int));
|
1992-05-07 01:13:18 +02:00
|
|
|
for (id = defs; id; id = id->next)
|
|
|
|
if (id->insn_code >= 0)
|
|
|
|
insn_n_alternatives[id->insn_code] = id->num_alternatives;
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
/* Prepare to write out attribute subroutines by checking everything stored
|
|
|
|
away and building the attribute cases. */
|
|
|
|
|
|
|
|
check_defs ();
|
2000-07-31 01:38:26 +02:00
|
|
|
|
1992-05-07 01:13:18 +02:00
|
|
|
for (i = 0; i < MAX_ATTRS_INDEX; i++)
|
|
|
|
for (attr = attrs[i]; attr; attr = attr->next)
|
2000-07-31 01:38:26 +02:00
|
|
|
attr->default_val->value
|
|
|
|
= check_attr_value (attr->default_val->value, attr);
|
|
|
|
|
|
|
|
if (have_error)
|
|
|
|
return FATAL_EXIT_CODE;
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_ATTRS_INDEX; i++)
|
|
|
|
for (attr = attrs[i]; attr; attr = attr->next)
|
|
|
|
fill_attr (attr);
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* Construct extra attributes for `length'. */
|
|
|
|
make_length_attrs ();
|
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* Perform any possible optimizations to speed up compilation. */
|
1991-10-24 18:21:48 +01:00
|
|
|
optimize_attrs ();
|
|
|
|
|
|
|
|
/* Now write out all the `gen_attr_...' routines. Do these before the
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
special routines so that they get defined before they are used. */
|
1991-10-24 18:21:48 +01:00
|
|
|
|
1992-05-07 01:13:18 +02:00
|
|
|
for (i = 0; i < MAX_ATTRS_INDEX; i++)
|
|
|
|
for (attr = attrs[i]; attr; attr = attr->next)
|
|
|
|
{
|
genattrtab.c (expand_units): For large nr opclasses, expand function_units_used with ORX to prevent blowups.
* genattrtab.c (expand_units): For large nr opclasses, expand
function_units_used with ORX to prevent blowups. Tag with FFS.
(num_unit_opclasses): New variable.
(gen_unit): Update it.
(enum operator): Add ORX_OP.
(operate_exp): Treat ORX as or, except don't expand across an if.
Reuse number rtx's after operating on them.
(check_attr_value): Accept IOR, AND, & FFS.
(write_test_expr): Transmute `in_comparison' to `flags'. Allow
for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
(write_expr_attr_cache, write_toplevel_expr): New functions.
(write_attr_get): Handle FFS-tagged expressions.
(make_canonical): Don't expand const attributes.
(convert_const_symbol_ref): Dike out.
(evaluate_eq_attr): Handle SYMBOL_REF.
(main): Don't emit get_attr_foo for const attributes.
* alpha.c (override_options): Reinstate PROCESSOR_EV6.
(alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
* alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
* alpha.md: Redo all of the scheduling, adding EV6 support, and
combining function units where possible.
(attr "type"): Split loads, stores, cmov into int/fp. Combine
multiplies and divides. Add EV6 sqrt, ftoi, itof.
(attr "opsize"): New attribute.
(sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
(movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
to control register allocation.
(movsi2-1, movdi2-1): Likewise.
From-SVN: r17212
1997-12-23 06:34:27 +01:00
|
|
|
if (! attr->is_special && ! attr->is_const)
|
2003-01-20 23:49:33 +01:00
|
|
|
{
|
|
|
|
int insn_alts_p;
|
|
|
|
|
|
|
|
insn_alts_p
|
|
|
|
= (attr->name [0] == '*'
|
genattrtab.c (strcmp_check, [...]): New macros.
* genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
(length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
New variables.
(main): Initialize them.
(find_attr): Canonicalize the attribute name string.
(attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
string arguments.
(attr_printf, attr_eq): Use DEF_ATTR_STRING.
(check_attr_test, check_attr_value, make_length_attrs,
write_length_unit_log, simplify_by_exploding, gen_attr,
write_test_expr, write_attr_value, write_eligible_delay,
write_complex_function, make_internal_attr,
write_const_num_delay_slots): Changed due to change of type of
find_attr.
(fill_attr, evaluate_eq_attr, simplify_and_tree,
attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
strcmp_check.
From-SVN: r73869
2003-11-24 01:30:16 +01:00
|
|
|
&& strcmp (&attr->name[1], INSN_ALTS_FUNC_NAME) == 0);
|
2003-01-20 23:49:33 +01:00
|
|
|
if (insn_alts_p)
|
|
|
|
printf ("\n#if AUTOMATON_ALTS\n");
|
|
|
|
write_attr_get (attr);
|
|
|
|
if (insn_alts_p)
|
|
|
|
printf ("#endif\n\n");
|
|
|
|
}
|
1992-05-07 01:13:18 +02:00
|
|
|
}
|
1991-10-24 18:21:48 +01:00
|
|
|
|
|
|
|
/* Write out delay eligibility information, if DEFINE_DELAY present.
|
|
|
|
(The function to compute the number of delay slots will be written
|
|
|
|
below.) */
|
|
|
|
if (num_delays)
|
|
|
|
{
|
|
|
|
write_eligible_delay ("delay");
|
|
|
|
if (have_annul_true)
|
|
|
|
write_eligible_delay ("annul_true");
|
|
|
|
if (have_annul_false)
|
|
|
|
write_eligible_delay ("annul_false");
|
|
|
|
}
|
|
|
|
|
genattr.c (struct range, [...]): Remove them.
2004-07-19 Paolo Bonzini <bonzini@gnu.org>
* genattr.c (struct range, struct function_unit,
write_units, extend_range, init_range): Remove them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
Output "#define INSN_SCHEDULING" here.
* genattrtab.c (struct range, struct function_unit_op,
struct function_unit, struct dimension, enum operator,
operate_exp, expand_units, simplify_knowing,
encode_units_mask, simplify_by_exploding,
find_and_mark_used_attributes, unmark_used_attributes,
add_values_to_cover, increment_current_value,
test_for_current_value, simplify_with_current_value,
simplify_with_current_value_aux, gen_unit,
write_unit_name, write_function_unit_info,
write_complex_function, write_toplevel_expr,
find_single_value, extend_range): Remove.
(write_attr_get): Do not handle common_av->value
being an FFS.
(struct attr_desc): Remove func_units_p and blockage_p.
(write_attr_valueq): Do not handle them.
(find_attr): Do not clear them.
(make_internal_attr): Do not initialize them.
(main): Remove code dealing with DEFINE_FUNCTION_UNIT.
* sched-vis.c (init_target_units, insn_print_units,
init_block_visualization, print_block_visualization,
visualize_scheduled_insns, visualize_no_unit,
visualize_stall_cycles, visualize_alloc,
visualize_free, target_units, get_visual_tbl_length,
MAX_VISUAL_LINES, INSN_LEN, n_visual_lines,
visual_tbl_line_length, visual_tbl, n_vis_no_unit,
MAX_VISUAL_NO_UNIT, vis_no_unit): Remove.
* haifa-sched.c (blockage_range, clear_units,
schedule_unit, actual_hazard, potential_hazard,
insn_unit, unit_last_insn, unit_tick,
actual_hazard_this_instance, potential_hazard,
schedule_unit, max_insn_queue_index_value): Remove.
(MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to
max_insn_queue_index.
* rtl.def (DEFINE_FUNCTION_UNIT): Remove.
* doc/md.texi (Processor pipeline description): Remove
references to old pipeline descriptions.
(Automaton pipeline description): Merge with the above.
(Old pipeline description, Comparison of the two descriptions):
Remove.
* bt-load.c (migrate_btr_def): Remove references to
use_pipeline_interface.
* haifa-sched.c (insn_cost, schedule_insn,
schedule_block, advance_one_cycle, sched_init,
queue_to_ready, sched_finish): Likewise.
* modulo-sched.c (sms_schedule, advance_one_cycle,
ps_has_conflicts): Likewise.
* sched-rgn.c (init_ready): Likewise.
(debug_dependencies): Likewise, and remove an "if (1)".
* target.h (use_dfa_pipeline_interface): Remove.
* config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
* doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove.
From-SVN: r84944
2004-07-20 09:27:18 +02:00
|
|
|
/* Output code for pipeline hazards recognition based on DFA
|
|
|
|
(deterministic finite-state automata). */
|
|
|
|
if (num_dfa_decls)
|
|
|
|
write_automata ();
|
1991-10-24 18:21:48 +01:00
|
|
|
|
2003-06-29 15:53:12 +02:00
|
|
|
/* Write out constant delay slot info. */
|
1992-09-13 17:11:55 +02:00
|
|
|
write_const_num_delay_slots ();
|
|
|
|
|
final.c (insn_last_address, [...]): New variables.
* final.c (insn_last_address, insn_current_align, uid_align):
New variables.
(in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
(insn_current_reference_address): Likewise.
(shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
(label_to_alignment): New function.
* genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
insn_current_reference_address instead of insn_current_address.
(or_attr_value, write_length_unit_log): New functions.
(main): Call write_length_unit_log.
(write_const_num_delay_slots): Output extra '\n'.
* alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
replace with:
(LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
* i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
* arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
(LOOP_ALIGN).
* i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
(LABEL_ALIGN_AFTER_BARRIER).
* ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
* ns32k/tek6000.h: Likewise.
* i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
* i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
ASM_OUTPUT_ALIGN_CODE.
From-SVN: r18357
1998-03-02 12:54:35 +01:00
|
|
|
write_length_unit_log ();
|
|
|
|
|
1991-10-24 18:21:48 +01:00
|
|
|
fflush (stdout);
|
1999-09-15 16:13:50 +02:00
|
|
|
return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
|
1991-10-24 18:21:48 +01:00
|
|
|
}
|
1999-09-12 14:46:08 +02:00
|
|
|
|
|
|
|
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
|
|
|
|
const char *
|
2003-06-01 18:02:11 +02:00
|
|
|
get_insn_name (int code ATTRIBUTE_UNUSED)
|
1999-09-12 14:46:08 +02:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|