1991-12-30 04:19:53 +01:00
|
|
|
|
/* Expand the basic unary and binary arithmetic operations, for GNU compiler.
|
2000-02-26 14:55:09 +01:00
|
|
|
|
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
alias.c, [...]: Update copyright.
* alias.c, basic-block.h, c-common.c, c-common.h,
c-cppbuiltin.c, c-opts.c, c-pragma.c, c-pretty-print.c,
calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c,
combine.c, cppcharset.c, cpphash.h, cppinit.c, cpplib.c,
cpplib.h, cppmacro.c, crtstuff.c, cselib.c, cselib.h,
defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c,
expr.h, fix-header.c, function.h, gcc.c, gcse.c, genattrtab.c,
genautomata.c, genconditions.c, genemit.c, genflags.c,
gengtype.c, gengtype.h, genopinit.c, genrecog.c, gensupport.c,
ggc-zone.c, graph.c, haifa-sched.c, input.h, integrate.c,
langhooks-def.h, langhooks.c, langhooks.h, line-map.c,
line-map.h, local-alloc.c, optabs.c, optabs.h, postreload.c,
ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c,
rtl.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h,
target.h, targhooks.c, toplev.h, tree-inline.c, unwind-pe.h,
unwind.h, varray.c, varray.h: Update copyright.
From-SVN: r76302
2004-01-21 21:40:04 +01:00
|
|
|
|
1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
1991-12-30 04:19:53 +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-12-30 04:19:53 +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-12-30 04:19:53 +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-12-30 04:19:53 +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
|
|
|
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
|
02111-1307, USA. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
1998-03-20 15:58:42 +01:00
|
|
|
|
#include "system.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
|
#include "coretypes.h"
|
|
|
|
|
#include "tm.h"
|
c-aux-info.c, [...]: Include toplev.h for real declaration of trim_filename.
1999-04-17 20:11 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* c-aux-info.c, emit-rtl.c, explow.c, expmed.c, gcse.c,
haifa-sched.c, optabs.c, reorg.c, resource.c, sched.c: Include
toplev.h for real declaration of trim_filename.
* Makefile.in: Update dependencies.
From-SVN: r26523
1999-04-17 19:14:58 +02:00
|
|
|
|
#include "toplev.h"
|
c-aux-info.c (data_type, [...]): Qualify a char* with the `const' keyword.
* c-aux-info.c (data_type, affix_data_type, gen_decl,
gen_formal_list_for_type, gen_formal_list_for_func_def, gen_type):
Qualify a char* with the `const' keyword.
* c-common.c (declare_hidden_char_array, add_attribute, if_elt,
declare_function_name, decl_attributes, format_char_info,
check_format_info, binary_op_error): Likewise.
* cexp.y (yyerror, error, pedwarn, warning, token): Likewise.
* gcse.c (dump_hash_table): Likewise.
* integrate.c (function_cannot_inline_p): Likewise
* optabs.c: Include insn-config.h earlier.
(init_libfuncs, init_integral_libfuncs, init_floating_libfuncs):
Qualify a char* with the `const' keyword.
* real.c (asctoe24, asctoe53, asctoe64, asctoe113, asctoe,
asctoeg, mtherr, ereal_atof): Likewise.
* real.h (ereal_atof): Likewise.
* sbitmap.c (dump_sbitmap_vector): Likewise.
* sbitmap.h (dump_sbitmap_vector): Likewise.
* stmt.c (nesting, n_occurrences, expand_start_case): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (function_cannot_inline_p, expand_start_case): Likewise.
From-SVN: r25614
1999-03-06 06:34:26 +01:00
|
|
|
|
|
|
|
|
|
/* Include insn-config.h before expr.h so that HAVE_conditional_move
|
2001-08-13 01:40:53 +02:00
|
|
|
|
is properly defined. */
|
c-aux-info.c (data_type, [...]): Qualify a char* with the `const' keyword.
* c-aux-info.c (data_type, affix_data_type, gen_decl,
gen_formal_list_for_type, gen_formal_list_for_func_def, gen_type):
Qualify a char* with the `const' keyword.
* c-common.c (declare_hidden_char_array, add_attribute, if_elt,
declare_function_name, decl_attributes, format_char_info,
check_format_info, binary_op_error): Likewise.
* cexp.y (yyerror, error, pedwarn, warning, token): Likewise.
* gcse.c (dump_hash_table): Likewise.
* integrate.c (function_cannot_inline_p): Likewise
* optabs.c: Include insn-config.h earlier.
(init_libfuncs, init_integral_libfuncs, init_floating_libfuncs):
Qualify a char* with the `const' keyword.
* real.c (asctoe24, asctoe53, asctoe64, asctoe113, asctoe,
asctoeg, mtherr, ereal_atof): Likewise.
* real.h (ereal_atof): Likewise.
* sbitmap.c (dump_sbitmap_vector): Likewise.
* sbitmap.h (dump_sbitmap_vector): Likewise.
* stmt.c (nesting, n_occurrences, expand_start_case): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (function_cannot_inline_p, expand_start_case): Likewise.
From-SVN: r25614
1999-03-06 06:34:26 +01:00
|
|
|
|
#include "insn-config.h"
|
1991-12-30 04:19:53 +01:00
|
|
|
|
#include "rtl.h"
|
|
|
|
|
#include "tree.h"
|
1999-09-20 12:00:03 +02:00
|
|
|
|
#include "tm_p.h"
|
1991-12-30 04:19:53 +01:00
|
|
|
|
#include "flags.h"
|
1999-08-09 16:00:21 +02:00
|
|
|
|
#include "function.h"
|
2001-03-28 13:04:51 +02:00
|
|
|
|
#include "except.h"
|
1991-12-30 04:19:53 +01:00
|
|
|
|
#include "expr.h"
|
expr.h: Split out optab- and libfunc-related code to...
* expr.h: Split out optab- and libfunc-related code to...
* optabs.h, libfuncs.h: ... these new headers.
* Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h.
(OPTABS_H): New.
(various .o rules): Add $(OPTABS_H) and/or libfuncs.h to
dependencies.
* mkconfig.sh: Don't include insn-codes.h from config.h.
* reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether
enum insn_code is available. Move reload_in_optab and
reload_out_optab array declarations to optabs.h.
* regmove.c (gen_add3_insn): Move to optabs.c, export from
there, prototype in expr.h.
* gencodes.c: Cleanup: zap global variables, don't use
printf where puts will do, don't bother defining MAX_INSN_CODE
which nothing uses, let CODE_FOR_nothing get its value implicitly.
* genemit.c, genopinit.c: Include optabs.h in generated file.
* genoutput.c: Include insn-codes.h in generated file.
* builtins.c, caller-save.c, combine.c, doloop.c, explow.c,
expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c,
reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c,
config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c,
config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c:
Include optabs.h.
* builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c,
optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/m88k/m88k.c, config/sparc/sparc.c:
Include libfuncs.h.
* reload.c: Include expr.h and optabs.h before reload.h.
* config/alpha/alpha.c: Include tree.h before reload.h.
* config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h,
and reload.h in that order.
* config/sparc/sparc.c: Include debug.h.
* recog.c: Include insn-codes.h.
cp:
* Make-lang.in (cp/except.o): Add libfuncs.h to dependencies.
* except.c: Include libfuncs.h.
java:
* Make-lang.in (java/decl.o): Update dependencies.
* decl.c: Include libfuncs.h, don't include toplev.h.
From-SVN: r44858
2001-08-13 17:56:51 +02:00
|
|
|
|
#include "optabs.h"
|
|
|
|
|
#include "libfuncs.h"
|
1991-12-30 04:19:53 +01:00
|
|
|
|
#include "recog.h"
|
1993-04-05 00:14:12 +02:00
|
|
|
|
#include "reload.h"
|
Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
(varasm.o): Likewise.
(function.o): Likewise.
(stmt.o): Likewise.
(except.o): Likewise.
(optabs.o): Likewise.
(emit-rtl.o): Likewise.
* emit-rtl.c: Include ggc.h.
(sequence_element_free_list): Remove, and all references.
(mark_sequence): New functions.
(mark_emit_state): New function.
* except.c: Include ggc.h.
(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
(mark_tree_label_node): New functions.
(mark_eh_state): New function.
* function.c: Include ggc.h.
(mark_temp_slot, mark_function_chain): New functions.
(mark_function_state): New function.
(init_function_once): New function.
* function.h (init_function_once): New function.
* ggc-callbacks.c (lang_mark_false_label_stack): New function.
* ggc.h (label_node): Declare.
(eh_status, emit_status, stmt_status, varasm_status): Likewise.
(lang_mark_false_label_stack): New function.
(mark_temp_slot): Remove declaration.
(mark_function_chain): Likewise.
(mark_eh_state): Adjust prototype.
(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
Likewise.
* optabs.c: Include ggc.h.
(mark_optab): New function.
(init_optabs): Add gc roots.
* stmt.c: Include ggc.h.
(mark_cond_nesting, mark_loop_nesting): New functions.
(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
(mark_stmt_state): New function.
* toplev.c (compile_file): Call init_function_once.
* tree.c: Include ggc.h.
(type_hash): Move declaration earlier in file.
(TYPE_HASH_SIZE, type_hash_table): Likewise.
(init_obstacks): Add gc roots.
(mark_type_hash): New function.
* varasm.c: Include ggc.h.
(mark_pool_constant): New function.
(mark_varasm_state): New function.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29119
1999-09-05 04:41:35 +02:00
|
|
|
|
#include "ggc.h"
|
2000-01-11 00:48:03 +01:00
|
|
|
|
#include "real.h"
|
2003-01-09 12:47:35 +01:00
|
|
|
|
#include "basic-block.h"
|
target.h (init_libfuncs): New hook.
* target.h (init_libfuncs): New hook.
* target-def.h: Default TARGET_INIT_BUILTINS and
TARGET_INIT_LIBFUNCS to hook_void_void. Add
TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER.
* builtins.c (default_init_builtins): Delete.
* expr.h (default_init_builtins): Delete prototype.
* doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST.
Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL.
Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL,
DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL,
MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL,
and UMODDI3_LIBCALL,
* Makefile.in (optabs.o): Depends on target.h.
* defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL.
* optabs.c: Include target.h.
(prepare_float_lib_cmp): No need for #ifdef around use of
FLOAT_LIB_COMPARE_RETURNS_BOOL.
(set_optab_libfunc): New function.
(init_optabs): Delete use of all *_LIBCALL defines.
Call targetm.init_libfuncs not INIT_TARGET_OPTABS.
* optabs.h: Prototype set_optab_libfunc.
* config.gcc: Remove all references to pa/long_double.h,
ia64/hpux_longdouble.h, and gofast.h.
(mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST
to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file.
* config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c
* config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c
* config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c, config/vax/vax.c:
Provide a definition for TARGET_INIT_LIBFUNCS. Where
necessary, include optabs.h, libfuncs.h, and/or config/gofast.h.
* config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h
* config/avr/avr.h, config/cris/cris.h, config/frv/frv.h
* config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h
* config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h
* config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h
* config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h
* config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h
* config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS,
INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros.
* config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0.
Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here.
* config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE,
HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here.
* config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete.
* config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC.
* config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 0.
* config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 1.
* config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 0.
* config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h:
Define US_SOFTWARE_GOFAST.
* config/vax/vax.h: Default TARGET_ELF to 0.
* config/vax/elf.h: Redefine TARGET_ELF to 1.
* config/gofast.h: Don't define any macros here. Provide one
static function, gofast_maybe_init_libfuncs, which does what
INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST
is already defined. Do not clear negation libfuncs. Do
not mess with HFmode, XFmode, or TFmode libfuncs.
* config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME.
From-SVN: r72009
2003-10-02 02:44:29 +02:00
|
|
|
|
#include "target.h"
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Each optab contains info on how this target machine
|
|
|
|
|
can perform a particular operation
|
|
|
|
|
for all sizes and kinds of operands.
|
|
|
|
|
|
|
|
|
|
The operation to be performed is often specified
|
|
|
|
|
by passing one of these optabs as an argument.
|
|
|
|
|
|
|
|
|
|
See expr.h for documentation of these optabs. */
|
|
|
|
|
|
1999-09-05 00:08:44 +02:00
|
|
|
|
optab optab_table[OTI_MAX];
|
|
|
|
|
|
|
|
|
|
rtx libfunc_table[LTI_MAX];
|
1992-03-29 06:32:58 +02:00
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* Tables of patterns for converting one mode to another. */
|
|
|
|
|
convert_optab convert_optab_table[CTI_MAX];
|
1993-03-30 22:29:35 +02:00
|
|
|
|
|
1993-08-03 23:33:37 +02:00
|
|
|
|
/* Contains the optab used for each rtx code. */
|
|
|
|
|
optab code_to_optab[NUM_RTX_CODE + 1];
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
|
|
|
|
|
gives the gen_function to make a branch to test that condition. */
|
|
|
|
|
|
|
|
|
|
rtxfun bcc_gen_fctn[NUM_RTX_CODE];
|
|
|
|
|
|
|
|
|
|
/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
|
|
|
|
|
gives the insn code to make a store-condition insn
|
|
|
|
|
to test that condition. */
|
|
|
|
|
|
|
|
|
|
enum insn_code setcc_gen_code[NUM_RTX_CODE];
|
|
|
|
|
|
1995-01-25 05:18:30 +01:00
|
|
|
|
#ifdef HAVE_conditional_move
|
|
|
|
|
/* Indexed by the machine mode, gives the insn code to make a conditional
|
|
|
|
|
move insn. This is not indexed by the rtx-code like bcc_gen_fctn and
|
|
|
|
|
setcc_gen_code to cut down on the number of named patterns. Consider a day
|
|
|
|
|
when a lot more rtx codes are conditional (eg: for the ARM). */
|
|
|
|
|
|
|
|
|
|
enum insn_code movcc_gen_code[NUM_MACHINE_MODES];
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-06-05 18:31:49 +02:00
|
|
|
|
/* The insn generating function can not take an rtx_code argument.
|
|
|
|
|
TRAP_RTX is used as an rtx argument. Its code is replaced with
|
|
|
|
|
the code to be used in the trap insn and all other fields are ignored. */
|
|
|
|
|
static GTY(()) rtx trap_rtx;
|
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
|
static int add_equal_note (rtx, rtx, enum rtx_code, rtx, rtx);
|
|
|
|
|
static rtx widen_operand (rtx, enum machine_mode, enum machine_mode, int,
|
|
|
|
|
int);
|
|
|
|
|
static int expand_cmplxdiv_straight (rtx, rtx, rtx, rtx, rtx, rtx,
|
|
|
|
|
enum machine_mode, int,
|
|
|
|
|
enum optab_methods, enum mode_class,
|
|
|
|
|
optab);
|
|
|
|
|
static int expand_cmplxdiv_wide (rtx, rtx, rtx, rtx, rtx, rtx,
|
|
|
|
|
enum machine_mode, int, enum optab_methods,
|
|
|
|
|
enum mode_class, optab);
|
|
|
|
|
static void prepare_cmp_insn (rtx *, rtx *, enum rtx_code *, rtx,
|
|
|
|
|
enum machine_mode *, int *,
|
|
|
|
|
enum can_compare_purpose);
|
|
|
|
|
static enum insn_code can_fix_p (enum machine_mode, enum machine_mode, int,
|
|
|
|
|
int *);
|
|
|
|
|
static enum insn_code can_float_p (enum machine_mode, enum machine_mode, int);
|
|
|
|
|
static optab new_optab (void);
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
static convert_optab new_convert_optab (void);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
static inline optab init_optab (enum rtx_code);
|
|
|
|
|
static inline optab init_optabv (enum rtx_code);
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
static inline convert_optab init_convert_optab (enum rtx_code);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
static void init_libfuncs (optab, int, int, const char *, int);
|
|
|
|
|
static void init_integral_libfuncs (optab, const char *, int);
|
|
|
|
|
static void init_floating_libfuncs (optab, const char *, int);
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
static void init_interclass_conv_libfuncs (convert_optab, const char *,
|
|
|
|
|
enum mode_class, enum mode_class);
|
|
|
|
|
static void init_intraclass_conv_libfuncs (convert_optab, const char *,
|
|
|
|
|
enum mode_class, bool);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
static void emit_cmp_and_jump_insn_1 (rtx, rtx, enum machine_mode,
|
|
|
|
|
enum rtx_code, int, rtx);
|
|
|
|
|
static void prepare_float_lib_cmp (rtx *, rtx *, enum rtx_code *,
|
|
|
|
|
enum machine_mode *, int *);
|
|
|
|
|
static rtx expand_vector_binop (enum machine_mode, optab, rtx, rtx, rtx, int,
|
|
|
|
|
enum optab_methods);
|
|
|
|
|
static rtx expand_vector_unop (enum machine_mode, optab, rtx, rtx, int);
|
|
|
|
|
static rtx widen_clz (enum machine_mode, rtx, rtx);
|
|
|
|
|
static rtx expand_parity (enum machine_mode, rtx, rtx);
|
2003-06-05 18:31:49 +02:00
|
|
|
|
|
|
|
|
|
#ifndef HAVE_conditional_trap
|
|
|
|
|
#define HAVE_conditional_trap 0
|
|
|
|
|
#define gen_conditional_trap(a,b) (abort (), NULL_RTX)
|
|
|
|
|
#endif
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
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
|
|
|
|
/* Add a REG_EQUAL note to the last insn in INSNS. TARGET is being set to
|
1991-12-30 04:19:53 +01:00
|
|
|
|
the result of operation CODE applied to OP0 (and OP1 if it is a binary
|
|
|
|
|
operation).
|
|
|
|
|
|
|
|
|
|
If the last insn does not set TARGET, don't do anything, but return 1.
|
|
|
|
|
|
|
|
|
|
If a previous insn sets TARGET and TARGET is one of OP0 or OP1,
|
|
|
|
|
don't add the REG_EQUAL note but return 0. Our caller can then try
|
|
|
|
|
again, ensuring that TARGET is not one of the operands. */
|
|
|
|
|
|
|
|
|
|
static int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
add_equal_note (rtx insns, rtx target, enum rtx_code code, rtx op0, rtx op1)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
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
|
|
|
|
rtx last_insn, insn, set;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx note;
|
|
|
|
|
|
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
|
|
|
|
if (! insns
|
|
|
|
|
|| ! INSN_P (insns)
|
|
|
|
|
|| NEXT_INSN (insns) == NULL_RTX)
|
|
|
|
|
abort ();
|
|
|
|
|
|
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_COMM_ARITH
|
|
|
|
|
&& GET_RTX_CLASS (code) != RTX_BIN_ARITH
|
|
|
|
|
&& GET_RTX_CLASS (code) != RTX_COMM_COMPARE
|
|
|
|
|
&& GET_RTX_CLASS (code) != RTX_COMPARE
|
|
|
|
|
&& GET_RTX_CLASS (code) != RTX_UNARY)
|
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
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (target) == ZERO_EXTRACT)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
for (last_insn = insns;
|
|
|
|
|
NEXT_INSN (last_insn) != NULL_RTX;
|
|
|
|
|
last_insn = NEXT_INSN (last_insn))
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
set = single_set (last_insn);
|
|
|
|
|
if (set == NULL_RTX)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
if (! rtx_equal_p (SET_DEST (set), target)
|
2003-03-04 05:25:51 +01:00
|
|
|
|
/* For a STRICT_LOW_PART, the REG_NOTE applies to what is inside it. */
|
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
|
|
|
|
&& (GET_CODE (SET_DEST (set)) != STRICT_LOW_PART
|
2003-03-04 05:25:51 +01:00
|
|
|
|
|| ! rtx_equal_p (XEXP (SET_DEST (set), 0), target)))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
/* If TARGET is in OP0 or OP1, check if anything in SEQ sets TARGET
|
|
|
|
|
besides the last insn. */
|
|
|
|
|
if (reg_overlap_mentioned_p (target, op0)
|
|
|
|
|
|| (op1 && reg_overlap_mentioned_p (target, op1)))
|
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
|
|
|
|
{
|
|
|
|
|
insn = PREV_INSN (last_insn);
|
|
|
|
|
while (insn != NULL_RTX)
|
|
|
|
|
{
|
|
|
|
|
if (reg_set_p (target, insn))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
insn = PREV_INSN (insn);
|
|
|
|
|
}
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
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)
|
1998-06-24 16:49:51 +02:00
|
|
|
|
note = gen_rtx_fmt_e (code, GET_MODE (target), copy_rtx (op0));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
else
|
1998-06-24 16:49:51 +02:00
|
|
|
|
note = gen_rtx_fmt_ee (code, GET_MODE (target), copy_rtx (op0), copy_rtx (op1));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
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
|
|
|
|
set_unique_reg_note (last_insn, REG_EQUAL, note);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
1993-08-09 13:30:54 +02:00
|
|
|
|
/* Widen OP to MODE and return the rtx for the widened operand. UNSIGNEDP
|
|
|
|
|
says whether OP is signed or unsigned. NO_EXTEND is nonzero if we need
|
2003-07-06 11:56:09 +02:00
|
|
|
|
not actually do a sign-extend or zero-extend, but can leave the
|
1993-08-09 13:30:54 +02:00
|
|
|
|
higher-order bits of the result rtx undefined, for example, in the case
|
|
|
|
|
of logical operations, but not right shifts. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
widen_operand (rtx op, enum machine_mode mode, enum machine_mode oldmode,
|
|
|
|
|
int unsignedp, int no_extend)
|
1993-08-09 13:30:54 +02:00
|
|
|
|
{
|
|
|
|
|
rtx result;
|
|
|
|
|
|
2002-02-24 22:43:52 +01:00
|
|
|
|
/* If we don't have to extend and this is a constant, return it. */
|
|
|
|
|
if (no_extend && GET_MODE (op) == VOIDmode)
|
|
|
|
|
return op;
|
|
|
|
|
|
|
|
|
|
/* If we must extend do so. If OP is a SUBREG for a promoted object, also
|
|
|
|
|
extend since it will be more efficient to do so unless the signedness of
|
|
|
|
|
a promoted object differs from our extension. */
|
1993-08-09 13:30:54 +02:00
|
|
|
|
if (! no_extend
|
2002-02-24 13:46:52 +01:00
|
|
|
|
|| (GET_CODE (op) == SUBREG && SUBREG_PROMOTED_VAR_P (op)
|
|
|
|
|
&& SUBREG_PROMOTED_UNSIGNED_P (op) == unsignedp))
|
1993-09-09 21:50:55 +02:00
|
|
|
|
return convert_modes (mode, oldmode, op, unsignedp);
|
1993-08-09 13:30:54 +02:00
|
|
|
|
|
|
|
|
|
/* If MODE is no wider than a single word, we return a paradoxical
|
|
|
|
|
SUBREG. */
|
|
|
|
|
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
|
1998-06-24 16:49:51 +02:00
|
|
|
|
return gen_rtx_SUBREG (mode, force_reg (GET_MODE (op), op), 0);
|
1993-08-09 13:30:54 +02:00
|
|
|
|
|
|
|
|
|
/* Otherwise, get an object of MODE, clobber it, and set the low-order
|
|
|
|
|
part to OP. */
|
|
|
|
|
|
|
|
|
|
result = gen_reg_rtx (mode);
|
1998-06-24 16:49:51 +02:00
|
|
|
|
emit_insn (gen_rtx_CLOBBER (VOIDmode, result));
|
1993-08-09 13:30:54 +02:00
|
|
|
|
emit_move_insn (gen_lowpart (GET_MODE (op), result), op);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-18 03:05:14 +02:00
|
|
|
|
/* Generate code to perform a straightforward complex divide. */
|
|
|
|
|
|
|
|
|
|
static int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_cmplxdiv_straight (rtx real0, rtx real1, rtx imag0, rtx imag1,
|
|
|
|
|
rtx realr, rtx imagr, enum machine_mode submode,
|
|
|
|
|
int unsignedp, enum optab_methods methods,
|
|
|
|
|
enum mode_class class, optab binoptab)
|
1999-05-18 03:05:14 +02:00
|
|
|
|
{
|
|
|
|
|
rtx divisor;
|
|
|
|
|
rtx real_t, imag_t;
|
|
|
|
|
rtx temp1, temp2;
|
|
|
|
|
rtx res;
|
2000-10-18 23:33:41 +02:00
|
|
|
|
optab this_add_optab = add_optab;
|
|
|
|
|
optab this_sub_optab = sub_optab;
|
|
|
|
|
optab this_neg_optab = neg_optab;
|
|
|
|
|
optab this_mul_optab = smul_optab;
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
if (binoptab == sdivv_optab)
|
|
|
|
|
{
|
|
|
|
|
this_add_optab = addv_optab;
|
|
|
|
|
this_sub_optab = subv_optab;
|
|
|
|
|
this_neg_optab = negv_optab;
|
|
|
|
|
this_mul_optab = smulv_optab;
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-18 03:05:14 +02:00
|
|
|
|
/* Don't fetch these from memory more than once. */
|
|
|
|
|
real0 = force_reg (submode, real0);
|
|
|
|
|
real1 = force_reg (submode, real1);
|
|
|
|
|
|
|
|
|
|
if (imag0 != 0)
|
|
|
|
|
imag0 = force_reg (submode, imag0);
|
|
|
|
|
|
|
|
|
|
imag1 = force_reg (submode, imag1);
|
|
|
|
|
|
|
|
|
|
/* Divisor: c*c + d*d. */
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, real1, real1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp2 = expand_binop (submode, this_mul_optab, imag1, imag1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0 || temp2 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
divisor = expand_binop (submode, this_add_optab, temp1, temp2,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
if (divisor == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2002-07-10 23:13:26 +02:00
|
|
|
|
if (imag0 == 0)
|
1999-05-18 03:05:14 +02:00
|
|
|
|
{
|
|
|
|
|
/* Mathematically, ((a)(c-id))/divisor. */
|
|
|
|
|
/* Computationally, (a+i0) / (c+id) = (ac/(cc+dd)) + i(-ad/(cc+dd)). */
|
|
|
|
|
|
|
|
|
|
/* Calculate the dividend. */
|
2000-10-18 23:33:41 +02:00
|
|
|
|
real_t = expand_binop (submode, this_mul_optab, real0, real1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
imag_t = expand_binop (submode, this_mul_optab, real0, imag1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (real_t == 0 || imag_t == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
imag_t = expand_unop (submode, this_neg_optab, imag_t,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Mathematically, ((a+ib)(c-id))/divider. */
|
|
|
|
|
/* Calculate the dividend. */
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, real0, real1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp2 = expand_binop (submode, this_mul_optab, imag0, imag1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0 || temp2 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
real_t = expand_binop (submode, this_add_optab, temp1, temp2,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, imag0, real1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp2 = expand_binop (submode, this_mul_optab, real0, imag1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0 || temp2 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
imag_t = expand_binop (submode, this_sub_optab, temp1, temp2,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (real_t == 0 || imag_t == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, real_t, divisor,
|
|
|
|
|
realr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
real_t, divisor, realr, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (res != realr)
|
|
|
|
|
emit_move_insn (realr, res);
|
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, imag_t, divisor,
|
|
|
|
|
imagr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
imag_t, divisor, imagr, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (res != imagr)
|
|
|
|
|
emit_move_insn (imagr, res);
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate code to perform a wide-input-range-acceptable complex divide. */
|
|
|
|
|
|
|
|
|
|
static int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_cmplxdiv_wide (rtx real0, rtx real1, rtx imag0, rtx imag1, rtx realr,
|
|
|
|
|
rtx imagr, enum machine_mode submode, int unsignedp,
|
|
|
|
|
enum optab_methods methods, enum mode_class class,
|
|
|
|
|
optab binoptab)
|
1999-05-18 03:05:14 +02:00
|
|
|
|
{
|
|
|
|
|
rtx ratio, divisor;
|
|
|
|
|
rtx real_t, imag_t;
|
|
|
|
|
rtx temp1, temp2, lab1, lab2;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx res;
|
2000-10-18 23:33:41 +02:00
|
|
|
|
optab this_add_optab = add_optab;
|
|
|
|
|
optab this_sub_optab = sub_optab;
|
|
|
|
|
optab this_neg_optab = neg_optab;
|
|
|
|
|
optab this_mul_optab = smul_optab;
|
|
|
|
|
|
|
|
|
|
if (binoptab == sdivv_optab)
|
|
|
|
|
{
|
|
|
|
|
this_add_optab = addv_optab;
|
|
|
|
|
this_sub_optab = subv_optab;
|
|
|
|
|
this_neg_optab = negv_optab;
|
|
|
|
|
this_mul_optab = smulv_optab;
|
|
|
|
|
}
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1999-05-18 03:05:14 +02:00
|
|
|
|
/* Don't fetch these from memory more than once. */
|
|
|
|
|
real0 = force_reg (submode, real0);
|
|
|
|
|
real1 = force_reg (submode, real1);
|
|
|
|
|
|
|
|
|
|
if (imag0 != 0)
|
|
|
|
|
imag0 = force_reg (submode, imag0);
|
|
|
|
|
|
|
|
|
|
imag1 = force_reg (submode, imag1);
|
|
|
|
|
|
1999-06-08 07:50:01 +02:00
|
|
|
|
/* XXX What's an "unsigned" complex number? */
|
|
|
|
|
if (unsignedp)
|
|
|
|
|
{
|
|
|
|
|
temp1 = real1;
|
|
|
|
|
temp2 = imag1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_abs (submode, real1, NULL_RTX, unsignedp, 1);
|
|
|
|
|
temp2 = expand_abs (submode, imag1, NULL_RTX, unsignedp, 1);
|
1999-06-08 07:50:01 +02:00
|
|
|
|
}
|
1999-05-18 03:05:14 +02:00
|
|
|
|
|
|
|
|
|
if (temp1 == 0 || temp2 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
mode = GET_MODE (temp1);
|
|
|
|
|
lab1 = gen_label_rtx ();
|
|
|
|
|
emit_cmp_and_jump_insns (temp1, temp2, LT, NULL_RTX,
|
2001-11-16 00:44:58 +01:00
|
|
|
|
mode, unsignedp, lab1);
|
1999-05-18 03:05:14 +02:00
|
|
|
|
|
|
|
|
|
/* |c| >= |d|; use ratio d/c to scale dividend and divisor. */
|
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
ratio = expand_binop (submode, binoptab, imag1, real1,
|
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
ratio = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
imag1, real1, NULL_RTX, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (ratio == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Calculate divisor. */
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, imag1, ratio,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
divisor = expand_binop (submode, this_add_optab, temp1, real1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (divisor == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Calculate dividend. */
|
|
|
|
|
|
2002-07-10 23:13:26 +02:00
|
|
|
|
if (imag0 == 0)
|
1999-05-18 03:05:14 +02:00
|
|
|
|
{
|
|
|
|
|
real_t = real0;
|
|
|
|
|
|
|
|
|
|
/* Compute a / (c+id) as a / (c+d(d/c)) + i (-a(d/c)) / (c+d(d/c)). */
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
imag_t = expand_binop (submode, this_mul_optab, real0, ratio,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (imag_t == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
imag_t = expand_unop (submode, this_neg_optab, imag_t,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (real_t == 0 || imag_t == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Compute (a+ib)/(c+id) as
|
|
|
|
|
(a+b(d/c))/(c+d(d/c) + i(b-a(d/c))/(c+d(d/c)). */
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, imag0, ratio,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
real_t = expand_binop (submode, this_add_optab, temp1, real0,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, real0, ratio,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
imag_t = expand_binop (submode, this_sub_optab, imag0, temp1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (real_t == 0 || imag_t == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, real_t, divisor,
|
|
|
|
|
realr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
real_t, divisor, realr, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (res != realr)
|
|
|
|
|
emit_move_insn (realr, res);
|
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, imag_t, divisor,
|
|
|
|
|
imagr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
imag_t, divisor, imagr, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (res != imagr)
|
|
|
|
|
emit_move_insn (imagr, res);
|
|
|
|
|
|
|
|
|
|
lab2 = gen_label_rtx ();
|
|
|
|
|
emit_jump_insn (gen_jump (lab2));
|
|
|
|
|
emit_barrier ();
|
|
|
|
|
|
|
|
|
|
emit_label (lab1);
|
|
|
|
|
|
|
|
|
|
/* |d| > |c|; use ratio c/d to scale dividend and divisor. */
|
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
ratio = expand_binop (submode, binoptab, real1, imag1,
|
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
ratio = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
real1, imag1, NULL_RTX, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (ratio == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Calculate divisor. */
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, real1, ratio,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
divisor = expand_binop (submode, this_add_optab, temp1, imag1,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (divisor == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Calculate dividend. */
|
|
|
|
|
|
2002-07-10 23:13:26 +02:00
|
|
|
|
if (imag0 == 0)
|
1999-05-18 03:05:14 +02:00
|
|
|
|
{
|
|
|
|
|
/* Compute a / (c+id) as a(c/d) / (c(c/d)+d) + i (-a) / (c(c/d)+d). */
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
real_t = expand_binop (submode, this_mul_optab, real0, ratio,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
imag_t = expand_unop (submode, this_neg_optab, real0,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (real_t == 0 || imag_t == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Compute (a+ib)/(c+id) as
|
|
|
|
|
(a(c/d)+b)/(c(c/d)+d) + i (b(c/d)-a)/(c(c/d)+d). */
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, real0, ratio,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
real_t = expand_binop (submode, this_add_optab, temp1, imag0,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp1 = expand_binop (submode, this_mul_optab, imag0, ratio,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
imag_t = expand_binop (submode, this_sub_optab, temp1, real0,
|
1999-05-18 03:05:14 +02:00
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (real_t == 0 || imag_t == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, real_t, divisor,
|
|
|
|
|
realr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
real_t, divisor, realr, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (res != realr)
|
|
|
|
|
emit_move_insn (realr, res);
|
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, imag_t, divisor,
|
|
|
|
|
imagr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
imag_t, divisor, imagr, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (res != imagr)
|
|
|
|
|
emit_move_insn (imagr, res);
|
|
|
|
|
|
|
|
|
|
emit_label (lab2);
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
/* Wrapper around expand_binop which takes an rtx code to specify
|
|
|
|
|
the operation to perform, not an optab pointer. All other
|
|
|
|
|
arguments are the same. */
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_simple_binop (enum machine_mode mode, enum rtx_code code, rtx op0,
|
|
|
|
|
rtx op1, rtx target, int unsignedp,
|
|
|
|
|
enum optab_methods methods)
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
{
|
2002-11-16 07:08:16 +01:00
|
|
|
|
optab binop = code_to_optab[(int) code];
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
if (binop == 0)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
return expand_binop (mode, binop, op0, op1, target, unsignedp, methods);
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Generate code to perform an operation specified by BINOPTAB
|
|
|
|
|
on operands OP0 and OP1, with result having machine-mode MODE.
|
|
|
|
|
|
|
|
|
|
UNSIGNEDP is for the case where we have to widen the operands
|
|
|
|
|
to perform the operation. It says to use zero-extension.
|
|
|
|
|
|
|
|
|
|
If TARGET is nonzero, the value
|
|
|
|
|
is generated there, if it is convenient to do so.
|
|
|
|
|
In all cases an rtx is returned for the locus of the value;
|
|
|
|
|
this may or may not be TARGET. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
|
|
|
|
rtx target, int unsignedp, enum optab_methods methods)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
1994-06-23 00:15:30 +02:00
|
|
|
|
enum optab_methods next_methods
|
|
|
|
|
= (methods == OPTAB_LIB || methods == OPTAB_LIB_WIDEN
|
|
|
|
|
? OPTAB_WIDEN : methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
enum mode_class class;
|
|
|
|
|
enum machine_mode wider_mode;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx temp;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
int commutative_op = 0;
|
2002-11-16 07:08:16 +01:00
|
|
|
|
int shift_op = (binoptab->code == ASHIFT
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|| binoptab->code == ASHIFTRT
|
|
|
|
|
|| binoptab->code == LSHIFTRT
|
|
|
|
|
|| binoptab->code == ROTATE
|
|
|
|
|
|| binoptab->code == ROTATERT);
|
1992-11-25 19:04:15 +01:00
|
|
|
|
rtx entry_last = get_last_insn ();
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx last;
|
|
|
|
|
|
|
|
|
|
class = GET_MODE_CLASS (mode);
|
|
|
|
|
|
|
|
|
|
op0 = protect_from_queue (op0, 0);
|
|
|
|
|
op1 = protect_from_queue (op1, 0);
|
|
|
|
|
if (target)
|
|
|
|
|
target = protect_from_queue (target, 1);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
{
|
2003-06-04 06:40:26 +02:00
|
|
|
|
/* Load duplicate non-volatile operands once. */
|
|
|
|
|
if (rtx_equal_p (op0, op1) && ! volatile_refs_p (op0))
|
|
|
|
|
{
|
|
|
|
|
op0 = force_not_mem (op0);
|
|
|
|
|
op1 = op0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
op0 = force_not_mem (op0);
|
|
|
|
|
op1 = force_not_mem (op1);
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1992-09-29 15:14:19 +01:00
|
|
|
|
/* If subtracting an integer constant, convert this into an addition of
|
|
|
|
|
the negated constant. */
|
|
|
|
|
|
|
|
|
|
if (binoptab == sub_optab && GET_CODE (op1) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
op1 = negate_rtx (mode, op1);
|
|
|
|
|
binoptab = add_optab;
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* If we are inside an appropriately-short loop and one operand is an
|
|
|
|
|
expensive constant, force it into a register. */
|
1992-04-18 21:40:49 +02:00
|
|
|
|
if (CONSTANT_P (op0) && preserve_subexpressions_p ()
|
2000-09-15 04:56:02 +02:00
|
|
|
|
&& rtx_cost (op0, binoptab->code) > COSTS_N_INSNS (1))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
op0 = force_reg (mode, op0);
|
|
|
|
|
|
1992-04-18 21:40:49 +02:00
|
|
|
|
if (CONSTANT_P (op1) && preserve_subexpressions_p ()
|
2000-09-15 04:56:02 +02:00
|
|
|
|
&& ! shift_op && rtx_cost (op1, binoptab->code) > COSTS_N_INSNS (1))
|
1995-01-14 02:36:53 +01:00
|
|
|
|
op1 = force_reg (mode, op1);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Record where to delete back to if we backtrack. */
|
|
|
|
|
last = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
/* If operation is commutative,
|
|
|
|
|
try to make the first operand a register.
|
|
|
|
|
Even better, try to make it the same as the target.
|
|
|
|
|
Also try to make the last operand a constant. */
|
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 (binoptab->code) == RTX_COMM_ARITH
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|| binoptab == smul_widen_optab
|
1994-06-29 02:21:32 +02:00
|
|
|
|
|| binoptab == umul_widen_optab
|
|
|
|
|
|| binoptab == smul_highpart_optab
|
|
|
|
|
|| binoptab == umul_highpart_optab)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
commutative_op = 1;
|
|
|
|
|
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (((target == 0 || REG_P (target))
|
|
|
|
|
? ((REG_P (op1)
|
|
|
|
|
&& !REG_P (op0))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|| target == op1)
|
|
|
|
|
: rtx_equal_p (op1, target))
|
|
|
|
|
|| GET_CODE (op0) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
temp = op1;
|
|
|
|
|
op1 = op0;
|
|
|
|
|
op0 = temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we can do it with a three-operand insn, do so. */
|
|
|
|
|
|
|
|
|
|
if (methods != OPTAB_MUST_WIDEN
|
|
|
|
|
&& binoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
int icode = (int) binoptab->handlers[(int) mode].insn_code;
|
1999-09-12 14:46:08 +02:00
|
|
|
|
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
|
|
|
|
|
enum machine_mode mode1 = insn_data[icode].operand[2].mode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx pat;
|
|
|
|
|
rtx xop0 = op0, xop1 = op1;
|
|
|
|
|
|
|
|
|
|
if (target)
|
|
|
|
|
temp = target;
|
|
|
|
|
else
|
|
|
|
|
temp = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
/* If it is a commutative operator and the modes would match
|
1996-07-04 00:07:53 +02:00
|
|
|
|
if we would swap the operands, we can save the conversions. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (commutative_op)
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE (op0) != mode0 && GET_MODE (op1) != mode1
|
|
|
|
|
&& GET_MODE (op0) == mode1 && GET_MODE (op1) == mode0)
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx tmp;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
tmp = op0; op0 = op1; op1 = tmp;
|
|
|
|
|
tmp = xop0; xop0 = xop1; xop1 = tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* In case the insn wants input operands in modes different from
|
2002-09-05 00:24:12 +02:00
|
|
|
|
those of the actual operands, convert the operands. It would
|
|
|
|
|
seem that we don't need to convert CONST_INTs, but we do, so
|
2002-11-19 21:13:20 +01:00
|
|
|
|
that they're properly zero-extended, sign-extended or truncated
|
|
|
|
|
for their mode. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2002-09-12 03:29:21 +02:00
|
|
|
|
if (GET_MODE (op0) != mode0 && mode0 != VOIDmode)
|
2001-04-12 05:41:36 +02:00
|
|
|
|
xop0 = convert_modes (mode0,
|
|
|
|
|
GET_MODE (op0) != VOIDmode
|
|
|
|
|
? GET_MODE (op0)
|
2002-09-05 00:24:12 +02:00
|
|
|
|
: mode,
|
2001-04-12 05:41:36 +02:00
|
|
|
|
xop0, unsignedp);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2002-09-12 03:29:21 +02:00
|
|
|
|
if (GET_MODE (op1) != mode1 && mode1 != VOIDmode)
|
2001-04-12 05:41:36 +02:00
|
|
|
|
xop1 = convert_modes (mode1,
|
|
|
|
|
GET_MODE (op1) != VOIDmode
|
|
|
|
|
? GET_MODE (op1)
|
2002-11-19 21:13:20 +01:00
|
|
|
|
: mode,
|
2001-04-12 05:41:36 +02:00
|
|
|
|
xop1, unsignedp);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Now, if insn's predicates don't allow our operands, put them into
|
|
|
|
|
pseudo regs. */
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0)
|
1995-01-14 02:36:53 +01:00
|
|
|
|
&& mode0 != VOIDmode)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[2].predicate) (xop1, mode1)
|
1995-01-14 02:36:53 +01:00
|
|
|
|
&& mode1 != VOIDmode)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
xop1 = copy_to_mode_reg (mode1, xop1);
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[0].predicate) (temp, mode))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
temp = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
pat = GEN_FCN (icode) (temp, xop0, xop1);
|
|
|
|
|
if (pat)
|
|
|
|
|
{
|
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
|
|
|
|
/* If PAT is composed of more than one insn, try to add an appropriate
|
1991-12-30 04:19:53 +01:00
|
|
|
|
REG_EQUAL note to it. If we can't because TEMP conflicts with an
|
|
|
|
|
operand, call ourselves again, this time without a target. */
|
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
|
|
|
|
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
|
1991-12-30 04:19:53 +01:00
|
|
|
|
&& ! add_equal_note (pat, temp, binoptab->code, xop0, xop1))
|
|
|
|
|
{
|
|
|
|
|
delete_insns_since (last);
|
1992-07-06 22:04:10 +02:00
|
|
|
|
return expand_binop (mode, binoptab, op0, op1, NULL_RTX,
|
|
|
|
|
unsignedp, methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
emit_insn (pat);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
|
1992-08-22 01:21:30 +02:00
|
|
|
|
/* If this is a multiply, see if we can do a widening operation that
|
|
|
|
|
takes operands of this mode and makes a wider mode. */
|
|
|
|
|
|
|
|
|
|
if (binoptab == smul_optab && GET_MODE_WIDER_MODE (mode) != VOIDmode
|
|
|
|
|
&& (((unsignedp ? umul_widen_optab : smul_widen_optab)
|
|
|
|
|
->handlers[(int) GET_MODE_WIDER_MODE (mode)].insn_code)
|
|
|
|
|
!= CODE_FOR_nothing))
|
|
|
|
|
{
|
|
|
|
|
temp = expand_binop (GET_MODE_WIDER_MODE (mode),
|
|
|
|
|
unsignedp ? umul_widen_optab : smul_widen_optab,
|
1994-06-18 16:21:32 +02:00
|
|
|
|
op0, op1, NULL_RTX, unsignedp, OPTAB_DIRECT);
|
1992-08-22 01:21:30 +02:00
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (temp != 0)
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_INT)
|
|
|
|
|
return gen_lowpart (mode, temp);
|
|
|
|
|
else
|
|
|
|
|
return convert_to_mode (mode, temp, unsignedp);
|
|
|
|
|
}
|
1992-08-22 01:21:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
1992-06-23 23:36:55 +02:00
|
|
|
|
/* Look for a wider mode of the same class for which we think we
|
1992-08-22 01:21:30 +02:00
|
|
|
|
can open-code the operation. Check for a widening multiply at the
|
|
|
|
|
wider mode as well. */
|
1992-06-23 23:36:55 +02:00
|
|
|
|
|
|
|
|
|
if ((class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
|
1992-09-11 03:15:31 +02:00
|
|
|
|
&& methods != OPTAB_DIRECT && methods != OPTAB_LIB)
|
1992-06-23 23:36:55 +02:00
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
1992-08-22 01:21:30 +02:00
|
|
|
|
if (binoptab->handlers[(int) wider_mode].insn_code != CODE_FOR_nothing
|
|
|
|
|
|| (binoptab == smul_optab
|
|
|
|
|
&& GET_MODE_WIDER_MODE (wider_mode) != VOIDmode
|
|
|
|
|
&& (((unsignedp ? umul_widen_optab : smul_widen_optab)
|
|
|
|
|
->handlers[(int) GET_MODE_WIDER_MODE (wider_mode)].insn_code)
|
|
|
|
|
!= CODE_FOR_nothing)))
|
1992-06-23 23:36:55 +02:00
|
|
|
|
{
|
|
|
|
|
rtx xop0 = op0, xop1 = op1;
|
|
|
|
|
int no_extend = 0;
|
|
|
|
|
|
|
|
|
|
/* For certain integer operations, we need not actually extend
|
|
|
|
|
the narrow operands, as long as we will truncate
|
2001-10-10 13:33:39 +02:00
|
|
|
|
the results to the same narrowness. */
|
1992-06-23 23:36:55 +02:00
|
|
|
|
|
|
|
|
|
if ((binoptab == ior_optab || binoptab == and_optab
|
|
|
|
|
|| binoptab == xor_optab
|
|
|
|
|
|| binoptab == add_optab || binoptab == sub_optab
|
1994-04-10 14:03:05 +02:00
|
|
|
|
|| binoptab == smul_optab || binoptab == ashl_optab)
|
1993-08-09 13:30:54 +02:00
|
|
|
|
&& class == MODE_INT)
|
1992-06-23 23:36:55 +02:00
|
|
|
|
no_extend = 1;
|
|
|
|
|
|
1993-09-09 21:50:55 +02:00
|
|
|
|
xop0 = widen_operand (xop0, wider_mode, mode, unsignedp, no_extend);
|
1993-09-07 20:54:27 +02:00
|
|
|
|
|
|
|
|
|
/* The second operand of a shift must always be extended. */
|
1993-09-09 21:50:55 +02:00
|
|
|
|
xop1 = widen_operand (xop1, wider_mode, mode, unsignedp,
|
1994-04-10 14:03:05 +02:00
|
|
|
|
no_extend && binoptab != ashl_optab);
|
1993-09-07 20:54:27 +02:00
|
|
|
|
|
1992-07-06 22:04:10 +02:00
|
|
|
|
temp = expand_binop (wider_mode, binoptab, xop0, xop1, NULL_RTX,
|
1992-06-23 23:36:55 +02:00
|
|
|
|
unsignedp, OPTAB_DIRECT);
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
if (class != MODE_INT)
|
|
|
|
|
{
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
convert_move (target, temp, 0);
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return gen_lowpart (mode, temp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* These can be done a word at a time. */
|
|
|
|
|
if ((binoptab == and_optab || binoptab == ior_optab || binoptab == xor_optab)
|
|
|
|
|
&& class == MODE_INT
|
|
|
|
|
&& GET_MODE_SIZE (mode) > UNITS_PER_WORD
|
1992-01-18 00:19:29 +01:00
|
|
|
|
&& binoptab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2002-01-12 15:05:32 +01:00
|
|
|
|
int i;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx insns;
|
|
|
|
|
rtx equiv_value;
|
|
|
|
|
|
|
|
|
|
/* If TARGET is the same as one of the operands, the REG_EQUAL note
|
|
|
|
|
won't be accurate, so use a new target. */
|
|
|
|
|
if (target == 0 || target == op0 || target == op1)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
/* Do the actual arithmetic. */
|
|
|
|
|
for (i = 0; i < GET_MODE_BITSIZE (mode) / BITS_PER_WORD; i++)
|
|
|
|
|
{
|
|
|
|
|
rtx target_piece = operand_subword (target, i, 1, mode);
|
1992-01-18 00:19:29 +01:00
|
|
|
|
rtx x = expand_binop (word_mode, binoptab,
|
1991-12-30 04:19:53 +01:00
|
|
|
|
operand_subword_force (op0, i, mode),
|
|
|
|
|
operand_subword_force (op1, i, mode),
|
1994-06-23 00:15:30 +02:00
|
|
|
|
target_piece, unsignedp, next_methods);
|
|
|
|
|
|
|
|
|
|
if (x == 0)
|
|
|
|
|
break;
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (target_piece != x)
|
|
|
|
|
emit_move_insn (target_piece, x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (i == GET_MODE_BITSIZE (mode) / BITS_PER_WORD)
|
|
|
|
|
{
|
|
|
|
|
if (binoptab->code != UNKNOWN)
|
|
|
|
|
equiv_value
|
1998-06-24 16:49:51 +02:00
|
|
|
|
= gen_rtx_fmt_ee (binoptab->code, mode,
|
|
|
|
|
copy_rtx (op0), copy_rtx (op1));
|
1994-06-23 00:15:30 +02:00
|
|
|
|
else
|
|
|
|
|
equiv_value = 0;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
emit_no_conflict_block (insns, target, op0, op1, equiv_value);
|
|
|
|
|
return target;
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1993-07-21 21:44:20 +02:00
|
|
|
|
/* Synthesize double word shifts from single word shifts. */
|
1994-04-10 14:03:05 +02:00
|
|
|
|
if ((binoptab == lshr_optab || binoptab == ashl_optab
|
|
|
|
|
|| binoptab == ashr_optab)
|
1993-07-21 21:44:20 +02:00
|
|
|
|
&& class == MODE_INT
|
|
|
|
|
&& GET_CODE (op1) == CONST_INT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
|
|
|
|
|
&& binoptab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
|
|
|
|
|
&& ashl_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
|
|
|
|
|
&& lshr_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
1994-06-23 00:15:30 +02:00
|
|
|
|
rtx insns, inter, equiv_value;
|
1993-07-21 21:44:20 +02:00
|
|
|
|
rtx into_target, outof_target;
|
|
|
|
|
rtx into_input, outof_input;
|
|
|
|
|
int shift_count, left_shift, outof_word;
|
|
|
|
|
|
|
|
|
|
/* If TARGET is the same as one of the operands, the REG_EQUAL note
|
|
|
|
|
won't be accurate, so use a new target. */
|
|
|
|
|
if (target == 0 || target == op0 || target == op1)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
shift_count = INTVAL (op1);
|
|
|
|
|
|
|
|
|
|
/* OUTOF_* is the word we are shifting bits away from, and
|
|
|
|
|
INTO_* is the word that we are shifting bits towards, thus
|
|
|
|
|
they differ depending on the direction of the shift and
|
|
|
|
|
WORDS_BIG_ENDIAN. */
|
|
|
|
|
|
1994-04-10 14:03:05 +02:00
|
|
|
|
left_shift = binoptab == ashl_optab;
|
1993-07-21 21:44:20 +02:00
|
|
|
|
outof_word = left_shift ^ ! WORDS_BIG_ENDIAN;
|
|
|
|
|
|
|
|
|
|
outof_target = operand_subword (target, outof_word, 1, mode);
|
|
|
|
|
into_target = operand_subword (target, 1 - outof_word, 1, mode);
|
|
|
|
|
|
|
|
|
|
outof_input = operand_subword_force (op0, outof_word, mode);
|
|
|
|
|
into_input = operand_subword_force (op0, 1 - outof_word, mode);
|
|
|
|
|
|
|
|
|
|
if (shift_count >= BITS_PER_WORD)
|
|
|
|
|
{
|
1994-06-23 00:15:30 +02:00
|
|
|
|
inter = expand_binop (word_mode, binoptab,
|
|
|
|
|
outof_input,
|
|
|
|
|
GEN_INT (shift_count - BITS_PER_WORD),
|
|
|
|
|
into_target, unsignedp, next_methods);
|
|
|
|
|
|
1994-06-28 01:16:01 +02:00
|
|
|
|
if (inter != 0 && inter != into_target)
|
1994-06-23 00:15:30 +02:00
|
|
|
|
emit_move_insn (into_target, inter);
|
1993-07-21 21:44:20 +02:00
|
|
|
|
|
|
|
|
|
/* For a signed right shift, we must fill the word we are shifting
|
|
|
|
|
out of with copies of the sign bit. Otherwise it is zeroed. */
|
1994-06-28 01:16:01 +02:00
|
|
|
|
if (inter != 0 && binoptab != ashr_optab)
|
|
|
|
|
inter = CONST0_RTX (word_mode);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
else if (inter != 0)
|
|
|
|
|
inter = expand_binop (word_mode, binoptab,
|
|
|
|
|
outof_input,
|
|
|
|
|
GEN_INT (BITS_PER_WORD - 1),
|
|
|
|
|
outof_target, unsignedp, next_methods);
|
|
|
|
|
|
1994-06-28 01:16:01 +02:00
|
|
|
|
if (inter != 0 && inter != outof_target)
|
1994-06-23 00:15:30 +02:00
|
|
|
|
emit_move_insn (outof_target, inter);
|
1993-07-21 21:44:20 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1994-06-23 00:15:30 +02:00
|
|
|
|
rtx carries;
|
1993-07-21 21:44:20 +02:00
|
|
|
|
optab reverse_unsigned_shift, unsigned_shift;
|
|
|
|
|
|
|
|
|
|
/* For a shift of less then BITS_PER_WORD, to compute the carry,
|
|
|
|
|
we must do a logical shift in the opposite direction of the
|
|
|
|
|
desired shift. */
|
|
|
|
|
|
|
|
|
|
reverse_unsigned_shift = (left_shift ? lshr_optab : ashl_optab);
|
|
|
|
|
|
|
|
|
|
/* For a shift of less than BITS_PER_WORD, to compute the word
|
|
|
|
|
shifted towards, we need to unsigned shift the orig value of
|
|
|
|
|
that word. */
|
|
|
|
|
|
|
|
|
|
unsigned_shift = (left_shift ? ashl_optab : lshr_optab);
|
|
|
|
|
|
|
|
|
|
carries = expand_binop (word_mode, reverse_unsigned_shift,
|
|
|
|
|
outof_input,
|
|
|
|
|
GEN_INT (BITS_PER_WORD - shift_count),
|
1994-06-23 00:15:30 +02:00
|
|
|
|
0, unsignedp, next_methods);
|
|
|
|
|
|
|
|
|
|
if (carries == 0)
|
|
|
|
|
inter = 0;
|
|
|
|
|
else
|
|
|
|
|
inter = expand_binop (word_mode, unsigned_shift, into_input,
|
|
|
|
|
op1, 0, unsignedp, next_methods);
|
|
|
|
|
|
|
|
|
|
if (inter != 0)
|
|
|
|
|
inter = expand_binop (word_mode, ior_optab, carries, inter,
|
|
|
|
|
into_target, unsignedp, next_methods);
|
|
|
|
|
|
1994-06-28 01:16:01 +02:00
|
|
|
|
if (inter != 0 && inter != into_target)
|
1994-06-23 00:15:30 +02:00
|
|
|
|
emit_move_insn (into_target, inter);
|
1994-09-15 15:17:28 +02:00
|
|
|
|
|
|
|
|
|
if (inter != 0)
|
|
|
|
|
inter = expand_binop (word_mode, binoptab, outof_input,
|
|
|
|
|
op1, outof_target, unsignedp, next_methods);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1994-09-15 15:17:28 +02:00
|
|
|
|
if (inter != 0 && inter != outof_target)
|
|
|
|
|
emit_move_insn (outof_target, inter);
|
1993-07-21 21:44:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (inter != 0)
|
|
|
|
|
{
|
|
|
|
|
if (binoptab->code != UNKNOWN)
|
1998-06-24 16:49:51 +02:00
|
|
|
|
equiv_value = gen_rtx_fmt_ee (binoptab->code, mode, op0, op1);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
else
|
|
|
|
|
equiv_value = 0;
|
1993-07-21 21:44:20 +02:00
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
emit_no_conflict_block (insns, target, op0, op1, equiv_value);
|
|
|
|
|
return target;
|
|
|
|
|
}
|
1993-07-21 21:44:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Synthesize double word rotates from single word shifts. */
|
|
|
|
|
if ((binoptab == rotl_optab || binoptab == rotr_optab)
|
|
|
|
|
&& class == MODE_INT
|
|
|
|
|
&& GET_CODE (op1) == CONST_INT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
|
|
|
|
|
&& ashl_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
|
|
|
|
|
&& lshr_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
rtx insns, equiv_value;
|
|
|
|
|
rtx into_target, outof_target;
|
|
|
|
|
rtx into_input, outof_input;
|
1994-06-23 00:15:30 +02:00
|
|
|
|
rtx inter;
|
1993-07-21 21:44:20 +02:00
|
|
|
|
int shift_count, left_shift, outof_word;
|
|
|
|
|
|
|
|
|
|
/* If TARGET is the same as one of the operands, the REG_EQUAL note
|
2004-03-23 22:54:36 +01:00
|
|
|
|
won't be accurate, so use a new target. Do this also if target is not
|
|
|
|
|
a REG, first because having a register instead may open optimization
|
bb-reorder.c, [...]: Fix comment typos.
* bb-reorder.c, c-opts.c, cfglayout.c, cgraph.c, cgraphunit.c,
cppfiles.c, fold-const.c, ggc-zone.c, loop-doloop.c, optabs.c,
reg-stack.c, varasm.c, config/alpha/ev4.md,
config/alpha/ev5.md, config/alpha/ev6.md, config/arm/arm.c,
config/c4x/c4x.c, config/c4x/c4x.md, config/cris/cris.c,
config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.c,
config/frv/frv.h, config/frv/frv.md, config/h8300/h8300.c,
config/i386/i386.c, config/i386/i386.md, config/i386/winnt.c,
config/ia64/itanium2.md, config/ip2k/ip2k.c,
config/mips/mips.c, config/mips/mips.h, config/mips/sr71k.md,
config/pa/pa.c, config/s390/s390.c, config/sh/sh.c: Fix
comment typos.
From-SVN: r81345
2004-04-30 18:27:30 +02:00
|
|
|
|
opportunities, and second because if target and op0 happen to be MEMs
|
2004-03-23 22:54:36 +01:00
|
|
|
|
designating the same location, we would risk clobbering it too early
|
|
|
|
|
in the code sequence we generate below. */
|
|
|
|
|
if (target == 0 || target == op0 || target == op1 || ! REG_P (target))
|
1993-07-21 21:44:20 +02:00
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
shift_count = INTVAL (op1);
|
|
|
|
|
|
|
|
|
|
/* OUTOF_* is the word we are shifting bits away from, and
|
|
|
|
|
INTO_* is the word that we are shifting bits towards, thus
|
|
|
|
|
they differ depending on the direction of the shift and
|
|
|
|
|
WORDS_BIG_ENDIAN. */
|
|
|
|
|
|
|
|
|
|
left_shift = (binoptab == rotl_optab);
|
|
|
|
|
outof_word = left_shift ^ ! WORDS_BIG_ENDIAN;
|
|
|
|
|
|
|
|
|
|
outof_target = operand_subword (target, outof_word, 1, mode);
|
|
|
|
|
into_target = operand_subword (target, 1 - outof_word, 1, mode);
|
|
|
|
|
|
|
|
|
|
outof_input = operand_subword_force (op0, outof_word, mode);
|
|
|
|
|
into_input = operand_subword_force (op0, 1 - outof_word, mode);
|
|
|
|
|
|
|
|
|
|
if (shift_count == BITS_PER_WORD)
|
|
|
|
|
{
|
|
|
|
|
/* This is just a word swap. */
|
|
|
|
|
emit_move_insn (outof_target, into_input);
|
|
|
|
|
emit_move_insn (into_target, outof_input);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
inter = const0_rtx;
|
1993-07-21 21:44:20 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx into_temp1, into_temp2, outof_temp1, outof_temp2;
|
|
|
|
|
rtx first_shift_count, second_shift_count;
|
|
|
|
|
optab reverse_unsigned_shift, unsigned_shift;
|
|
|
|
|
|
|
|
|
|
reverse_unsigned_shift = (left_shift ^ (shift_count < BITS_PER_WORD)
|
|
|
|
|
? lshr_optab : ashl_optab);
|
|
|
|
|
|
|
|
|
|
unsigned_shift = (left_shift ^ (shift_count < BITS_PER_WORD)
|
|
|
|
|
? ashl_optab : lshr_optab);
|
|
|
|
|
|
|
|
|
|
if (shift_count > BITS_PER_WORD)
|
|
|
|
|
{
|
|
|
|
|
first_shift_count = GEN_INT (shift_count - BITS_PER_WORD);
|
2002-11-16 07:08:16 +01:00
|
|
|
|
second_shift_count = GEN_INT (2 * BITS_PER_WORD - shift_count);
|
1993-07-21 21:44:20 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
first_shift_count = GEN_INT (BITS_PER_WORD - shift_count);
|
|
|
|
|
second_shift_count = GEN_INT (shift_count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
into_temp1 = expand_binop (word_mode, unsigned_shift,
|
|
|
|
|
outof_input, first_shift_count,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
NULL_RTX, unsignedp, next_methods);
|
1993-07-21 21:44:20 +02:00
|
|
|
|
into_temp2 = expand_binop (word_mode, reverse_unsigned_shift,
|
|
|
|
|
into_input, second_shift_count,
|
2002-10-24 10:48:27 +02:00
|
|
|
|
NULL_RTX, unsignedp, next_methods);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
if (into_temp1 != 0 && into_temp2 != 0)
|
|
|
|
|
inter = expand_binop (word_mode, ior_optab, into_temp1, into_temp2,
|
|
|
|
|
into_target, unsignedp, next_methods);
|
|
|
|
|
else
|
|
|
|
|
inter = 0;
|
|
|
|
|
|
1994-06-28 01:16:01 +02:00
|
|
|
|
if (inter != 0 && inter != into_target)
|
1994-06-23 00:15:30 +02:00
|
|
|
|
emit_move_insn (into_target, inter);
|
1993-07-21 21:44:20 +02:00
|
|
|
|
|
|
|
|
|
outof_temp1 = expand_binop (word_mode, unsigned_shift,
|
|
|
|
|
into_input, first_shift_count,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
NULL_RTX, unsignedp, next_methods);
|
1993-07-21 21:44:20 +02:00
|
|
|
|
outof_temp2 = expand_binop (word_mode, reverse_unsigned_shift,
|
|
|
|
|
outof_input, second_shift_count,
|
2002-10-24 10:48:27 +02:00
|
|
|
|
NULL_RTX, unsignedp, next_methods);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
if (inter != 0 && outof_temp1 != 0 && outof_temp2 != 0)
|
|
|
|
|
inter = expand_binop (word_mode, ior_optab,
|
|
|
|
|
outof_temp1, outof_temp2,
|
|
|
|
|
outof_target, unsignedp, next_methods);
|
|
|
|
|
|
1994-06-28 01:16:01 +02:00
|
|
|
|
if (inter != 0 && inter != outof_target)
|
1994-06-23 00:15:30 +02:00
|
|
|
|
emit_move_insn (outof_target, inter);
|
1993-07-21 21:44:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (inter != 0)
|
|
|
|
|
{
|
|
|
|
|
if (binoptab->code != UNKNOWN)
|
1998-06-24 16:49:51 +02:00
|
|
|
|
equiv_value = gen_rtx_fmt_ee (binoptab->code, mode, op0, op1);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
else
|
|
|
|
|
equiv_value = 0;
|
1993-07-21 21:44:20 +02:00
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
/* We can't make this a no conflict block if this is a word swap,
|
|
|
|
|
because the word swap case fails if the input and output values
|
|
|
|
|
are in the same register. */
|
|
|
|
|
if (shift_count != BITS_PER_WORD)
|
|
|
|
|
emit_no_conflict_block (insns, target, op0, op1, equiv_value);
|
|
|
|
|
else
|
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
|
|
|
|
emit_insn (insns);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return target;
|
|
|
|
|
}
|
1993-07-21 21:44:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* These can be done a word at a time by propagating carries. */
|
|
|
|
|
if ((binoptab == add_optab || binoptab == sub_optab)
|
|
|
|
|
&& class == MODE_INT
|
|
|
|
|
&& GET_MODE_SIZE (mode) >= 2 * UNITS_PER_WORD
|
1992-01-18 00:19:29 +01:00
|
|
|
|
&& binoptab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2002-06-04 09:11:05 +02:00
|
|
|
|
unsigned int i;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
optab otheroptab = binoptab == add_optab ? sub_optab : add_optab;
|
2002-08-02 02:50:01 +02:00
|
|
|
|
const unsigned int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
|
1999-04-26 02:15:54 +02:00
|
|
|
|
rtx carry_in = NULL_RTX, carry_out = NULL_RTX;
|
2002-05-29 01:03:21 +02:00
|
|
|
|
rtx xop0, xop1, xtarget;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* We can handle either a 1 or -1 value for the carry. If STORE_FLAG
|
|
|
|
|
value is one of those, use it. Otherwise, use 1 since it is the
|
|
|
|
|
one easiest to get. */
|
|
|
|
|
#if STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1
|
|
|
|
|
int normalizep = STORE_FLAG_VALUE;
|
|
|
|
|
#else
|
|
|
|
|
int normalizep = 1;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Prepare the operands. */
|
1992-11-06 01:05:51 +01:00
|
|
|
|
xop0 = force_reg (mode, op0);
|
|
|
|
|
xop1 = force_reg (mode, op1);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2002-05-29 01:03:21 +02:00
|
|
|
|
xtarget = gen_reg_rtx (mode);
|
|
|
|
|
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (target == 0 || !REG_P (target))
|
2002-05-29 01:03:21 +02:00
|
|
|
|
target = xtarget;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1993-03-16 05:54:43 +01:00
|
|
|
|
/* Indicate for flow that the entire target reg is being set. */
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (REG_P (target))
|
2002-05-29 01:03:21 +02:00
|
|
|
|
emit_insn (gen_rtx_CLOBBER (VOIDmode, xtarget));
|
1993-03-16 05:54:43 +01:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Do the actual arithmetic. */
|
|
|
|
|
for (i = 0; i < nwords; i++)
|
|
|
|
|
{
|
|
|
|
|
int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i);
|
2002-05-29 01:03:21 +02:00
|
|
|
|
rtx target_piece = operand_subword (xtarget, index, 1, mode);
|
1992-11-06 01:05:51 +01:00
|
|
|
|
rtx op0_piece = operand_subword_force (xop0, index, mode);
|
|
|
|
|
rtx op1_piece = operand_subword_force (xop1, index, mode);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx x;
|
|
|
|
|
|
|
|
|
|
/* Main add/subtract of the input operands. */
|
1992-01-18 00:19:29 +01:00
|
|
|
|
x = expand_binop (word_mode, binoptab,
|
1991-12-30 04:19:53 +01:00
|
|
|
|
op0_piece, op1_piece,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
target_piece, unsignedp, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (x == 0)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
if (i + 1 < nwords)
|
|
|
|
|
{
|
|
|
|
|
/* Store carry from main add/subtract. */
|
1992-01-18 00:19:29 +01:00
|
|
|
|
carry_out = gen_reg_rtx (word_mode);
|
1996-10-22 00:20:06 +02:00
|
|
|
|
carry_out = emit_store_flag_force (carry_out,
|
|
|
|
|
(binoptab == add_optab
|
1999-08-18 19:51:27 +02:00
|
|
|
|
? LT : GT),
|
1996-10-22 00:20:06 +02:00
|
|
|
|
x, op0_piece,
|
|
|
|
|
word_mode, 1, normalizep);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i > 0)
|
|
|
|
|
{
|
2001-08-27 22:35:37 +02:00
|
|
|
|
rtx newx;
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Add/subtract previous carry to main result. */
|
2001-08-27 22:35:37 +02:00
|
|
|
|
newx = expand_binop (word_mode,
|
|
|
|
|
normalizep == 1 ? binoptab : otheroptab,
|
|
|
|
|
x, carry_in,
|
|
|
|
|
NULL_RTX, 1, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
if (i + 1 < nwords)
|
|
|
|
|
{
|
|
|
|
|
/* Get out carry from adding/subtracting carry in. */
|
2001-08-27 22:35:37 +02:00
|
|
|
|
rtx carry_tmp = gen_reg_rtx (word_mode);
|
1996-10-22 00:20:06 +02:00
|
|
|
|
carry_tmp = emit_store_flag_force (carry_tmp,
|
2001-08-27 22:35:37 +02:00
|
|
|
|
(binoptab == add_optab
|
|
|
|
|
? LT : GT),
|
|
|
|
|
newx, x,
|
1996-10-22 00:20:06 +02:00
|
|
|
|
word_mode, 1, normalizep);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Logical-ior the two poss. carry together. */
|
1992-01-18 00:19:29 +01:00
|
|
|
|
carry_out = expand_binop (word_mode, ior_optab,
|
1991-12-30 04:19:53 +01:00
|
|
|
|
carry_out, carry_tmp,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
carry_out, 0, next_methods);
|
|
|
|
|
if (carry_out == 0)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
2001-08-27 22:35:37 +02:00
|
|
|
|
emit_move_insn (target_piece, newx);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
carry_in = carry_out;
|
2003-07-06 11:56:09 +02:00
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2002-06-04 09:11:05 +02:00
|
|
|
|
if (i == GET_MODE_BITSIZE (mode) / (unsigned) BITS_PER_WORD)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2003-04-15 15:06:58 +02:00
|
|
|
|
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing
|
|
|
|
|
|| ! rtx_equal_p (target, xtarget))
|
1996-10-23 16:30:26 +02:00
|
|
|
|
{
|
2002-05-29 01:03:21 +02:00
|
|
|
|
rtx temp = emit_move_insn (target, xtarget);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
1999-03-25 13:04:26 +01:00
|
|
|
|
set_unique_reg_note (temp,
|
2003-07-06 11:56:09 +02:00
|
|
|
|
REG_EQUAL,
|
1999-03-25 13:04:26 +01:00
|
|
|
|
gen_rtx_fmt_ee (binoptab->code, mode,
|
|
|
|
|
copy_rtx (xop0),
|
|
|
|
|
copy_rtx (xop1)));
|
1996-10-23 16:30:26 +02:00
|
|
|
|
}
|
2003-01-26 10:11:31 +01:00
|
|
|
|
else
|
|
|
|
|
target = xtarget;
|
1999-09-07 07:49:18 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return target;
|
|
|
|
|
}
|
1999-09-07 07:49:18 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we want to multiply two two-word values and have normal and widening
|
|
|
|
|
multiplies of single-word values, we can do this with three smaller
|
|
|
|
|
multiplications. Note that we do not make a REG_NO_CONFLICT block here
|
2003-07-06 11:56:09 +02:00
|
|
|
|
because we are not operating on one word at a time.
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
The multiplication proceeds as follows:
|
1992-01-18 00:19:29 +01:00
|
|
|
|
_______________________
|
|
|
|
|
[__op0_high_|__op0_low__]
|
|
|
|
|
_______________________
|
1992-12-31 23:18:00 +01:00
|
|
|
|
* [__op1_high_|__op1_low__]
|
1992-01-18 00:19:29 +01:00
|
|
|
|
_______________________________________________
|
|
|
|
|
_______________________
|
1992-12-31 23:18:00 +01:00
|
|
|
|
(1) [__op0_low__*__op1_low__]
|
1992-01-18 00:19:29 +01:00
|
|
|
|
_______________________
|
1992-12-31 23:18:00 +01:00
|
|
|
|
(2a) [__op0_low__*__op1_high_]
|
1992-01-18 00:19:29 +01:00
|
|
|
|
_______________________
|
1992-12-31 23:18:00 +01:00
|
|
|
|
(2b) [__op0_high_*__op1_low__]
|
1992-01-18 00:19:29 +01:00
|
|
|
|
_______________________
|
|
|
|
|
(3) [__op0_high_*__op1_high_]
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This gives a 4-word result. Since we are only interested in the
|
|
|
|
|
lower 2 words, partial result (3) and the upper words of (2a) and
|
|
|
|
|
(2b) don't need to be calculated. Hence (2a) and (2b) can be
|
|
|
|
|
calculated using non-widening multiplication.
|
|
|
|
|
|
|
|
|
|
(1), however, needs to be calculated with an unsigned widening
|
|
|
|
|
multiplication. If this operation is not directly supported we
|
|
|
|
|
try using a signed widening multiplication and adjust the result.
|
|
|
|
|
This adjustment works as follows:
|
|
|
|
|
|
|
|
|
|
If both operands are positive then no adjustment is needed.
|
|
|
|
|
|
|
|
|
|
If the operands have different signs, for example op0_low < 0 and
|
|
|
|
|
op1_low >= 0, the instruction treats the most significant bit of
|
|
|
|
|
op0_low as a sign bit instead of a bit with significance
|
|
|
|
|
2**(BITS_PER_WORD-1), i.e. the instruction multiplies op1_low
|
|
|
|
|
with 2**BITS_PER_WORD - op0_low, and two's complements the
|
|
|
|
|
result. Conclusion: We need to add op1_low * 2**BITS_PER_WORD to
|
|
|
|
|
the result.
|
|
|
|
|
|
|
|
|
|
Similarly, if both operands are negative, we need to add
|
|
|
|
|
(op0_low + op1_low) * 2**BITS_PER_WORD.
|
|
|
|
|
|
|
|
|
|
We use a trick to adjust quickly. We logically shift op0_low right
|
|
|
|
|
(op1_low) BITS_PER_WORD-1 steps to get 0 or 1, and add this to
|
|
|
|
|
op0_high (op1_high) before it is used to calculate 2b (2a). If no
|
|
|
|
|
logical shift exists, we do an arithmetic right shift and subtract
|
|
|
|
|
the 0 or -1. */
|
|
|
|
|
|
|
|
|
|
if (binoptab == smul_optab
|
|
|
|
|
&& class == MODE_INT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
|
1992-01-18 00:19:29 +01:00
|
|
|
|
&& smul_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
|
|
|
|
|
&& add_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
|
1991-12-30 04:19:53 +01:00
|
|
|
|
&& ((umul_widen_optab->handlers[(int) mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
|| (smul_widen_optab->handlers[(int) mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)))
|
|
|
|
|
{
|
|
|
|
|
int low = (WORDS_BIG_ENDIAN ? 1 : 0);
|
|
|
|
|
int high = (WORDS_BIG_ENDIAN ? 0 : 1);
|
|
|
|
|
rtx op0_high = operand_subword_force (op0, high, mode);
|
|
|
|
|
rtx op0_low = operand_subword_force (op0, low, mode);
|
|
|
|
|
rtx op1_high = operand_subword_force (op1, high, mode);
|
|
|
|
|
rtx op1_low = operand_subword_force (op1, low, mode);
|
|
|
|
|
rtx product = 0;
|
1999-04-26 02:15:54 +02:00
|
|
|
|
rtx op0_xhigh = NULL_RTX;
|
|
|
|
|
rtx op1_xhigh = NULL_RTX;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* If the target is the same as one of the inputs, don't use it. This
|
|
|
|
|
prevents problems with the REG_EQUAL note. */
|
1995-06-05 15:05:09 +02:00
|
|
|
|
if (target == op0 || target == op1
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
|| (target != 0 && !REG_P (target)))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
target = 0;
|
|
|
|
|
|
|
|
|
|
/* Multiply the two lower words to get a double-word product.
|
|
|
|
|
If unsigned widening multiplication is available, use that;
|
|
|
|
|
otherwise use the signed form and compensate. */
|
|
|
|
|
|
|
|
|
|
if (umul_widen_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
product = expand_binop (mode, umul_widen_optab, op0_low, op1_low,
|
|
|
|
|
target, 1, OPTAB_DIRECT);
|
|
|
|
|
|
|
|
|
|
/* If we didn't succeed, delete everything we did so far. */
|
|
|
|
|
if (product == 0)
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
else
|
|
|
|
|
op0_xhigh = op0_high, op1_xhigh = op1_high;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (product == 0
|
|
|
|
|
&& smul_widen_optab->handlers[(int) mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
{
|
1992-07-06 22:04:10 +02:00
|
|
|
|
rtx wordm1 = GEN_INT (BITS_PER_WORD - 1);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
product = expand_binop (mode, smul_widen_optab, op0_low, op1_low,
|
|
|
|
|
target, 1, OPTAB_DIRECT);
|
1992-01-18 00:19:29 +01:00
|
|
|
|
op0_xhigh = expand_binop (word_mode, lshr_optab, op0_low, wordm1,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
NULL_RTX, 1, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (op0_xhigh)
|
1992-01-18 00:19:29 +01:00
|
|
|
|
op0_xhigh = expand_binop (word_mode, add_optab, op0_high,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
op0_xhigh, op0_xhigh, 0, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
1992-01-18 00:19:29 +01:00
|
|
|
|
op0_xhigh = expand_binop (word_mode, ashr_optab, op0_low, wordm1,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
NULL_RTX, 0, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (op0_xhigh)
|
1992-01-18 00:19:29 +01:00
|
|
|
|
op0_xhigh = expand_binop (word_mode, sub_optab, op0_high,
|
1991-12-30 04:19:53 +01:00
|
|
|
|
op0_xhigh, op0_xhigh, 0,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1992-01-18 00:19:29 +01:00
|
|
|
|
op1_xhigh = expand_binop (word_mode, lshr_optab, op1_low, wordm1,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
NULL_RTX, 1, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (op1_xhigh)
|
1992-01-18 00:19:29 +01:00
|
|
|
|
op1_xhigh = expand_binop (word_mode, add_optab, op1_high,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
op1_xhigh, op1_xhigh, 0, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
1992-01-18 00:19:29 +01:00
|
|
|
|
op1_xhigh = expand_binop (word_mode, ashr_optab, op1_low, wordm1,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
NULL_RTX, 0, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (op1_xhigh)
|
1992-01-18 00:19:29 +01:00
|
|
|
|
op1_xhigh = expand_binop (word_mode, sub_optab, op1_high,
|
1991-12-30 04:19:53 +01:00
|
|
|
|
op1_xhigh, op1_xhigh, 0,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we have been able to directly compute the product of the
|
|
|
|
|
low-order words of the operands and perform any required adjustments
|
|
|
|
|
of the operands, we proceed by trying two more multiplications
|
|
|
|
|
and then computing the appropriate sum.
|
|
|
|
|
|
|
|
|
|
We have checked above that the required addition is provided.
|
|
|
|
|
Full-word addition will normally always succeed, especially if
|
|
|
|
|
it is provided at all, so we don't worry about its failure. The
|
|
|
|
|
multiplication may well fail, however, so we do handle that. */
|
|
|
|
|
|
|
|
|
|
if (product && op0_xhigh && op1_xhigh)
|
|
|
|
|
{
|
|
|
|
|
rtx product_high = operand_subword (product, high, 1, mode);
|
1992-07-06 22:04:10 +02:00
|
|
|
|
rtx temp = expand_binop (word_mode, binoptab, op0_low, op1_xhigh,
|
|
|
|
|
NULL_RTX, 0, OPTAB_DIRECT);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2002-05-22 03:54:40 +02:00
|
|
|
|
if (!REG_P (product_high))
|
|
|
|
|
product_high = force_reg (word_mode, product_high);
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (temp != 0)
|
|
|
|
|
temp = expand_binop (word_mode, add_optab, temp, product_high,
|
|
|
|
|
product_high, 0, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (temp != 0 && temp != product_high)
|
|
|
|
|
emit_move_insn (product_high, temp);
|
|
|
|
|
|
|
|
|
|
if (temp != 0)
|
2003-07-06 11:56:09 +02:00
|
|
|
|
temp = expand_binop (word_mode, binoptab, op1_low, op0_xhigh,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
NULL_RTX, 0, OPTAB_DIRECT);
|
|
|
|
|
|
|
|
|
|
if (temp != 0)
|
|
|
|
|
temp = expand_binop (word_mode, add_optab, temp,
|
|
|
|
|
product_high, product_high,
|
|
|
|
|
0, next_methods);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (temp != 0 && temp != product_high)
|
|
|
|
|
emit_move_insn (product_high, temp);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2002-05-22 03:54:40 +02:00
|
|
|
|
emit_move_insn (operand_subword (product, high, 1, mode), product_high);
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (temp != 0)
|
|
|
|
|
{
|
1996-10-23 16:30:26 +02:00
|
|
|
|
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
temp = emit_move_insn (product, product);
|
1999-03-25 13:04:26 +01:00
|
|
|
|
set_unique_reg_note (temp,
|
2003-07-06 11:56:09 +02:00
|
|
|
|
REG_EQUAL,
|
1999-03-25 13:04:26 +01:00
|
|
|
|
gen_rtx_fmt_ee (MULT, mode,
|
|
|
|
|
copy_rtx (op0),
|
|
|
|
|
copy_rtx (op1)));
|
1996-10-23 16:30:26 +02:00
|
|
|
|
}
|
1999-09-07 07:49:18 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return product;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we get here, we couldn't do it for some reason even though we
|
|
|
|
|
originally thought we could. Delete anything we've emitted in
|
|
|
|
|
trying to do it. */
|
|
|
|
|
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-18 03:35:47 +02:00
|
|
|
|
/* Open-code the vector operations if we have no hardware support
|
|
|
|
|
for them. */
|
|
|
|
|
if (class == MODE_VECTOR_INT || class == MODE_VECTOR_FLOAT)
|
|
|
|
|
return expand_vector_binop (mode, binoptab, op0, op1, target,
|
|
|
|
|
unsignedp, methods);
|
|
|
|
|
|
1992-09-10 03:00:39 +02:00
|
|
|
|
/* We need to open-code the complex type operations: '+, -, * and /' */
|
|
|
|
|
|
|
|
|
|
/* At this point we allow operations between two similar complex
|
|
|
|
|
numbers, and also if one of the operands is not a complex number
|
|
|
|
|
but rather of MODE_FLOAT or MODE_INT. However, the caller
|
|
|
|
|
must make sure that the MODE of the non-complex operand matches
|
1992-09-11 03:15:31 +02:00
|
|
|
|
the SUBMODE of the complex operand. */
|
1992-09-10 03:00:39 +02:00
|
|
|
|
|
|
|
|
|
if (class == MODE_COMPLEX_FLOAT || class == MODE_COMPLEX_INT)
|
1992-09-11 03:15:31 +02:00
|
|
|
|
{
|
1994-06-23 00:15:30 +02:00
|
|
|
|
rtx real0 = 0, imag0 = 0;
|
|
|
|
|
rtx real1 = 0, imag1 = 0;
|
|
|
|
|
rtx realr, imagr, res;
|
2003-10-23 23:37:52 +02:00
|
|
|
|
rtx seq, result;
|
1994-06-23 00:15:30 +02:00
|
|
|
|
int ok = 0;
|
1992-09-10 03:00:39 +02:00
|
|
|
|
|
2003-06-29 15:53:12 +02:00
|
|
|
|
/* Find the correct mode for the real and imaginary parts. */
|
2003-10-23 23:37:52 +02:00
|
|
|
|
enum machine_mode submode = GET_MODE_INNER (mode);
|
1992-09-10 03:00:39 +02:00
|
|
|
|
|
|
|
|
|
if (submode == BLKmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (op0) == mode)
|
|
|
|
|
{
|
1999-05-18 03:05:14 +02:00
|
|
|
|
real0 = gen_realpart (submode, op0);
|
1992-10-05 07:28:37 +01:00
|
|
|
|
imag0 = gen_imagpart (submode, op0);
|
1992-09-10 03:00:39 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
real0 = op0;
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (op1) == mode)
|
|
|
|
|
{
|
1999-05-18 03:05:14 +02:00
|
|
|
|
real1 = gen_realpart (submode, op1);
|
1992-10-05 07:28:37 +01:00
|
|
|
|
imag1 = gen_imagpart (submode, op1);
|
1992-09-10 03:00:39 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
real1 = op1;
|
|
|
|
|
|
2002-05-20 10:30:03 +02:00
|
|
|
|
if (real0 == 0 || real1 == 0 || ! (imag0 != 0 || imag1 != 0))
|
1992-09-10 03:00:39 +02:00
|
|
|
|
abort ();
|
|
|
|
|
|
2003-10-23 23:37:52 +02:00
|
|
|
|
result = gen_reg_rtx (mode);
|
|
|
|
|
realr = gen_realpart (submode, result);
|
|
|
|
|
imagr = gen_imagpart (submode, result);
|
|
|
|
|
|
1992-09-11 03:15:31 +02:00
|
|
|
|
switch (binoptab->code)
|
|
|
|
|
{
|
|
|
|
|
case PLUS:
|
1993-01-09 09:51:21 +01:00
|
|
|
|
/* (a+ib) + (c+id) = (a+c) + i(b+d) */
|
1992-09-11 03:15:31 +02:00
|
|
|
|
case MINUS:
|
1993-01-09 09:51:21 +01:00
|
|
|
|
/* (a+ib) - (c+id) = (a-c) + i(b-d) */
|
1992-09-10 03:00:39 +02:00
|
|
|
|
res = expand_binop (submode, binoptab, real0, real1,
|
|
|
|
|
realr, unsignedp, methods);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
else if (res != realr)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
emit_move_insn (realr, res);
|
|
|
|
|
|
2002-07-10 23:13:26 +02:00
|
|
|
|
if (imag0 != 0 && imag1 != 0)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
res = expand_binop (submode, binoptab, imag0, imag1,
|
|
|
|
|
imagr, unsignedp, methods);
|
2002-07-10 23:13:26 +02:00
|
|
|
|
else if (imag0 != 0)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
res = imag0;
|
|
|
|
|
else if (binoptab->code == MINUS)
|
2000-10-18 23:33:41 +02:00
|
|
|
|
res = expand_unop (submode,
|
|
|
|
|
binoptab == subv_optab ? negv_optab : neg_optab,
|
|
|
|
|
imag1, imagr, unsignedp);
|
1992-09-10 03:00:39 +02:00
|
|
|
|
else
|
|
|
|
|
res = imag1;
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
else if (res != imagr)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
emit_move_insn (imagr, res);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
ok = 1;
|
1992-09-10 03:00:39 +02:00
|
|
|
|
break;
|
1992-09-11 03:15:31 +02:00
|
|
|
|
|
|
|
|
|
case MULT:
|
1992-09-10 03:00:39 +02:00
|
|
|
|
/* (a+ib) * (c+id) = (ac-bd) + i(ad+cb) */
|
|
|
|
|
|
2002-07-10 23:13:26 +02:00
|
|
|
|
if (imag0 != 0 && imag1 != 0)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
{
|
1994-06-23 00:15:30 +02:00
|
|
|
|
rtx temp1, temp2;
|
|
|
|
|
|
1993-03-04 21:37:02 +01:00
|
|
|
|
/* Don't fetch these from memory more than once. */
|
|
|
|
|
real0 = force_reg (submode, real0);
|
|
|
|
|
real1 = force_reg (submode, real1);
|
|
|
|
|
imag0 = force_reg (submode, imag0);
|
|
|
|
|
imag1 = force_reg (submode, imag1);
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
temp1 = expand_binop (submode, binoptab, real0, real1, NULL_RTX,
|
|
|
|
|
unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
temp2 = expand_binop (submode, binoptab, imag0, imag1, NULL_RTX,
|
|
|
|
|
unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (temp1 == 0 || temp2 == 0)
|
|
|
|
|
break;
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
res = (expand_binop
|
|
|
|
|
(submode,
|
|
|
|
|
binoptab == smulv_optab ? subv_optab : sub_optab,
|
|
|
|
|
temp1, temp2, realr, unsignedp, methods));
|
1992-09-10 03:00:39 +02:00
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
else if (res != realr)
|
1993-03-04 21:37:02 +01:00
|
|
|
|
emit_move_insn (realr, res);
|
1992-09-10 03:00:39 +02:00
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
temp1 = expand_binop (submode, binoptab, real0, imag1,
|
|
|
|
|
NULL_RTX, unsignedp, methods);
|
|
|
|
|
|
2003-06-04 06:42:14 +02:00
|
|
|
|
/* Avoid expanding redundant multiplication for the common
|
|
|
|
|
case of squaring a complex number. */
|
|
|
|
|
if (rtx_equal_p (real0, real1) && rtx_equal_p (imag0, imag1))
|
|
|
|
|
temp2 = temp1;
|
|
|
|
|
else
|
|
|
|
|
temp2 = expand_binop (submode, binoptab, real1, imag0,
|
|
|
|
|
NULL_RTX, unsignedp, methods);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
if (temp1 == 0 || temp2 == 0)
|
2002-11-16 07:08:16 +01:00
|
|
|
|
break;
|
1994-07-29 01:28:18 +02:00
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
res = (expand_binop
|
|
|
|
|
(submode,
|
|
|
|
|
binoptab == smulv_optab ? addv_optab : add_optab,
|
|
|
|
|
temp1, temp2, imagr, unsignedp, methods));
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
else if (res != imagr)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
emit_move_insn (imagr, res);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
ok = 1;
|
1992-09-10 03:00:39 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1993-03-04 21:37:02 +01:00
|
|
|
|
/* Don't fetch these from memory more than once. */
|
|
|
|
|
real0 = force_reg (submode, real0);
|
|
|
|
|
real1 = force_reg (submode, real1);
|
|
|
|
|
|
1993-01-09 09:51:21 +01:00
|
|
|
|
res = expand_binop (submode, binoptab, real0, real1,
|
|
|
|
|
realr, unsignedp, methods);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
else if (res != realr)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
emit_move_insn (realr, res);
|
|
|
|
|
|
2002-07-10 23:13:26 +02:00
|
|
|
|
if (imag0 != 0)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
res = expand_binop (submode, binoptab,
|
|
|
|
|
real1, imag0, imagr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_binop (submode, binoptab,
|
|
|
|
|
real0, imag1, imagr, unsignedp, methods);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
else if (res != imagr)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
emit_move_insn (imagr, res);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
|
|
|
|
ok = 1;
|
1992-09-10 03:00:39 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
1992-09-11 03:15:31 +02:00
|
|
|
|
|
|
|
|
|
case DIV:
|
1993-01-09 09:51:21 +01:00
|
|
|
|
/* (a+ib) / (c+id) = ((ac+bd)/(cc+dd)) + i((bc-ad)/(cc+dd)) */
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
2002-07-10 23:13:26 +02:00
|
|
|
|
if (imag1 == 0)
|
1994-06-23 00:15:30 +02:00
|
|
|
|
{
|
|
|
|
|
/* (a+ib) / (c+i0) = (a/c) + i(b/c) */
|
1993-03-04 21:37:02 +01:00
|
|
|
|
|
|
|
|
|
/* Don't fetch these from memory more than once. */
|
|
|
|
|
real1 = force_reg (submode, real1);
|
|
|
|
|
|
1993-01-09 09:51:21 +01:00
|
|
|
|
/* Simply divide the real and imaginary parts by `c' */
|
1994-02-28 12:21:06 +01:00
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, real0, real1,
|
|
|
|
|
realr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
real0, real1, realr, unsignedp);
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
else if (res != realr)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
emit_move_insn (realr, res);
|
|
|
|
|
|
1994-02-28 12:21:06 +01:00
|
|
|
|
if (class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, imag0, real1,
|
|
|
|
|
imagr, unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
imag0, real1, imagr, unsignedp);
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
else if (res != imagr)
|
1992-09-10 03:00:39 +02:00
|
|
|
|
emit_move_insn (imagr, res);
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
ok = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1999-05-18 03:05:14 +02:00
|
|
|
|
switch (flag_complex_divide_method)
|
1994-06-23 00:15:30 +02:00
|
|
|
|
{
|
1999-05-18 03:05:14 +02:00
|
|
|
|
case 0:
|
|
|
|
|
ok = expand_cmplxdiv_straight (real0, real1, imag0, imag1,
|
|
|
|
|
realr, imagr, submode,
|
|
|
|
|
unsignedp, methods,
|
|
|
|
|
class, binoptab);
|
|
|
|
|
break;
|
1994-07-07 23:53:06 +02:00
|
|
|
|
|
1999-05-18 03:05:14 +02:00
|
|
|
|
case 1:
|
|
|
|
|
ok = expand_cmplxdiv_wide (real0, real1, imag0, imag1,
|
|
|
|
|
realr, imagr, submode,
|
|
|
|
|
unsignedp, methods,
|
|
|
|
|
class, binoptab);
|
|
|
|
|
break;
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
1999-05-18 03:05:14 +02:00
|
|
|
|
default:
|
|
|
|
|
abort ();
|
1992-09-10 03:00:39 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1992-09-10 03:00:39 +02:00
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
1992-09-28 17:24:36 +01:00
|
|
|
|
seq = get_insns ();
|
1992-09-10 03:00:39 +02:00
|
|
|
|
end_sequence ();
|
|
|
|
|
|
1994-06-23 00:15:30 +02:00
|
|
|
|
if (ok)
|
|
|
|
|
{
|
2003-10-23 23:37:52 +02:00
|
|
|
|
rtx equiv = gen_rtx_fmt_ee (binoptab->code, mode,
|
|
|
|
|
copy_rtx (op0), copy_rtx (op1));
|
|
|
|
|
emit_no_conflict_block (seq, result, op0, op1, equiv);
|
|
|
|
|
return result;
|
1994-06-23 00:15:30 +02:00
|
|
|
|
}
|
1992-09-10 03:00:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* It can't be open-coded in this mode.
|
|
|
|
|
Use a library call if one is available and caller says that's ok. */
|
|
|
|
|
|
|
|
|
|
if (binoptab->handlers[(int) mode].libfunc
|
|
|
|
|
&& (methods == OPTAB_LIB || methods == OPTAB_LIB_WIDEN))
|
|
|
|
|
{
|
|
|
|
|
rtx insns;
|
1992-09-13 19:26:24 +02:00
|
|
|
|
rtx op1x = op1;
|
|
|
|
|
enum machine_mode op1_mode = mode;
|
1993-09-15 15:38:01 +02:00
|
|
|
|
rtx value;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
1992-09-13 19:26:24 +02:00
|
|
|
|
if (shift_op)
|
|
|
|
|
{
|
|
|
|
|
op1_mode = word_mode;
|
|
|
|
|
/* Specify unsigned here,
|
|
|
|
|
since negative shift counts are meaningless. */
|
|
|
|
|
op1x = convert_to_mode (word_mode, op1, 1);
|
|
|
|
|
}
|
|
|
|
|
|
1995-01-28 00:38:22 +01:00
|
|
|
|
if (GET_MODE (op0) != VOIDmode
|
|
|
|
|
&& GET_MODE (op0) != mode)
|
1994-06-29 02:21:32 +02:00
|
|
|
|
op0 = convert_to_mode (mode, op0, unsignedp);
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Pass 1 for NO_QUEUE so we don't lose any increments
|
|
|
|
|
if the libcall is cse'd or moved. */
|
1993-09-15 15:38:01 +02:00
|
|
|
|
value = emit_library_call_value (binoptab->handlers[(int) mode].libfunc,
|
2000-09-17 14:45:51 +02:00
|
|
|
|
NULL_RTX, LCT_CONST, mode, 2,
|
1993-09-15 15:38:01 +02:00
|
|
|
|
op0, mode, op1x, op1_mode);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
|
|
|
|
target = gen_reg_rtx (mode);
|
1993-09-15 15:38:01 +02:00
|
|
|
|
emit_libcall_block (insns, target, value,
|
1998-06-24 16:49:51 +02:00
|
|
|
|
gen_rtx_fmt_ee (binoptab->code, mode, op0, op1));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
|
|
|
|
|
/* It can't be done in this mode. Can we do it in a wider mode? */
|
|
|
|
|
|
|
|
|
|
if (! (methods == OPTAB_WIDEN || methods == OPTAB_LIB_WIDEN
|
|
|
|
|
|| methods == OPTAB_MUST_WIDEN))
|
1992-11-25 19:04:15 +01:00
|
|
|
|
{
|
|
|
|
|
/* Caller says, don't even try. */
|
|
|
|
|
delete_insns_since (entry_last);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Compute the value of METHODS to pass to recursive calls.
|
|
|
|
|
Don't allow widening to be tried recursively. */
|
|
|
|
|
|
|
|
|
|
methods = (methods == OPTAB_LIB_WIDEN ? OPTAB_LIB : OPTAB_DIRECT);
|
|
|
|
|
|
1992-01-18 00:19:29 +01:00
|
|
|
|
/* Look for a wider mode of the same class for which it appears we can do
|
|
|
|
|
the operation. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
{
|
1992-01-18 00:19:29 +01:00
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
|
|
|
|
if ((binoptab->handlers[(int) wider_mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
|| (methods == OPTAB_LIB
|
|
|
|
|
&& binoptab->handlers[(int) wider_mode].libfunc))
|
|
|
|
|
{
|
|
|
|
|
rtx xop0 = op0, xop1 = op1;
|
|
|
|
|
int no_extend = 0;
|
|
|
|
|
|
1992-01-18 00:19:29 +01:00
|
|
|
|
/* For certain integer operations, we need not actually extend
|
1991-12-30 04:19:53 +01:00
|
|
|
|
the narrow operands, as long as we will truncate
|
1993-08-09 13:30:54 +02:00
|
|
|
|
the results to the same narrowness. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1992-01-18 00:19:29 +01:00
|
|
|
|
if ((binoptab == ior_optab || binoptab == and_optab
|
|
|
|
|
|| binoptab == xor_optab
|
|
|
|
|
|| binoptab == add_optab || binoptab == sub_optab
|
1994-04-10 14:03:05 +02:00
|
|
|
|
|| binoptab == smul_optab || binoptab == ashl_optab)
|
1993-08-09 13:30:54 +02:00
|
|
|
|
&& class == MODE_INT)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
no_extend = 1;
|
|
|
|
|
|
1993-09-09 21:50:55 +02:00
|
|
|
|
xop0 = widen_operand (xop0, wider_mode, mode,
|
|
|
|
|
unsignedp, no_extend);
|
1993-09-07 20:54:27 +02:00
|
|
|
|
|
|
|
|
|
/* The second operand of a shift must always be extended. */
|
1993-09-09 21:50:55 +02:00
|
|
|
|
xop1 = widen_operand (xop1, wider_mode, mode, unsignedp,
|
1994-04-10 14:03:05 +02:00
|
|
|
|
no_extend && binoptab != ashl_optab);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1992-07-06 22:04:10 +02:00
|
|
|
|
temp = expand_binop (wider_mode, binoptab, xop0, xop1, NULL_RTX,
|
1991-12-30 04:19:53 +01:00
|
|
|
|
unsignedp, methods);
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
1992-01-18 00:19:29 +01:00
|
|
|
|
if (class != MODE_INT)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
convert_move (target, temp, 0);
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return gen_lowpart (mode, temp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1992-11-25 19:04:15 +01:00
|
|
|
|
delete_insns_since (entry_last);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-06-18 03:35:47 +02:00
|
|
|
|
|
|
|
|
|
/* Like expand_binop, but for open-coding vectors binops. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_vector_binop (enum machine_mode mode, optab binoptab, rtx op0,
|
|
|
|
|
rtx op1, rtx target, int unsignedp,
|
|
|
|
|
enum optab_methods methods)
|
2002-06-18 03:35:47 +02:00
|
|
|
|
{
|
2002-07-03 11:49:46 +02:00
|
|
|
|
enum machine_mode submode, tmode;
|
|
|
|
|
int size, elts, subsize, subbitsize, i;
|
2002-06-18 03:35:47 +02:00
|
|
|
|
rtx t, a, b, res, seq;
|
|
|
|
|
enum mode_class class;
|
|
|
|
|
|
|
|
|
|
class = GET_MODE_CLASS (mode);
|
|
|
|
|
|
2002-11-16 07:08:16 +01:00
|
|
|
|
size = GET_MODE_SIZE (mode);
|
2002-06-18 03:35:47 +02:00
|
|
|
|
submode = GET_MODE_INNER (mode);
|
|
|
|
|
|
2002-07-03 11:49:46 +02:00
|
|
|
|
/* Search for the widest vector mode with the same inner mode that is
|
|
|
|
|
still narrower than MODE and that allows to open-code this operator.
|
|
|
|
|
Note, if we find such a mode and the handler later decides it can't
|
|
|
|
|
do the expansion, we'll be called recursively with the narrower mode. */
|
|
|
|
|
for (tmode = GET_CLASS_NARROWEST_MODE (class);
|
|
|
|
|
GET_MODE_SIZE (tmode) < GET_MODE_SIZE (mode);
|
|
|
|
|
tmode = GET_MODE_WIDER_MODE (tmode))
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE_INNER (tmode) == GET_MODE_INNER (mode)
|
|
|
|
|
&& binoptab->handlers[(int) tmode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
submode = tmode;
|
|
|
|
|
}
|
2002-06-18 03:35:47 +02:00
|
|
|
|
|
|
|
|
|
switch (binoptab->code)
|
|
|
|
|
{
|
2002-07-03 11:49:46 +02:00
|
|
|
|
case AND:
|
|
|
|
|
case IOR:
|
|
|
|
|
case XOR:
|
|
|
|
|
tmode = int_mode_for_mode (mode);
|
|
|
|
|
if (tmode != BLKmode)
|
|
|
|
|
submode = tmode;
|
2002-06-18 03:35:47 +02:00
|
|
|
|
case PLUS:
|
|
|
|
|
case MINUS:
|
|
|
|
|
case MULT:
|
|
|
|
|
case DIV:
|
2002-07-03 11:49:46 +02:00
|
|
|
|
subsize = GET_MODE_SIZE (submode);
|
|
|
|
|
subbitsize = GET_MODE_BITSIZE (submode);
|
|
|
|
|
elts = size / subsize;
|
|
|
|
|
|
|
|
|
|
/* If METHODS is OPTAB_DIRECT, we don't insist on the exact mode,
|
|
|
|
|
but that we operate on more than one element at a time. */
|
|
|
|
|
if (subsize == GET_MODE_UNIT_SIZE (mode) && methods == OPTAB_DIRECT)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
/* Errors can leave us with a const0_rtx as operand. */
|
|
|
|
|
if (GET_MODE (op0) != mode)
|
|
|
|
|
op0 = copy_to_mode_reg (mode, op0);
|
|
|
|
|
if (GET_MODE (op1) != mode)
|
|
|
|
|
op1 = copy_to_mode_reg (mode, op1);
|
|
|
|
|
|
|
|
|
|
if (!target)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
2002-06-18 03:35:47 +02:00
|
|
|
|
for (i = 0; i < elts; ++i)
|
|
|
|
|
{
|
2002-07-03 11:49:46 +02:00
|
|
|
|
/* If this is part of a register, and not the first item in the
|
|
|
|
|
word, we can't store using a SUBREG - that would clobber
|
|
|
|
|
previous results.
|
|
|
|
|
And storing with a SUBREG is only possible for the least
|
|
|
|
|
significant part, hence we can't do it for big endian
|
|
|
|
|
(unless we want to permute the evaluation order. */
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (REG_P (target)
|
2002-07-03 11:49:46 +02:00
|
|
|
|
&& (BYTES_BIG_ENDIAN
|
|
|
|
|
? subsize < UNITS_PER_WORD
|
|
|
|
|
: ((i * subsize) % UNITS_PER_WORD) != 0))
|
|
|
|
|
t = NULL_RTX;
|
|
|
|
|
else
|
|
|
|
|
t = simplify_gen_subreg (submode, target, mode, i * subsize);
|
|
|
|
|
if (CONSTANT_P (op0))
|
|
|
|
|
a = simplify_gen_subreg (submode, op0, mode, i * subsize);
|
|
|
|
|
else
|
|
|
|
|
a = extract_bit_field (op0, subbitsize, i * subbitsize, unsignedp,
|
2004-07-10 10:04:58 +02:00
|
|
|
|
NULL_RTX, submode, submode);
|
2002-07-03 11:49:46 +02:00
|
|
|
|
if (CONSTANT_P (op1))
|
|
|
|
|
b = simplify_gen_subreg (submode, op1, mode, i * subsize);
|
|
|
|
|
else
|
|
|
|
|
b = extract_bit_field (op1, subbitsize, i * subbitsize, unsignedp,
|
2004-07-10 10:04:58 +02:00
|
|
|
|
NULL_RTX, submode, submode);
|
2002-06-18 03:35:47 +02:00
|
|
|
|
|
|
|
|
|
if (binoptab->code == DIV)
|
|
|
|
|
{
|
|
|
|
|
if (class == MODE_VECTOR_FLOAT)
|
|
|
|
|
res = expand_binop (submode, binoptab, a, b, t,
|
|
|
|
|
unsignedp, methods);
|
|
|
|
|
else
|
|
|
|
|
res = expand_divmod (0, TRUNC_DIV_EXPR, submode,
|
|
|
|
|
a, b, t, unsignedp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
res = expand_binop (submode, binoptab, a, b, t,
|
|
|
|
|
unsignedp, methods);
|
|
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
|
break;
|
|
|
|
|
|
2002-07-03 11:49:46 +02:00
|
|
|
|
if (t)
|
|
|
|
|
emit_move_insn (t, res);
|
|
|
|
|
else
|
2004-07-10 10:04:58 +02:00
|
|
|
|
store_bit_field (target, subbitsize, i * subbitsize, submode, res);
|
2002-06-18 03:35:47 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
seq = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
emit_insn (seq);
|
|
|
|
|
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like expand_unop but for open-coding vector unops. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_vector_unop (enum machine_mode mode, optab unoptab, rtx op0,
|
|
|
|
|
rtx target, int unsignedp)
|
2002-06-18 03:35:47 +02:00
|
|
|
|
{
|
2002-07-03 11:49:46 +02:00
|
|
|
|
enum machine_mode submode, tmode;
|
|
|
|
|
int size, elts, subsize, subbitsize, i;
|
2002-06-18 03:35:47 +02:00
|
|
|
|
rtx t, a, res, seq;
|
|
|
|
|
|
2002-11-16 07:08:16 +01:00
|
|
|
|
size = GET_MODE_SIZE (mode);
|
2002-06-18 03:35:47 +02:00
|
|
|
|
submode = GET_MODE_INNER (mode);
|
2002-07-03 11:49:46 +02:00
|
|
|
|
|
|
|
|
|
/* Search for the widest vector mode with the same inner mode that is
|
|
|
|
|
still narrower than MODE and that allows to open-code this operator.
|
|
|
|
|
Note, if we find such a mode and the handler later decides it can't
|
|
|
|
|
do the expansion, we'll be called recursively with the narrower mode. */
|
|
|
|
|
for (tmode = GET_CLASS_NARROWEST_MODE (GET_MODE_CLASS (mode));
|
|
|
|
|
GET_MODE_SIZE (tmode) < GET_MODE_SIZE (mode);
|
|
|
|
|
tmode = GET_MODE_WIDER_MODE (tmode))
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE_INNER (tmode) == GET_MODE_INNER (mode)
|
|
|
|
|
&& unoptab->handlers[(int) tmode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
submode = tmode;
|
|
|
|
|
}
|
|
|
|
|
/* If there is no negate operation, try doing a subtract from zero. */
|
2002-07-22 16:22:58 +02:00
|
|
|
|
if (unoptab == neg_optab && GET_MODE_CLASS (submode) == MODE_INT
|
|
|
|
|
/* Avoid infinite recursion when an
|
|
|
|
|
error has left us with the wrong mode. */
|
|
|
|
|
&& GET_MODE (op0) == mode)
|
2003-07-06 11:56:09 +02:00
|
|
|
|
{
|
2002-07-03 11:49:46 +02:00
|
|
|
|
rtx temp;
|
|
|
|
|
temp = expand_binop (mode, sub_optab, CONST0_RTX (mode), op0,
|
|
|
|
|
target, unsignedp, OPTAB_DIRECT);
|
|
|
|
|
if (temp)
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (unoptab == one_cmpl_optab)
|
|
|
|
|
{
|
|
|
|
|
tmode = int_mode_for_mode (mode);
|
|
|
|
|
if (tmode != BLKmode)
|
|
|
|
|
submode = tmode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
subsize = GET_MODE_SIZE (submode);
|
|
|
|
|
subbitsize = GET_MODE_BITSIZE (submode);
|
|
|
|
|
elts = size / subsize;
|
|
|
|
|
|
|
|
|
|
/* Errors can leave us with a const0_rtx as operand. */
|
|
|
|
|
if (GET_MODE (op0) != mode)
|
|
|
|
|
op0 = copy_to_mode_reg (mode, op0);
|
2002-06-18 03:35:47 +02:00
|
|
|
|
|
|
|
|
|
if (!target)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < elts; ++i)
|
|
|
|
|
{
|
2002-07-03 11:49:46 +02:00
|
|
|
|
/* If this is part of a register, and not the first item in the
|
|
|
|
|
word, we can't store using a SUBREG - that would clobber
|
|
|
|
|
previous results.
|
|
|
|
|
And storing with a SUBREG is only possible for the least
|
|
|
|
|
significant part, hence we can't do it for big endian
|
|
|
|
|
(unless we want to permute the evaluation order. */
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (REG_P (target)
|
2002-07-03 11:49:46 +02:00
|
|
|
|
&& (BYTES_BIG_ENDIAN
|
|
|
|
|
? subsize < UNITS_PER_WORD
|
|
|
|
|
: ((i * subsize) % UNITS_PER_WORD) != 0))
|
|
|
|
|
t = NULL_RTX;
|
|
|
|
|
else
|
|
|
|
|
t = simplify_gen_subreg (submode, target, mode, i * subsize);
|
|
|
|
|
if (CONSTANT_P (op0))
|
|
|
|
|
a = simplify_gen_subreg (submode, op0, mode, i * subsize);
|
|
|
|
|
else
|
|
|
|
|
a = extract_bit_field (op0, subbitsize, i * subbitsize, unsignedp,
|
2004-07-10 10:04:58 +02:00
|
|
|
|
t, submode, submode);
|
2002-06-18 03:35:47 +02:00
|
|
|
|
|
|
|
|
|
res = expand_unop (submode, unoptab, a, t, unsignedp);
|
|
|
|
|
|
2002-07-03 11:49:46 +02:00
|
|
|
|
if (t)
|
|
|
|
|
emit_move_insn (t, res);
|
|
|
|
|
else
|
2004-07-10 10:04:58 +02:00
|
|
|
|
store_bit_field (target, subbitsize, i * subbitsize, submode, res);
|
2002-06-18 03:35:47 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
seq = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
emit_insn (seq);
|
|
|
|
|
|
|
|
|
|
return target;
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Expand a binary operator which has both signed and unsigned forms.
|
|
|
|
|
UOPTAB is the optab for unsigned operations, and SOPTAB is for
|
|
|
|
|
signed operations.
|
|
|
|
|
|
|
|
|
|
If we widen unsigned operands, we may use a signed wider operation instead
|
|
|
|
|
of an unsigned wider operation, since the result would be the same. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
sign_expand_binop (enum machine_mode mode, optab uoptab, optab soptab,
|
|
|
|
|
rtx op0, rtx op1, rtx target, int unsignedp,
|
|
|
|
|
enum optab_methods methods)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx temp;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
optab direct_optab = unsignedp ? uoptab : soptab;
|
|
|
|
|
struct optab wide_soptab;
|
|
|
|
|
|
|
|
|
|
/* Do it without widening, if possible. */
|
|
|
|
|
temp = expand_binop (mode, direct_optab, op0, op1, target,
|
|
|
|
|
unsignedp, OPTAB_DIRECT);
|
|
|
|
|
if (temp || methods == OPTAB_DIRECT)
|
|
|
|
|
return temp;
|
|
|
|
|
|
|
|
|
|
/* Try widening to a signed int. Make a fake signed optab that
|
|
|
|
|
hides any signed insn for direct use. */
|
|
|
|
|
wide_soptab = *soptab;
|
|
|
|
|
wide_soptab.handlers[(int) mode].insn_code = CODE_FOR_nothing;
|
|
|
|
|
wide_soptab.handlers[(int) mode].libfunc = 0;
|
|
|
|
|
|
|
|
|
|
temp = expand_binop (mode, &wide_soptab, op0, op1, target,
|
|
|
|
|
unsignedp, OPTAB_WIDEN);
|
|
|
|
|
|
|
|
|
|
/* For unsigned operands, try widening to an unsigned int. */
|
|
|
|
|
if (temp == 0 && unsignedp)
|
|
|
|
|
temp = expand_binop (mode, uoptab, op0, op1, target,
|
|
|
|
|
unsignedp, OPTAB_WIDEN);
|
|
|
|
|
if (temp || methods == OPTAB_WIDEN)
|
|
|
|
|
return temp;
|
|
|
|
|
|
|
|
|
|
/* Use the right width lib call if that exists. */
|
|
|
|
|
temp = expand_binop (mode, direct_optab, op0, op1, target, unsignedp, OPTAB_LIB);
|
|
|
|
|
if (temp || methods == OPTAB_LIB)
|
|
|
|
|
return temp;
|
|
|
|
|
|
|
|
|
|
/* Must widen and use a lib call, use either signed or unsigned. */
|
|
|
|
|
temp = expand_binop (mode, &wide_soptab, op0, op1, target,
|
|
|
|
|
unsignedp, methods);
|
|
|
|
|
if (temp != 0)
|
|
|
|
|
return temp;
|
|
|
|
|
if (unsignedp)
|
|
|
|
|
return expand_binop (mode, uoptab, op0, op1, target,
|
|
|
|
|
unsignedp, methods);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
builtins.c: Implement support for sincos function.
2004-04-06 Uros Bizjak <uros@kss-loka.si>
* builtins.c: Implement support for sincos function.
(expand_builtin_mathfn): Remove BUILT_IN_SIN{,F,L} and
BUILT_IN_COS{,F,L}.
(expand_builtin_mathfn_3): New function.
(expand_builtin): Expand BUILT_IN_SIN{,F,L} and
BUILT_IN_COS{,F,L} using expand_builtin_mathfn_3 if
flag_unsafe_math_optimization is set.
* optabs.h (enum optab_index): Add new OTI_sincos.
(sincos_optab): Define corresponding macro.
* optabs.c (init_optabs): Initialize sincos_optab.
(expand_twoval_unop): New function.
* genopinit.c (optabs): Implement sincos_optab using sincos?f3
patterns.
* reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_SINCOS_COS
and UNSPEC_SINCOS_SIN.
* config/i386/i386.md (sincosdf3, sincossf3, *sincosextendsfdf3,
sincosxf3): New patterns to implement sincos, sincosf and sincosl
built-ins as inline x87 intrinsics. Define splits for
sindf2, sinsf2, *sinextendsfdf2, sinxf2, cosdf2,
cossf2, *cosextendsfdf2 and cosxf2 patterns from corresponding
sincos patterns.
(sindf2, sinsf2, sinxf2): Rename to *sindf2, *sinsf2, *sinxf2.
(cosdf2, cossf2, cosxf2): Rename to *cosdf2, *cossf2, *cosxf2.
(UNSPEC_SINCOS_SIN, UNPEC_SINCOS_COS): New unspecs to represent
x87's unspec insn.
* gcc.dg/builtins-36.c: New test.
From-SVN: r80463
2004-04-06 21:34:33 +02:00
|
|
|
|
/* Generate code to perform an operation specified by UNOPPTAB
|
|
|
|
|
on operand OP0, with two results to TARG0 and TARG1.
|
|
|
|
|
We assume that the order of the operands for the instruction
|
|
|
|
|
is TARG0, TARG1, OP0.
|
|
|
|
|
|
|
|
|
|
Either TARG0 or TARG1 may be zero, but what that means is that
|
|
|
|
|
the result is not actually wanted. We will generate it into
|
|
|
|
|
a dummy pseudo-reg and discard it. They may not both be zero.
|
|
|
|
|
|
|
|
|
|
Returns 1 if this operation can be performed; 0 if not. */
|
|
|
|
|
|
|
|
|
|
int
|
2004-04-14 04:37:29 +02:00
|
|
|
|
expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1,
|
builtins.c: Implement support for sincos function.
2004-04-06 Uros Bizjak <uros@kss-loka.si>
* builtins.c: Implement support for sincos function.
(expand_builtin_mathfn): Remove BUILT_IN_SIN{,F,L} and
BUILT_IN_COS{,F,L}.
(expand_builtin_mathfn_3): New function.
(expand_builtin): Expand BUILT_IN_SIN{,F,L} and
BUILT_IN_COS{,F,L} using expand_builtin_mathfn_3 if
flag_unsafe_math_optimization is set.
* optabs.h (enum optab_index): Add new OTI_sincos.
(sincos_optab): Define corresponding macro.
* optabs.c (init_optabs): Initialize sincos_optab.
(expand_twoval_unop): New function.
* genopinit.c (optabs): Implement sincos_optab using sincos?f3
patterns.
* reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_SINCOS_COS
and UNSPEC_SINCOS_SIN.
* config/i386/i386.md (sincosdf3, sincossf3, *sincosextendsfdf3,
sincosxf3): New patterns to implement sincos, sincosf and sincosl
built-ins as inline x87 intrinsics. Define splits for
sindf2, sinsf2, *sinextendsfdf2, sinxf2, cosdf2,
cossf2, *cosextendsfdf2 and cosxf2 patterns from corresponding
sincos patterns.
(sindf2, sinsf2, sinxf2): Rename to *sindf2, *sinsf2, *sinxf2.
(cosdf2, cossf2, cosxf2): Rename to *cosdf2, *cossf2, *cosxf2.
(UNSPEC_SINCOS_SIN, UNPEC_SINCOS_COS): New unspecs to represent
x87's unspec insn.
* gcc.dg/builtins-36.c: New test.
From-SVN: r80463
2004-04-06 21:34:33 +02:00
|
|
|
|
int unsignedp)
|
|
|
|
|
{
|
|
|
|
|
enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
|
|
|
|
|
enum mode_class class;
|
|
|
|
|
enum machine_mode wider_mode;
|
|
|
|
|
rtx entry_last = get_last_insn ();
|
|
|
|
|
rtx last;
|
|
|
|
|
|
|
|
|
|
class = GET_MODE_CLASS (mode);
|
|
|
|
|
|
|
|
|
|
op0 = protect_from_queue (op0, 0);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
{
|
|
|
|
|
op0 = force_not_mem (op0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (targ0)
|
|
|
|
|
targ0 = protect_from_queue (targ0, 1);
|
|
|
|
|
else
|
|
|
|
|
targ0 = gen_reg_rtx (mode);
|
|
|
|
|
if (targ1)
|
|
|
|
|
targ1 = protect_from_queue (targ1, 1);
|
|
|
|
|
else
|
|
|
|
|
targ1 = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
/* Record where to go back to if we fail. */
|
|
|
|
|
last = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
if (unoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
int icode = (int) unoptab->handlers[(int) mode].insn_code;
|
|
|
|
|
enum machine_mode mode0 = insn_data[icode].operand[2].mode;
|
|
|
|
|
rtx pat;
|
|
|
|
|
rtx xop0 = op0;
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (xop0) != VOIDmode
|
|
|
|
|
&& GET_MODE (xop0) != mode0)
|
|
|
|
|
xop0 = convert_to_mode (mode0, xop0, unsignedp);
|
|
|
|
|
|
|
|
|
|
/* Now, if insn doesn't accept these operands, put them into pseudos. */
|
|
|
|
|
if (! (*insn_data[icode].operand[2].predicate) (xop0, mode0))
|
|
|
|
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
|
|
|
|
|
|
|
|
|
/* We could handle this, but we should always be called with a pseudo
|
|
|
|
|
for our targets and all insns should take them as outputs. */
|
|
|
|
|
if (! (*insn_data[icode].operand[0].predicate) (targ0, mode)
|
|
|
|
|
|| ! (*insn_data[icode].operand[1].predicate) (targ1, mode))
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
pat = GEN_FCN (icode) (targ0, targ1, xop0);
|
|
|
|
|
if (pat)
|
|
|
|
|
{
|
|
|
|
|
emit_insn (pat);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* It can't be done in this mode. Can we do it in a wider mode? */
|
|
|
|
|
|
|
|
|
|
if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
{
|
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
|
|
|
|
if (unoptab->handlers[(int) wider_mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
rtx t0 = gen_reg_rtx (wider_mode);
|
|
|
|
|
rtx t1 = gen_reg_rtx (wider_mode);
|
|
|
|
|
rtx cop0 = convert_modes (wider_mode, mode, op0, unsignedp);
|
|
|
|
|
|
2004-04-14 04:37:29 +02:00
|
|
|
|
if (expand_twoval_unop (unoptab, cop0, t0, t1, unsignedp))
|
builtins.c: Implement support for sincos function.
2004-04-06 Uros Bizjak <uros@kss-loka.si>
* builtins.c: Implement support for sincos function.
(expand_builtin_mathfn): Remove BUILT_IN_SIN{,F,L} and
BUILT_IN_COS{,F,L}.
(expand_builtin_mathfn_3): New function.
(expand_builtin): Expand BUILT_IN_SIN{,F,L} and
BUILT_IN_COS{,F,L} using expand_builtin_mathfn_3 if
flag_unsafe_math_optimization is set.
* optabs.h (enum optab_index): Add new OTI_sincos.
(sincos_optab): Define corresponding macro.
* optabs.c (init_optabs): Initialize sincos_optab.
(expand_twoval_unop): New function.
* genopinit.c (optabs): Implement sincos_optab using sincos?f3
patterns.
* reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_SINCOS_COS
and UNSPEC_SINCOS_SIN.
* config/i386/i386.md (sincosdf3, sincossf3, *sincosextendsfdf3,
sincosxf3): New patterns to implement sincos, sincosf and sincosl
built-ins as inline x87 intrinsics. Define splits for
sindf2, sinsf2, *sinextendsfdf2, sinxf2, cosdf2,
cossf2, *cosextendsfdf2 and cosxf2 patterns from corresponding
sincos patterns.
(sindf2, sinsf2, sinxf2): Rename to *sindf2, *sinsf2, *sinxf2.
(cosdf2, cossf2, cosxf2): Rename to *cosdf2, *cossf2, *cosxf2.
(UNSPEC_SINCOS_SIN, UNPEC_SINCOS_COS): New unspecs to represent
x87's unspec insn.
* gcc.dg/builtins-36.c: New test.
From-SVN: r80463
2004-04-06 21:34:33 +02:00
|
|
|
|
{
|
|
|
|
|
convert_move (targ0, t0, unsignedp);
|
|
|
|
|
convert_move (targ1, t1, unsignedp);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delete_insns_since (entry_last);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Generate code to perform an operation specified by BINOPTAB
|
|
|
|
|
on operands OP0 and OP1, with two results to TARG1 and TARG2.
|
|
|
|
|
We assume that the order of the operands for the instruction
|
|
|
|
|
is TARG0, OP0, OP1, TARG1, which would fit a pattern like
|
|
|
|
|
[(set TARG0 (operate OP0 OP1)) (set TARG1 (operate ...))].
|
|
|
|
|
|
|
|
|
|
Either TARG0 or TARG1 may be zero, but what that means is that
|
1998-05-06 23:09:07 +02:00
|
|
|
|
the result is not actually wanted. We will generate it into
|
1991-12-30 04:19:53 +01:00
|
|
|
|
a dummy pseudo-reg and discard it. They may not both be zero.
|
|
|
|
|
|
|
|
|
|
Returns 1 if this operation can be performed; 0 if not. */
|
|
|
|
|
|
|
|
|
|
int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1,
|
|
|
|
|
int unsignedp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
|
|
|
|
|
enum mode_class class;
|
|
|
|
|
enum machine_mode wider_mode;
|
1992-11-25 19:04:15 +01:00
|
|
|
|
rtx entry_last = get_last_insn ();
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx last;
|
|
|
|
|
|
|
|
|
|
class = GET_MODE_CLASS (mode);
|
|
|
|
|
|
|
|
|
|
op0 = protect_from_queue (op0, 0);
|
|
|
|
|
op1 = protect_from_queue (op1, 0);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
{
|
|
|
|
|
op0 = force_not_mem (op0);
|
|
|
|
|
op1 = force_not_mem (op1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we are inside an appropriately-short loop and one operand is an
|
|
|
|
|
expensive constant, force it into a register. */
|
1992-04-18 21:40:49 +02:00
|
|
|
|
if (CONSTANT_P (op0) && preserve_subexpressions_p ()
|
2000-09-15 04:56:02 +02:00
|
|
|
|
&& rtx_cost (op0, binoptab->code) > COSTS_N_INSNS (1))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
op0 = force_reg (mode, op0);
|
|
|
|
|
|
1992-04-18 21:40:49 +02:00
|
|
|
|
if (CONSTANT_P (op1) && preserve_subexpressions_p ()
|
2000-09-15 04:56:02 +02:00
|
|
|
|
&& rtx_cost (op1, binoptab->code) > COSTS_N_INSNS (1))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
op1 = force_reg (mode, op1);
|
|
|
|
|
|
|
|
|
|
if (targ0)
|
|
|
|
|
targ0 = protect_from_queue (targ0, 1);
|
|
|
|
|
else
|
|
|
|
|
targ0 = gen_reg_rtx (mode);
|
|
|
|
|
if (targ1)
|
|
|
|
|
targ1 = protect_from_queue (targ1, 1);
|
|
|
|
|
else
|
|
|
|
|
targ1 = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
/* Record where to go back to if we fail. */
|
|
|
|
|
last = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
if (binoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
int icode = (int) binoptab->handlers[(int) mode].insn_code;
|
1999-09-12 14:46:08 +02:00
|
|
|
|
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
|
|
|
|
|
enum machine_mode mode1 = insn_data[icode].operand[2].mode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx pat;
|
|
|
|
|
rtx xop0 = op0, xop1 = op1;
|
|
|
|
|
|
2002-09-12 03:29:21 +02:00
|
|
|
|
/* In case the insn wants input operands in modes different from
|
|
|
|
|
those of the actual operands, convert the operands. It would
|
|
|
|
|
seem that we don't need to convert CONST_INTs, but we do, so
|
2002-11-19 21:13:20 +01:00
|
|
|
|
that they're properly zero-extended, sign-extended or truncated
|
|
|
|
|
for their mode. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2002-09-12 03:29:21 +02:00
|
|
|
|
if (GET_MODE (op0) != mode0 && mode0 != VOIDmode)
|
|
|
|
|
xop0 = convert_modes (mode0,
|
|
|
|
|
GET_MODE (op0) != VOIDmode
|
|
|
|
|
? GET_MODE (op0)
|
|
|
|
|
: mode,
|
|
|
|
|
xop0, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (op1) != mode1 && mode1 != VOIDmode)
|
|
|
|
|
xop1 = convert_modes (mode1,
|
|
|
|
|
GET_MODE (op1) != VOIDmode
|
|
|
|
|
? GET_MODE (op1)
|
|
|
|
|
: mode,
|
|
|
|
|
xop1, unsignedp);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Now, if insn doesn't accept these operands, put them into pseudos. */
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[2].predicate) (xop1, mode1))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
xop1 = copy_to_mode_reg (mode1, xop1);
|
|
|
|
|
|
|
|
|
|
/* We could handle this, but we should always be called with a pseudo
|
|
|
|
|
for our targets and all insns should take them as outputs. */
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[0].predicate) (targ0, mode)
|
|
|
|
|
|| ! (*insn_data[icode].operand[3].predicate) (targ1, mode))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
abort ();
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
pat = GEN_FCN (icode) (targ0, xop0, xop1, targ1);
|
|
|
|
|
if (pat)
|
|
|
|
|
{
|
|
|
|
|
emit_insn (pat);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* It can't be done in this mode. Can we do it in a wider mode? */
|
|
|
|
|
|
|
|
|
|
if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
{
|
1992-01-18 00:19:29 +01:00
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
|
|
|
|
if (binoptab->handlers[(int) wider_mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx t0 = gen_reg_rtx (wider_mode);
|
|
|
|
|
rtx t1 = gen_reg_rtx (wider_mode);
|
2001-06-15 19:44:56 +02:00
|
|
|
|
rtx cop0 = convert_modes (wider_mode, mode, op0, unsignedp);
|
|
|
|
|
rtx cop1 = convert_modes (wider_mode, mode, op1, unsignedp);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2001-06-15 19:44:56 +02:00
|
|
|
|
if (expand_twoval_binop (binoptab, cop0, cop1,
|
1991-12-30 04:19:53 +01:00
|
|
|
|
t0, t1, unsignedp))
|
|
|
|
|
{
|
|
|
|
|
convert_move (targ0, t0, unsignedp);
|
|
|
|
|
convert_move (targ1, t1, unsignedp);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1992-11-25 19:04:15 +01:00
|
|
|
|
delete_insns_since (entry_last);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
/* Wrapper around expand_unop which takes an rtx code to specify
|
|
|
|
|
the operation to perform, not an optab pointer. All other
|
|
|
|
|
arguments are the same. */
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_simple_unop (enum machine_mode mode, enum rtx_code code, rtx op0,
|
|
|
|
|
rtx target, int unsignedp)
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
{
|
2002-11-16 07:08:16 +01:00
|
|
|
|
optab unop = code_to_optab[(int) code];
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
if (unop == 0)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
return expand_unop (mode, unop, op0, target, unsignedp);
|
|
|
|
|
}
|
|
|
|
|
|
[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
|
|
|
|
/* Try calculating
|
|
|
|
|
(clz:narrow x)
|
|
|
|
|
as
|
|
|
|
|
(clz:wide (zero_extend:wide x)) - ((width wide) - (width narrow)). */
|
|
|
|
|
static rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
widen_clz (enum machine_mode mode, rtx op0, rtx target)
|
[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
|
|
|
|
{
|
|
|
|
|
enum mode_class class = GET_MODE_CLASS (mode);
|
|
|
|
|
if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
{
|
|
|
|
|
enum machine_mode wider_mode;
|
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
|
|
|
|
if (clz_optab->handlers[(int) wider_mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
rtx xop0, temp, last;
|
|
|
|
|
|
|
|
|
|
last = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
xop0 = widen_operand (op0, wider_mode, mode, true, false);
|
|
|
|
|
temp = expand_unop (wider_mode, clz_optab, xop0, NULL_RTX, true);
|
|
|
|
|
if (temp != 0)
|
|
|
|
|
temp = expand_binop (wider_mode, sub_optab, temp,
|
|
|
|
|
GEN_INT (GET_MODE_BITSIZE (wider_mode)
|
|
|
|
|
- GET_MODE_BITSIZE (mode)),
|
|
|
|
|
target, true, OPTAB_DIRECT);
|
|
|
|
|
if (temp == 0)
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try calculating (parity x) as (and (popcount x) 1), where
|
|
|
|
|
popcount can also be done in a wider mode. */
|
|
|
|
|
static rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_parity (enum machine_mode mode, rtx op0, rtx target)
|
[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
|
|
|
|
{
|
|
|
|
|
enum mode_class class = GET_MODE_CLASS (mode);
|
|
|
|
|
if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
{
|
|
|
|
|
enum machine_mode wider_mode;
|
|
|
|
|
for (wider_mode = mode; wider_mode != VOIDmode;
|
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
|
|
|
|
if (popcount_optab->handlers[(int) wider_mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
rtx xop0, temp, last;
|
|
|
|
|
|
|
|
|
|
last = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
xop0 = widen_operand (op0, wider_mode, mode, true, false);
|
|
|
|
|
temp = expand_unop (wider_mode, popcount_optab, xop0, NULL_RTX,
|
|
|
|
|
true);
|
|
|
|
|
if (temp != 0)
|
2004-02-03 06:39:57 +01:00
|
|
|
|
temp = expand_binop (wider_mode, and_optab, temp, const1_rtx,
|
[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
|
|
|
|
target, true, OPTAB_DIRECT);
|
|
|
|
|
if (temp == 0)
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Generate code to perform an operation specified by UNOPTAB
|
|
|
|
|
on operand OP0, with result having machine-mode MODE.
|
|
|
|
|
|
|
|
|
|
UNSIGNEDP is for the case where we have to widen the operands
|
|
|
|
|
to perform the operation. It says to use zero-extension.
|
|
|
|
|
|
|
|
|
|
If TARGET is nonzero, the value
|
|
|
|
|
is generated there, if it is convenient to do so.
|
|
|
|
|
In all cases an rtx is returned for the locus of the value;
|
|
|
|
|
this may or may not be TARGET. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
|
|
|
|
|
int unsignedp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
enum mode_class class;
|
|
|
|
|
enum machine_mode wider_mode;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx temp;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx last = get_last_insn ();
|
|
|
|
|
rtx pat;
|
|
|
|
|
|
|
|
|
|
class = GET_MODE_CLASS (mode);
|
|
|
|
|
|
|
|
|
|
op0 = protect_from_queue (op0, 0);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
{
|
|
|
|
|
op0 = force_not_mem (op0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (target)
|
|
|
|
|
target = protect_from_queue (target, 1);
|
|
|
|
|
|
|
|
|
|
if (unoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
int icode = (int) unoptab->handlers[(int) mode].insn_code;
|
1999-09-12 14:46:08 +02:00
|
|
|
|
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx xop0 = op0;
|
|
|
|
|
|
|
|
|
|
if (target)
|
|
|
|
|
temp = target;
|
|
|
|
|
else
|
|
|
|
|
temp = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (xop0) != VOIDmode
|
|
|
|
|
&& GET_MODE (xop0) != mode0)
|
|
|
|
|
xop0 = convert_to_mode (mode0, xop0, unsignedp);
|
|
|
|
|
|
|
|
|
|
/* Now, if insn doesn't accept our operand, put it into a pseudo. */
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[0].predicate) (temp, mode))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
temp = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
pat = GEN_FCN (icode) (temp, xop0);
|
|
|
|
|
if (pat)
|
|
|
|
|
{
|
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
|
|
|
|
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
|
1992-07-06 22:04:10 +02:00
|
|
|
|
&& ! add_equal_note (pat, temp, unoptab->code, xop0, NULL_RTX))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
delete_insns_since (last);
|
1992-07-06 22:04:10 +02:00
|
|
|
|
return expand_unop (mode, unoptab, op0, NULL_RTX, unsignedp);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
emit_insn (pat);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
|
1992-06-23 23:36:55 +02:00
|
|
|
|
/* It can't be done in this mode. Can we open-code it in a wider mode? */
|
|
|
|
|
|
[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
|
|
|
|
/* Widening clz needs special treatment. */
|
|
|
|
|
if (unoptab == clz_optab)
|
|
|
|
|
{
|
|
|
|
|
temp = widen_clz (mode, op0, target);
|
|
|
|
|
if (temp)
|
|
|
|
|
return temp;
|
|
|
|
|
else
|
|
|
|
|
goto try_libcall;
|
|
|
|
|
}
|
|
|
|
|
|
1992-06-23 23:36:55 +02:00
|
|
|
|
if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
|
|
|
|
if (unoptab->handlers[(int) wider_mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
rtx xop0 = op0;
|
|
|
|
|
|
|
|
|
|
/* For certain operations, we need not actually extend
|
|
|
|
|
the narrow operand, as long as we will truncate the
|
1993-08-09 13:30:54 +02:00
|
|
|
|
results to the same narrowness. */
|
|
|
|
|
|
1993-09-09 21:50:55 +02:00
|
|
|
|
xop0 = widen_operand (xop0, wider_mode, mode, unsignedp,
|
1993-08-09 13:30:54 +02:00
|
|
|
|
(unoptab == neg_optab
|
|
|
|
|
|| unoptab == one_cmpl_optab)
|
|
|
|
|
&& class == MODE_INT);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1992-07-06 22:04:10 +02:00
|
|
|
|
temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
|
|
|
|
|
unsignedp);
|
1992-06-23 23:36:55 +02:00
|
|
|
|
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
if (class != MODE_INT)
|
|
|
|
|
{
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
convert_move (target, temp, 0);
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return gen_lowpart (mode, temp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* These can be done a word at a time. */
|
|
|
|
|
if (unoptab == one_cmpl_optab
|
|
|
|
|
&& class == MODE_INT
|
|
|
|
|
&& GET_MODE_SIZE (mode) > UNITS_PER_WORD
|
1992-01-18 00:19:29 +01:00
|
|
|
|
&& unoptab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2002-01-12 15:05:32 +01:00
|
|
|
|
int i;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx insns;
|
|
|
|
|
|
|
|
|
|
if (target == 0 || target == op0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
/* Do the actual arithmetic. */
|
|
|
|
|
for (i = 0; i < GET_MODE_BITSIZE (mode) / BITS_PER_WORD; i++)
|
|
|
|
|
{
|
|
|
|
|
rtx target_piece = operand_subword (target, i, 1, mode);
|
1992-01-18 00:19:29 +01:00
|
|
|
|
rtx x = expand_unop (word_mode, unoptab,
|
1991-12-30 04:19:53 +01:00
|
|
|
|
operand_subword_force (op0, i, mode),
|
|
|
|
|
target_piece, unsignedp);
|
2002-01-12 15:05:32 +01:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (target_piece != x)
|
|
|
|
|
emit_move_insn (target_piece, x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
1992-07-06 22:04:10 +02:00
|
|
|
|
emit_no_conflict_block (insns, target, op0, NULL_RTX,
|
1998-06-24 16:49:51 +02:00
|
|
|
|
gen_rtx_fmt_e (unoptab->code, mode,
|
|
|
|
|
copy_rtx (op0)));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
1992-10-02 02:42:33 +01:00
|
|
|
|
/* Open-code the complex negation operation. */
|
2000-10-18 23:33:41 +02:00
|
|
|
|
else if (unoptab->code == NEG
|
1992-10-02 02:42:33 +01:00
|
|
|
|
&& (class == MODE_COMPLEX_FLOAT || class == MODE_COMPLEX_INT))
|
|
|
|
|
{
|
|
|
|
|
rtx target_piece;
|
|
|
|
|
rtx x;
|
|
|
|
|
rtx seq;
|
|
|
|
|
|
2003-06-29 15:53:12 +02:00
|
|
|
|
/* Find the correct mode for the real and imaginary parts. */
|
2002-11-20 22:52:59 +01:00
|
|
|
|
enum machine_mode submode = GET_MODE_INNER (mode);
|
1992-10-02 02:42:33 +01:00
|
|
|
|
|
|
|
|
|
if (submode == BLKmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1992-10-02 02:42:33 +01:00
|
|
|
|
start_sequence ();
|
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
target_piece = gen_imagpart (submode, target);
|
1992-10-02 02:42:33 +01:00
|
|
|
|
x = expand_unop (submode, unoptab,
|
1992-10-05 07:28:37 +01:00
|
|
|
|
gen_imagpart (submode, op0),
|
1992-10-02 02:42:33 +01:00
|
|
|
|
target_piece, unsignedp);
|
|
|
|
|
if (target_piece != x)
|
|
|
|
|
emit_move_insn (target_piece, x);
|
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
target_piece = gen_realpart (submode, target);
|
1992-10-02 02:42:33 +01:00
|
|
|
|
x = expand_unop (submode, unoptab,
|
1992-10-05 07:28:37 +01:00
|
|
|
|
gen_realpart (submode, op0),
|
1992-10-02 02:42:33 +01:00
|
|
|
|
target_piece, unsignedp);
|
|
|
|
|
if (target_piece != x)
|
|
|
|
|
emit_move_insn (target_piece, x);
|
|
|
|
|
|
1992-11-10 16:20:01 +01:00
|
|
|
|
seq = get_insns ();
|
1992-10-02 02:42:33 +01:00
|
|
|
|
end_sequence ();
|
|
|
|
|
|
|
|
|
|
emit_no_conflict_block (seq, target, op0, 0,
|
1998-06-24 16:49:51 +02:00
|
|
|
|
gen_rtx_fmt_e (unoptab->code, mode,
|
|
|
|
|
copy_rtx (op0)));
|
1992-10-02 02:42:33 +01:00
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
|
/* Try negating floating point values by flipping the sign bit. */
|
|
|
|
|
if (unoptab->code == NEG && class == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_BITSIZE (mode) <= 2 * HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
real.h (REAL_MODE_FORMAT): New macro.
* real.h (REAL_MODE_FORMAT): New macro.
* c-cppbuiltin.c, optabs.c, real.c, config/alpha/alpha.c
* config/c4x/c4x.c, config/i370/i370.c, config/i386/freebsd.h
* config/i386/i386.c, config/i960/i960.c, config/ia64/ia64.c
* config/m68k/m68k.c, config/mips/mips.c, config/rs6000/rs6000.c
* config/vax/vax.c: Use REAL_MODE_FORMAT instead of referring
directly to real_format_for_mode array, wherever possible.
From-SVN: r72168
2003-10-07 00:47:32 +02:00
|
|
|
|
const struct real_format *fmt = REAL_MODE_FORMAT (mode);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
enum machine_mode imode = int_mode_for_mode (mode);
|
|
|
|
|
int bitpos = (fmt != 0) ? fmt->signbit : -1;
|
|
|
|
|
|
|
|
|
|
if (imode != BLKmode && bitpos >= 0 && fmt->has_signed_zero)
|
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT hi, lo;
|
|
|
|
|
rtx last = get_last_insn ();
|
|
|
|
|
|
2003-01-15 18:32:38 +01:00
|
|
|
|
/* Handle targets with different FP word orders. */
|
|
|
|
|
if (FLOAT_WORDS_BIG_ENDIAN != WORDS_BIG_ENDIAN)
|
|
|
|
|
{
|
|
|
|
|
int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
|
|
|
|
|
int word = nwords - (bitpos / BITS_PER_WORD) - 1;
|
|
|
|
|
bitpos = word * BITS_PER_WORD + bitpos % BITS_PER_WORD;
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
|
if (bitpos < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
hi = 0;
|
|
|
|
|
lo = (HOST_WIDE_INT) 1 << bitpos;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hi = (HOST_WIDE_INT) 1 << (bitpos - HOST_BITS_PER_WIDE_INT);
|
|
|
|
|
lo = 0;
|
|
|
|
|
}
|
|
|
|
|
temp = expand_binop (imode, xor_optab,
|
|
|
|
|
gen_lowpart (imode, op0),
|
|
|
|
|
immed_double_const (lo, hi, imode),
|
|
|
|
|
NULL_RTX, 1, OPTAB_LIB_WIDEN);
|
|
|
|
|
if (temp != 0)
|
2003-10-11 05:49:54 +02:00
|
|
|
|
{
|
|
|
|
|
rtx insn;
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
insn = emit_move_insn (target, gen_lowpart (mode, temp));
|
|
|
|
|
set_unique_reg_note (insn, REG_EQUAL,
|
|
|
|
|
gen_rtx_fmt_e (NEG, mode,
|
|
|
|
|
copy_rtx (op0)));
|
|
|
|
|
return target;
|
|
|
|
|
}
|
2002-12-16 19:23:00 +01:00
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
[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
|
|
|
|
/* Try calculating parity (x) as popcount (x) % 2. */
|
|
|
|
|
if (unoptab == parity_optab)
|
|
|
|
|
{
|
|
|
|
|
temp = expand_parity (mode, op0, target);
|
|
|
|
|
if (temp)
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-17 08:50:51 +02:00
|
|
|
|
/* If there is no negation pattern, try subtracting from zero. */
|
|
|
|
|
if (unoptab == neg_optab && class == MODE_INT)
|
|
|
|
|
{
|
|
|
|
|
temp = expand_binop (mode, sub_optab, CONST0_RTX (mode), op0,
|
|
|
|
|
target, unsignedp, OPTAB_DIRECT);
|
|
|
|
|
if (temp)
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
[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
|
|
|
|
try_libcall:
|
1992-10-02 02:42:33 +01:00
|
|
|
|
/* Now try a library call in this mode. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (unoptab->handlers[(int) mode].libfunc)
|
|
|
|
|
{
|
|
|
|
|
rtx insns;
|
1993-09-15 15:38:01 +02:00
|
|
|
|
rtx value;
|
[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
|
|
|
|
enum machine_mode outmode = mode;
|
|
|
|
|
|
|
|
|
|
/* All of these functions return small values. Thus we choose to
|
|
|
|
|
have them return something that isn't a double-word. */
|
|
|
|
|
if (unoptab == ffs_optab || unoptab == clz_optab || unoptab == ctz_optab
|
|
|
|
|
|| unoptab == popcount_optab || unoptab == parity_optab)
|
2003-10-07 01:06:09 +02:00
|
|
|
|
outmode
|
|
|
|
|
= GET_MODE (hard_libcall_value (TYPE_MODE (integer_type_node)));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
/* Pass 1 for NO_QUEUE so we don't lose any increments
|
|
|
|
|
if the libcall is cse'd or moved. */
|
1993-09-15 15:38:01 +02:00
|
|
|
|
value = emit_library_call_value (unoptab->handlers[(int) mode].libfunc,
|
[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
|
|
|
|
NULL_RTX, LCT_CONST, outmode,
|
|
|
|
|
1, op0, mode);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
[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
|
|
|
|
target = gen_reg_rtx (outmode);
|
1993-09-15 15:38:01 +02:00
|
|
|
|
emit_libcall_block (insns, target, value,
|
1998-06-24 16:49:51 +02:00
|
|
|
|
gen_rtx_fmt_e (unoptab->code, mode, op0));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-18 03:35:47 +02:00
|
|
|
|
if (class == MODE_VECTOR_FLOAT || class == MODE_VECTOR_INT)
|
|
|
|
|
return expand_vector_unop (mode, unoptab, op0, target, unsignedp);
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* It can't be done in this mode. Can we do it in a wider mode? */
|
|
|
|
|
|
|
|
|
|
if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
|
|
|
|
|
{
|
1992-01-18 00:19:29 +01:00
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
|
|
|
|
if ((unoptab->handlers[(int) wider_mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
|| unoptab->handlers[(int) wider_mode].libfunc)
|
|
|
|
|
{
|
1992-01-18 00:19:29 +01:00
|
|
|
|
rtx xop0 = op0;
|
|
|
|
|
|
|
|
|
|
/* For certain operations, we need not actually extend
|
|
|
|
|
the narrow operand, as long as we will truncate the
|
|
|
|
|
results to the same narrowness. */
|
|
|
|
|
|
1993-09-09 21:50:55 +02:00
|
|
|
|
xop0 = widen_operand (xop0, wider_mode, mode, unsignedp,
|
1993-08-09 13:30:54 +02:00
|
|
|
|
(unoptab == neg_optab
|
|
|
|
|
|| unoptab == one_cmpl_optab)
|
|
|
|
|
&& class == MODE_INT);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1992-07-06 22:04:10 +02:00
|
|
|
|
temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
|
|
|
|
|
unsignedp);
|
1992-01-18 00:19:29 +01:00
|
|
|
|
|
2003-02-09 05:25:16 +01:00
|
|
|
|
/* If we are generating clz using wider mode, adjust the
|
|
|
|
|
result. */
|
|
|
|
|
if (unoptab == clz_optab && temp != 0)
|
|
|
|
|
temp = expand_binop (wider_mode, sub_optab, temp,
|
|
|
|
|
GEN_INT (GET_MODE_BITSIZE (wider_mode)
|
|
|
|
|
- GET_MODE_BITSIZE (mode)),
|
|
|
|
|
target, true, OPTAB_DIRECT);
|
|
|
|
|
|
1992-01-18 00:19:29 +01:00
|
|
|
|
if (temp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
1992-01-18 00:19:29 +01:00
|
|
|
|
if (class != MODE_INT)
|
|
|
|
|
{
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
convert_move (target, temp, 0);
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return gen_lowpart (mode, temp);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
1992-01-18 00:19:29 +01:00
|
|
|
|
delete_insns_since (last);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-17 21:14:21 +01:00
|
|
|
|
/* If there is no negate operation, try doing a subtract from zero.
|
|
|
|
|
The US Software GOFAST library needs this. */
|
2000-10-18 23:33:41 +02:00
|
|
|
|
if (unoptab->code == NEG)
|
2003-07-06 11:56:09 +02:00
|
|
|
|
{
|
1994-11-17 21:14:21 +01:00
|
|
|
|
rtx temp;
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp = expand_binop (mode,
|
|
|
|
|
unoptab == negv_optab ? subv_optab : sub_optab,
|
|
|
|
|
CONST0_RTX (mode), op0,
|
|
|
|
|
target, unsignedp, OPTAB_LIB_WIDEN);
|
1994-11-17 21:14:21 +01:00
|
|
|
|
if (temp)
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
/* Emit code to compute the absolute value of OP0, with result to
|
|
|
|
|
TARGET if convenient. (TARGET may be 0.) The return value says
|
|
|
|
|
where the result actually is to be found.
|
|
|
|
|
|
|
|
|
|
MODE is the mode of the operand; the mode of the result is
|
|
|
|
|
different but can be deduced from MODE.
|
|
|
|
|
|
1999-03-19 09:50:14 +01:00
|
|
|
|
*/
|
1994-11-16 00:37:55 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
|
|
|
|
|
int result_unsignedp)
|
1994-11-16 00:37:55 +01:00
|
|
|
|
{
|
2003-06-03 23:29:48 +02:00
|
|
|
|
rtx temp;
|
1994-11-16 00:37:55 +01:00
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
if (! flag_trapv)
|
|
|
|
|
result_unsignedp = 1;
|
|
|
|
|
|
1994-11-16 00:37:55 +01:00
|
|
|
|
/* First try to do it with a special abs instruction. */
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp = expand_unop (mode, result_unsignedp ? abs_optab : absv_optab,
|
|
|
|
|
op0, target, 0);
|
1994-11-16 00:37:55 +01:00
|
|
|
|
if (temp != 0)
|
|
|
|
|
return temp;
|
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
|
/* For floating point modes, try clearing the sign bit. */
|
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_BITSIZE (mode) <= 2 * HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
real.h (REAL_MODE_FORMAT): New macro.
* real.h (REAL_MODE_FORMAT): New macro.
* c-cppbuiltin.c, optabs.c, real.c, config/alpha/alpha.c
* config/c4x/c4x.c, config/i370/i370.c, config/i386/freebsd.h
* config/i386/i386.c, config/i960/i960.c, config/ia64/ia64.c
* config/m68k/m68k.c, config/mips/mips.c, config/rs6000/rs6000.c
* config/vax/vax.c: Use REAL_MODE_FORMAT instead of referring
directly to real_format_for_mode array, wherever possible.
From-SVN: r72168
2003-10-07 00:47:32 +02:00
|
|
|
|
const struct real_format *fmt = REAL_MODE_FORMAT (mode);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
enum machine_mode imode = int_mode_for_mode (mode);
|
|
|
|
|
int bitpos = (fmt != 0) ? fmt->signbit : -1;
|
|
|
|
|
|
|
|
|
|
if (imode != BLKmode && bitpos >= 0)
|
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT hi, lo;
|
|
|
|
|
rtx last = get_last_insn ();
|
|
|
|
|
|
2003-01-15 18:32:38 +01:00
|
|
|
|
/* Handle targets with different FP word orders. */
|
|
|
|
|
if (FLOAT_WORDS_BIG_ENDIAN != WORDS_BIG_ENDIAN)
|
|
|
|
|
{
|
|
|
|
|
int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
|
|
|
|
|
int word = nwords - (bitpos / BITS_PER_WORD) - 1;
|
|
|
|
|
bitpos = word * BITS_PER_WORD + bitpos % BITS_PER_WORD;
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
|
if (bitpos < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
hi = 0;
|
|
|
|
|
lo = (HOST_WIDE_INT) 1 << bitpos;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hi = (HOST_WIDE_INT) 1 << (bitpos - HOST_BITS_PER_WIDE_INT);
|
|
|
|
|
lo = 0;
|
|
|
|
|
}
|
|
|
|
|
temp = expand_binop (imode, and_optab,
|
|
|
|
|
gen_lowpart (imode, op0),
|
|
|
|
|
immed_double_const (~lo, ~hi, imode),
|
|
|
|
|
NULL_RTX, 1, OPTAB_LIB_WIDEN);
|
|
|
|
|
if (temp != 0)
|
2003-10-11 05:49:54 +02:00
|
|
|
|
{
|
|
|
|
|
rtx insn;
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
insn = emit_move_insn (target, gen_lowpart (mode, temp));
|
|
|
|
|
set_unique_reg_note (insn, REG_EQUAL,
|
|
|
|
|
gen_rtx_fmt_e (ABS, mode,
|
|
|
|
|
copy_rtx (op0)));
|
|
|
|
|
return target;
|
|
|
|
|
}
|
2002-12-16 19:23:00 +01:00
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
|
|
|
|
/* If we have a MAX insn, we can do this as MAX (x, -x). */
|
|
|
|
|
if (smax_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
rtx last = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
temp = expand_unop (mode, neg_optab, op0, NULL_RTX, 0);
|
|
|
|
|
if (temp != 0)
|
|
|
|
|
temp = expand_binop (mode, smax_optab, op0, temp, target, 0,
|
|
|
|
|
OPTAB_WIDEN);
|
|
|
|
|
|
|
|
|
|
if (temp != 0)
|
|
|
|
|
return temp;
|
|
|
|
|
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
|
1994-11-16 00:37:55 +01:00
|
|
|
|
/* If this machine has expensive jumps, we can do integer absolute
|
|
|
|
|
value of X as (((signed) x >> (W-1)) ^ x) - ((signed) x >> (W-1)),
|
2001-02-18 21:24:10 +01:00
|
|
|
|
where W is the width of MODE. */
|
1994-11-16 00:37:55 +01:00
|
|
|
|
|
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_INT && BRANCH_COST >= 2)
|
|
|
|
|
{
|
|
|
|
|
rtx extended = expand_shift (RSHIFT_EXPR, mode, op0,
|
|
|
|
|
size_int (GET_MODE_BITSIZE (mode) - 1),
|
|
|
|
|
NULL_RTX, 0);
|
|
|
|
|
|
|
|
|
|
temp = expand_binop (mode, xor_optab, extended, op0, target, 0,
|
|
|
|
|
OPTAB_LIB_WIDEN);
|
|
|
|
|
if (temp != 0)
|
2000-10-18 23:33:41 +02:00
|
|
|
|
temp = expand_binop (mode, result_unsignedp ? sub_optab : subv_optab,
|
|
|
|
|
temp, extended, target, 0, OPTAB_LIB_WIDEN);
|
1994-11-16 00:37:55 +01:00
|
|
|
|
|
|
|
|
|
if (temp != 0)
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
2003-06-03 23:29:48 +02:00
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_abs (enum machine_mode mode, rtx op0, rtx target,
|
|
|
|
|
int result_unsignedp, int safe)
|
2003-06-03 23:29:48 +02:00
|
|
|
|
{
|
|
|
|
|
rtx temp, op1;
|
|
|
|
|
|
2003-06-08 06:27:11 +02:00
|
|
|
|
if (! flag_trapv)
|
|
|
|
|
result_unsignedp = 1;
|
|
|
|
|
|
2003-06-03 23:29:48 +02:00
|
|
|
|
temp = expand_abs_nojump (mode, op0, target, result_unsignedp);
|
|
|
|
|
if (temp != 0)
|
|
|
|
|
return temp;
|
|
|
|
|
|
1994-11-16 00:37:55 +01:00
|
|
|
|
/* If that does not win, use conditional jump and negate. */
|
1996-08-12 05:12:40 +02:00
|
|
|
|
|
|
|
|
|
/* It is safe to use the target if it is the same
|
|
|
|
|
as the source if this is also a pseudo register */
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (op0 == target && REG_P (op0)
|
1996-08-12 05:12:40 +02:00
|
|
|
|
&& REGNO (op0) >= FIRST_PSEUDO_REGISTER)
|
|
|
|
|
safe = 1;
|
|
|
|
|
|
1994-11-16 00:37:55 +01:00
|
|
|
|
op1 = gen_label_rtx ();
|
|
|
|
|
if (target == 0 || ! safe
|
|
|
|
|
|| GET_MODE (target) != mode
|
alias.c (get_alias_set, [...]): Use MEM_P.
2004-07-01 Jerry Quinn <jlquinn@optonline.net>
* alias.c (get_alias_set, canon_rtx, get_addr,
nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1):
Use MEM_P.
* builtins.c (expand_builtin_prefetch, expand_builtin_profile_func,
expand_builtin): Likewise.
* calls.c (expand_call, emit_library_call_value_1, store_one_arg):
Likewise.
* combine.c (can_combine_p, combinable_i3pat, try_combine,
find_split_point, combine_simplify_rtx, simplify_set, make_extraction,
rtx_equal_for_field_assignment_p, gen_lowpart_for_combine,
record_dead_and_set_regs_1, get_last_value_validate,
mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise.
* cse.c (check_dependence, canon_hash, equiv_constant,
gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers,
cse_around_loop, cse_check_loop_start, cse_set_around_loop,
count_reg_usage): Likewise.
* cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup,
cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set,
cselib_record_sets): Likewise.
* dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol,
dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise.
* ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise.
* df.c (df_uses_record): Likewise.
* dojump (do_jump): Likewise.
* dwarf2out.c (stack_adjust_offset, mem_loc_descriptor,
loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info,
decl_start_label): Likewise.
* emit-rtl.c (gen_complex_constant_part, gen_highpart,
operand_subword, change_address_1, make_safe_from): Likewise.
* explow.c (break_out_memory_refs, copy_all_regs, validize_mem,
stabilize, force_not_mem): Likewise.
* expmed.c (store_bit_field, store_split_bit_field, extract_bit_field,
expand_mult_const, expand_divmod, emit_store_flag): Likewise.
* expr.c (convert_move, convert_modes, emit_block_move,
emit_group_load, emit_group_store, clear_storage, emit_move_insn,
emit_move_insn_1, expand_assignment, store_expr,
store_constructor_field, store_constructor, store_field,
force_operand, safe_from_p, expand_expr_real_1, expand_increment):
Likewise.
* final.c (cleanup_subreg_operands, alter_subreg,
get_mem_expr_from_op): Likewise.
* flow.c (notice_stack_pointer_modification_1,
init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs):
Likewise.
* function.c (mark_temp_addr_taken, preserve_temp_slots,
preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1,
optimize_bit_field, flush_addressof, purge_addressof_1,
instantiate_decl, instantiate_virtual_regs_1, assign_parms,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
keep_stack_depressed): Likewise.
* ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok,
noce_process_if_block, find_memory): Likewise.
* integrate.c (subst_constants, allocate_initial_values): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p,
update_equiv_regs): Likewise.
* loop.c (scan_loop, prescan_loop, note_addr_stored, check_store,
maybe_eliminate_biv_1, find_mem_in_note_1): Likewise.
* optabs.c (expand_abs, emit_unop_insn): Likewise.
* passes.c (rest_of_handle_final): Likewise.
* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands,
move2add_note_store): Likewise.
* ra-build.c (detect_remat_webs): Likewise.
* ra-debug.c (dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, insert_stores): Likewise.
* recog.c (validate_change, apply_change_group, cancel_changes,
validate_replace_rtx_1, general_operand, register_operand,
nonmemory_operand, push_operand, pop_operand, memory_operand,
indirect_operand, asm_operand_ok, offsettable_memref_p,
offsettable_nonstrict_memref_p, constrain_operands,
store_data_bypass_p): Likewise.
* reg-stack.c (subst_stack_regs_pat): Likewise.
* regclass.c (record_operand_costs, scan_one_insn, record_reg_classes,
copy_cost, reg_scan_mark_refs): Likewise.
* regmove.c (optimize_reg_copy_3, stack_memref_p,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (copyprop_hardreg_forward_1): Likewise.
* reload.c (can_reload_into, push_reload, decompose, immune_p,
find_reloads, find_reloads_address, find_reloads_address_1,
reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p,
find_equiv_reg): Likewise.
* reload1.c (reload, eliminate_regs, eliminate_regs_in_insn,
reload_as_needed, choose_reload_regs, emit_input_reload_insns,
do_input_reload, emit_reload_insns, gen_reload, delete_output_reload,
delete_address_reloads): Likewise.
* resource.c (mark_referenced_resources): Likewise.
* rtlanal.c (get_jump_table_offset, count_occurrences,
reg_referenced_p, reg_set_p, set_of_1, set_noop_p,
reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
* sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol,
sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms,
sdbout_global_decl): Likewise.
* simplify-rtx.c (simplify_subreg): Likewise.
* stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl,
expand_anon_union_decl, expand_end_case_type): Likewise.
* unroll.c (calculate_giv_inc): Likewise.
* var-tracking.c (stack_adjust_offset_pre_post,
bb_stack_adjust_offset, track_expr_p, count_uses, add_uses,
add_stores, compute_bb_dataflow, vt_get_decl_and_offset,
vt_add_function_parameters): Likewise.
* varasm.c (make_var_volatile, notice_global_symbol,
assemble_external, decode_addr_const, mark_weak,
default_encode_section_info): Likewise.
From-SVN: r83980
2004-07-01 14:52:53 +02:00
|
|
|
|
|| (MEM_P (target) && MEM_VOLATILE_P (target))
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
|| (REG_P (target)
|
1994-11-16 00:37:55 +01:00
|
|
|
|
&& REGNO (target) < FIRST_PSEUDO_REGISTER))
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
emit_move_insn (target, op0);
|
|
|
|
|
NO_DEFER_POP;
|
|
|
|
|
|
|
|
|
|
/* If this mode is an integer too wide to compare properly,
|
|
|
|
|
compare word by word. Rely on CSE to optimize constant cases. */
|
2000-01-24 21:10:04 +01:00
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_INT
|
|
|
|
|
&& ! can_compare_p (GE, mode, ccp_jump))
|
2003-07-06 11:56:09 +02:00
|
|
|
|
do_jump_by_parts_greater_rtx (mode, 0, target, const0_rtx,
|
1994-11-16 00:37:55 +01:00
|
|
|
|
NULL_RTX, op1);
|
|
|
|
|
else
|
1999-08-18 19:51:27 +02:00
|
|
|
|
do_compare_rtx_and_jump (target, CONST0_RTX (mode), GE, 0, mode,
|
2001-11-16 00:44:58 +01:00
|
|
|
|
NULL_RTX, NULL_RTX, op1);
|
1994-11-16 00:37:55 +01:00
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
op0 = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
|
|
|
|
|
target, target, 0);
|
1994-11-16 00:37:55 +01:00
|
|
|
|
if (op0 != target)
|
|
|
|
|
emit_move_insn (target, op0);
|
|
|
|
|
emit_label (op1);
|
|
|
|
|
OK_DEFER_POP;
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit code to compute the absolute value of OP0, with result to
|
|
|
|
|
TARGET if convenient. (TARGET may be 0.) The return value says
|
|
|
|
|
where the result actually is to be found.
|
|
|
|
|
|
|
|
|
|
MODE is the mode of the operand; the mode of the result is
|
|
|
|
|
different but can be deduced from MODE.
|
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
UNSIGNEDP is relevant for complex integer modes. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_complex_abs (enum machine_mode mode, rtx op0, rtx target,
|
|
|
|
|
int unsignedp)
|
1992-10-05 07:28:37 +01:00
|
|
|
|
{
|
|
|
|
|
enum mode_class class = GET_MODE_CLASS (mode);
|
|
|
|
|
enum machine_mode wider_mode;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx temp;
|
1992-11-25 19:04:15 +01:00
|
|
|
|
rtx entry_last = get_last_insn ();
|
|
|
|
|
rtx last;
|
1992-10-05 07:28:37 +01:00
|
|
|
|
rtx pat;
|
2000-10-18 23:33:41 +02:00
|
|
|
|
optab this_abs_optab;
|
1992-10-05 07:28:37 +01:00
|
|
|
|
|
|
|
|
|
/* Find the correct mode for the real and imaginary parts. */
|
2002-11-20 22:52:59 +01:00
|
|
|
|
enum machine_mode submode = GET_MODE_INNER (mode);
|
1992-10-05 07:28:37 +01:00
|
|
|
|
|
|
|
|
|
if (submode == BLKmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
op0 = protect_from_queue (op0, 0);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
{
|
|
|
|
|
op0 = force_not_mem (op0);
|
|
|
|
|
}
|
|
|
|
|
|
1992-11-25 19:04:15 +01:00
|
|
|
|
last = get_last_insn ();
|
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
if (target)
|
|
|
|
|
target = protect_from_queue (target, 1);
|
|
|
|
|
|
2000-10-18 23:33:41 +02:00
|
|
|
|
this_abs_optab = ! unsignedp && flag_trapv
|
|
|
|
|
&& (GET_MODE_CLASS(mode) == MODE_INT)
|
|
|
|
|
? absv_optab : abs_optab;
|
|
|
|
|
|
|
|
|
|
if (this_abs_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
1992-10-05 07:28:37 +01:00
|
|
|
|
{
|
2000-10-18 23:33:41 +02:00
|
|
|
|
int icode = (int) this_abs_optab->handlers[(int) mode].insn_code;
|
1999-09-12 14:46:08 +02:00
|
|
|
|
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
|
1992-10-05 07:28:37 +01:00
|
|
|
|
rtx xop0 = op0;
|
|
|
|
|
|
|
|
|
|
if (target)
|
|
|
|
|
temp = target;
|
|
|
|
|
else
|
|
|
|
|
temp = gen_reg_rtx (submode);
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (xop0) != VOIDmode
|
|
|
|
|
&& GET_MODE (xop0) != mode0)
|
|
|
|
|
xop0 = convert_to_mode (mode0, xop0, unsignedp);
|
|
|
|
|
|
|
|
|
|
/* Now, if insn doesn't accept our operand, put it into a pseudo. */
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0))
|
1992-10-05 07:28:37 +01:00
|
|
|
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[0].predicate) (temp, submode))
|
1992-10-05 07:28:37 +01:00
|
|
|
|
temp = gen_reg_rtx (submode);
|
|
|
|
|
|
|
|
|
|
pat = GEN_FCN (icode) (temp, xop0);
|
|
|
|
|
if (pat)
|
|
|
|
|
{
|
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
|
|
|
|
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
|
2003-07-06 11:56:09 +02:00
|
|
|
|
&& ! add_equal_note (pat, temp, this_abs_optab->code, xop0,
|
2000-10-18 23:33:41 +02:00
|
|
|
|
NULL_RTX))
|
1992-10-05 07:28:37 +01:00
|
|
|
|
{
|
|
|
|
|
delete_insns_since (last);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
return expand_unop (mode, this_abs_optab, op0, NULL_RTX,
|
2000-10-18 23:33:41 +02:00
|
|
|
|
unsignedp);
|
1992-10-05 07:28:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
emit_insn (pat);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* It can't be done in this mode. Can we open-code it in a wider mode? */
|
|
|
|
|
|
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
2003-07-06 11:56:09 +02:00
|
|
|
|
if (this_abs_optab->handlers[(int) wider_mode].insn_code
|
2000-10-18 23:33:41 +02:00
|
|
|
|
!= CODE_FOR_nothing)
|
1992-10-05 07:28:37 +01:00
|
|
|
|
{
|
|
|
|
|
rtx xop0 = op0;
|
|
|
|
|
|
1993-09-09 21:50:55 +02:00
|
|
|
|
xop0 = convert_modes (wider_mode, mode, xop0, unsignedp);
|
1992-10-05 07:28:37 +01:00
|
|
|
|
temp = expand_complex_abs (wider_mode, xop0, NULL_RTX, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
if (class != MODE_COMPLEX_INT)
|
|
|
|
|
{
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (submode);
|
|
|
|
|
convert_move (target, temp, 0);
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return gen_lowpart (submode, temp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Open-code the complex absolute-value operation
|
|
|
|
|
if we can open-code sqrt. Otherwise it's not worth while. */
|
2000-11-14 18:30:02 +01:00
|
|
|
|
if (sqrt_optab->handlers[(int) submode].insn_code != CODE_FOR_nothing
|
|
|
|
|
&& ! flag_trapv)
|
1992-10-05 07:28:37 +01:00
|
|
|
|
{
|
|
|
|
|
rtx real, imag, total;
|
|
|
|
|
|
|
|
|
|
real = gen_realpart (submode, op0);
|
|
|
|
|
imag = gen_imagpart (submode, op0);
|
1993-11-20 00:36:25 +01:00
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
/* Square both parts. */
|
1993-11-20 00:36:25 +01:00
|
|
|
|
real = expand_mult (submode, real, real, NULL_RTX, 0);
|
|
|
|
|
imag = expand_mult (submode, imag, imag, NULL_RTX, 0);
|
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
/* Sum the parts. */
|
1994-06-18 16:21:32 +02:00
|
|
|
|
total = expand_binop (submode, add_optab, real, imag, NULL_RTX,
|
1992-10-05 07:28:37 +01:00
|
|
|
|
0, OPTAB_LIB_WIDEN);
|
1993-11-20 00:36:25 +01:00
|
|
|
|
|
1992-10-05 07:28:37 +01:00
|
|
|
|
/* Get sqrt in TARGET. Set TARGET to where the result is. */
|
|
|
|
|
target = expand_unop (submode, sqrt_optab, total, target, 0);
|
|
|
|
|
if (target == 0)
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
else
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now try a library call in this mode. */
|
2000-10-18 23:33:41 +02:00
|
|
|
|
if (this_abs_optab->handlers[(int) mode].libfunc)
|
1992-10-05 07:28:37 +01:00
|
|
|
|
{
|
|
|
|
|
rtx insns;
|
1993-09-16 16:22:33 +02:00
|
|
|
|
rtx value;
|
1992-10-05 07:28:37 +01:00
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
/* Pass 1 for NO_QUEUE so we don't lose any increments
|
|
|
|
|
if the libcall is cse'd or moved. */
|
1993-09-15 15:38:01 +02:00
|
|
|
|
value = emit_library_call_value (abs_optab->handlers[(int) mode].libfunc,
|
2000-09-17 14:45:51 +02:00
|
|
|
|
NULL_RTX, LCT_CONST, submode, 1, op0, mode);
|
1992-10-05 07:28:37 +01:00
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
|
|
|
|
target = gen_reg_rtx (submode);
|
1993-09-15 15:38:01 +02:00
|
|
|
|
emit_libcall_block (insns, target, value,
|
2000-10-18 23:33:41 +02:00
|
|
|
|
gen_rtx_fmt_e (this_abs_optab->code, mode, op0));
|
1992-10-05 07:28:37 +01:00
|
|
|
|
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* It can't be done in this mode. Can we do it in a wider mode? */
|
|
|
|
|
|
|
|
|
|
for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
|
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
|
|
|
|
|
{
|
2000-10-18 23:33:41 +02:00
|
|
|
|
if ((this_abs_optab->handlers[(int) wider_mode].insn_code
|
1992-10-05 07:28:37 +01:00
|
|
|
|
!= CODE_FOR_nothing)
|
2000-10-18 23:33:41 +02:00
|
|
|
|
|| this_abs_optab->handlers[(int) wider_mode].libfunc)
|
1992-10-05 07:28:37 +01:00
|
|
|
|
{
|
|
|
|
|
rtx xop0 = op0;
|
|
|
|
|
|
1993-09-09 21:50:55 +02:00
|
|
|
|
xop0 = convert_modes (wider_mode, mode, xop0, unsignedp);
|
1992-10-05 07:28:37 +01:00
|
|
|
|
|
|
|
|
|
temp = expand_complex_abs (wider_mode, xop0, NULL_RTX, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
if (class != MODE_COMPLEX_INT)
|
|
|
|
|
{
|
|
|
|
|
if (target == 0)
|
|
|
|
|
target = gen_reg_rtx (submode);
|
|
|
|
|
convert_move (target, temp, 0);
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return gen_lowpart (submode, temp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
delete_insns_since (last);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1992-11-25 19:04:15 +01:00
|
|
|
|
delete_insns_since (entry_last);
|
1992-10-05 07:28:37 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Generate an instruction whose insn-code is INSN_CODE,
|
|
|
|
|
with two operands: an output TARGET and an input OP0.
|
|
|
|
|
TARGET *must* be nonzero, and the output is always stored there.
|
|
|
|
|
CODE is an rtx code such that (CODE OP0) is an rtx that describes
|
|
|
|
|
the value that is stored into TARGET. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx temp;
|
1999-09-12 14:46:08 +02:00
|
|
|
|
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx pat;
|
|
|
|
|
|
|
|
|
|
temp = target = protect_from_queue (target, 1);
|
|
|
|
|
|
|
|
|
|
op0 = protect_from_queue (op0, 0);
|
|
|
|
|
|
1996-12-10 21:56:07 +01:00
|
|
|
|
/* Sign and zero extension from memory is often done specially on
|
|
|
|
|
RISC machines, so forcing into a register here can pessimize
|
|
|
|
|
code. */
|
|
|
|
|
if (flag_force_mem && code != SIGN_EXTEND && code != ZERO_EXTEND)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
op0 = force_not_mem (op0);
|
|
|
|
|
|
|
|
|
|
/* Now, if insn does not accept our operands, put them into pseudos. */
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
op0 = copy_to_mode_reg (mode0, op0);
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[0].predicate) (temp, GET_MODE (temp))
|
alias.c (get_alias_set, [...]): Use MEM_P.
2004-07-01 Jerry Quinn <jlquinn@optonline.net>
* alias.c (get_alias_set, canon_rtx, get_addr,
nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1):
Use MEM_P.
* builtins.c (expand_builtin_prefetch, expand_builtin_profile_func,
expand_builtin): Likewise.
* calls.c (expand_call, emit_library_call_value_1, store_one_arg):
Likewise.
* combine.c (can_combine_p, combinable_i3pat, try_combine,
find_split_point, combine_simplify_rtx, simplify_set, make_extraction,
rtx_equal_for_field_assignment_p, gen_lowpart_for_combine,
record_dead_and_set_regs_1, get_last_value_validate,
mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise.
* cse.c (check_dependence, canon_hash, equiv_constant,
gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers,
cse_around_loop, cse_check_loop_start, cse_set_around_loop,
count_reg_usage): Likewise.
* cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup,
cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set,
cselib_record_sets): Likewise.
* dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol,
dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise.
* ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise.
* df.c (df_uses_record): Likewise.
* dojump (do_jump): Likewise.
* dwarf2out.c (stack_adjust_offset, mem_loc_descriptor,
loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info,
decl_start_label): Likewise.
* emit-rtl.c (gen_complex_constant_part, gen_highpart,
operand_subword, change_address_1, make_safe_from): Likewise.
* explow.c (break_out_memory_refs, copy_all_regs, validize_mem,
stabilize, force_not_mem): Likewise.
* expmed.c (store_bit_field, store_split_bit_field, extract_bit_field,
expand_mult_const, expand_divmod, emit_store_flag): Likewise.
* expr.c (convert_move, convert_modes, emit_block_move,
emit_group_load, emit_group_store, clear_storage, emit_move_insn,
emit_move_insn_1, expand_assignment, store_expr,
store_constructor_field, store_constructor, store_field,
force_operand, safe_from_p, expand_expr_real_1, expand_increment):
Likewise.
* final.c (cleanup_subreg_operands, alter_subreg,
get_mem_expr_from_op): Likewise.
* flow.c (notice_stack_pointer_modification_1,
init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs):
Likewise.
* function.c (mark_temp_addr_taken, preserve_temp_slots,
preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1,
optimize_bit_field, flush_addressof, purge_addressof_1,
instantiate_decl, instantiate_virtual_regs_1, assign_parms,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
keep_stack_depressed): Likewise.
* ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok,
noce_process_if_block, find_memory): Likewise.
* integrate.c (subst_constants, allocate_initial_values): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p,
update_equiv_regs): Likewise.
* loop.c (scan_loop, prescan_loop, note_addr_stored, check_store,
maybe_eliminate_biv_1, find_mem_in_note_1): Likewise.
* optabs.c (expand_abs, emit_unop_insn): Likewise.
* passes.c (rest_of_handle_final): Likewise.
* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands,
move2add_note_store): Likewise.
* ra-build.c (detect_remat_webs): Likewise.
* ra-debug.c (dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, insert_stores): Likewise.
* recog.c (validate_change, apply_change_group, cancel_changes,
validate_replace_rtx_1, general_operand, register_operand,
nonmemory_operand, push_operand, pop_operand, memory_operand,
indirect_operand, asm_operand_ok, offsettable_memref_p,
offsettable_nonstrict_memref_p, constrain_operands,
store_data_bypass_p): Likewise.
* reg-stack.c (subst_stack_regs_pat): Likewise.
* regclass.c (record_operand_costs, scan_one_insn, record_reg_classes,
copy_cost, reg_scan_mark_refs): Likewise.
* regmove.c (optimize_reg_copy_3, stack_memref_p,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (copyprop_hardreg_forward_1): Likewise.
* reload.c (can_reload_into, push_reload, decompose, immune_p,
find_reloads, find_reloads_address, find_reloads_address_1,
reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p,
find_equiv_reg): Likewise.
* reload1.c (reload, eliminate_regs, eliminate_regs_in_insn,
reload_as_needed, choose_reload_regs, emit_input_reload_insns,
do_input_reload, emit_reload_insns, gen_reload, delete_output_reload,
delete_address_reloads): Likewise.
* resource.c (mark_referenced_resources): Likewise.
* rtlanal.c (get_jump_table_offset, count_occurrences,
reg_referenced_p, reg_set_p, set_of_1, set_noop_p,
reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
* sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol,
sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms,
sdbout_global_decl): Likewise.
* simplify-rtx.c (simplify_subreg): Likewise.
* stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl,
expand_anon_union_decl, expand_end_case_type): Likewise.
* unroll.c (calculate_giv_inc): Likewise.
* var-tracking.c (stack_adjust_offset_pre_post,
bb_stack_adjust_offset, track_expr_p, count_uses, add_uses,
add_stores, compute_bb_dataflow, vt_get_decl_and_offset,
vt_add_function_parameters): Likewise.
* varasm.c (make_var_volatile, notice_global_symbol,
assemble_external, decode_addr_const, mark_weak,
default_encode_section_info): Likewise.
From-SVN: r83980
2004-07-01 14:52:53 +02:00
|
|
|
|
|| (flag_force_mem && MEM_P (temp)))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
temp = gen_reg_rtx (GET_MODE (temp));
|
|
|
|
|
|
|
|
|
|
pat = GEN_FCN (icode) (temp, op0);
|
|
|
|
|
|
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
|
|
|
|
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX && code != UNKNOWN)
|
1992-07-06 22:04:10 +02:00
|
|
|
|
add_equal_note (pat, temp, code, op0, NULL_RTX);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
emit_insn (pat);
|
|
|
|
|
|
|
|
|
|
if (temp != target)
|
|
|
|
|
emit_move_insn (target, temp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit code to perform a series of operations on a multi-word quantity, one
|
|
|
|
|
word at a time.
|
|
|
|
|
|
1992-03-14 06:07:15 +01:00
|
|
|
|
Such a block is preceded by a CLOBBER of the output, consists of multiple
|
1991-12-30 04:19:53 +01:00
|
|
|
|
insns, each setting one word of the output, and followed by a SET copying
|
|
|
|
|
the output to itself.
|
|
|
|
|
|
|
|
|
|
Each of the insns setting words of the output receives a REG_NO_CONFLICT
|
|
|
|
|
note indicating that it doesn't conflict with the (also multi-word)
|
|
|
|
|
inputs. The entire block is surrounded by REG_LIBCALL and REG_RETVAL
|
|
|
|
|
notes.
|
|
|
|
|
|
|
|
|
|
INSNS is a block of code generated to perform the operation, not including
|
|
|
|
|
the CLOBBER and final copy. All insns that compute intermediate values
|
2003-07-06 11:56:09 +02:00
|
|
|
|
are first emitted, followed by the block as described above.
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
TARGET, OP0, and OP1 are the output and inputs of the operations,
|
|
|
|
|
respectively. OP1 may be zero for a unary operation.
|
|
|
|
|
|
2002-09-27 00:25:14 +02:00
|
|
|
|
EQUIV, if nonzero, is an expression to be placed into a REG_EQUAL note
|
1991-12-30 04:19:53 +01:00
|
|
|
|
on the last insn.
|
|
|
|
|
|
|
|
|
|
If TARGET is not a register, INSNS is simply emitted with no special
|
1994-11-22 20:38:02 +01:00
|
|
|
|
processing. Likewise if anything in INSNS is not an INSN or if
|
|
|
|
|
there is a libcall block inside INSNS.
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
The final insn emitted is returned. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_no_conflict_block (rtx insns, rtx target, rtx op0, rtx op1, rtx equiv)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
rtx prev, next, first, last, insn;
|
|
|
|
|
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (!REG_P (target) || reload_in_progress)
|
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
|
|
|
|
return emit_insn (insns);
|
1994-11-22 20:38:02 +01:00
|
|
|
|
else
|
|
|
|
|
for (insn = insns; insn; insn = NEXT_INSN (insn))
|
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08 Jerry Quinn <jlquinn@optonline.net>
* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
* bb-reorder.c (mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, find_jump_block,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
Likewise.
* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
link_btr_uses, move_btr_def): Likewise.
* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
expand_builtin_expect_jump): Likewise.
* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
* calls.c (expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
find_bb_boundaries): Likewise.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, insns_match_p,
flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_optimize_cfg): Likewise.
* cfgexpand.c (expand_block, construct_exit_block): Likewise.
* cfglayout.c (skip_insns_after_block, label_for_bb,
record_effective_endpoints, insn_locators_initialize,
fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
* cfgmainloop.c (create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, delete_insn_chain,
create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_branch_edge, force_nonfallthru_and_redirect,
rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
* combine.c (combine_instructions, can_combine_p, try_combine,
find_split_point, record_dead_and_set_regs, reg_dead_at_p,
distribute_notes, distribute_links, insn_cuid): Likewise.
* cse.c (fold_rtx, cse_insn, cse_around_loop,
invalidate_skipped_block, cse_set_around_loop,
cse_end_of_basic_block, cse_main, cse_basic_block,
cse_condition_code_reg): Likewise.
* cselib.c (cselib_process_insn): Likewise.
* ddg.c (create_ddg): Likewise.
* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
Likewise.
* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
gen_label_die, dwarf2out_var_location): Likewise.
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
last_call_insn, active_insn_p, next_label, prev_label,
link_cc0_insns, next_cc0_user, try_split, add_insn_after,
add_insn_before, remove_insn, add_function_usage_to,
reorder_insns, find_line_note, remove_unnecessary_notes,
emit_insn_after_1, classify_insn): Likewise.
* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
connect_post_landing_pads, sjlj_mark_call_sites,
sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
can_throw_internal, can_throw_external, set_nothrow_function_flags,
convert_to_eh_region_ranges): Likewise.
* explow.c (optimize_save_area_alloca): Likewise.
* expr.c (expand_expr_real): Likewise.
* final.c (insn_current_reference_address, compute_alignments,
shorten_branches, final, scan_ahead_for_unlikely_executed_note,
final_scan_insn, output_asm_label, leaf_function_p): Likewise.
* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
propagate_block_delete_insn, propagate_one_insn,
init_propagate_block_info, propagate_block, libcall_dead_p,
mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
Likewise.
* function.c (instantiate_virtual_regs, reorder_blocks_1,
expand_function_start, expand_function_end, contains,
thread_prologue_and_epilogue_insns,
reposition_prologue_and_epilogue_notes): Likewise.
* gcse.c (constprop_register, bypass_conditional_jumps,
insert_insn_end_bb, gcse_after_reload): Likewise.
* genemit.c (gen_expand, gen_split): Likewise.
* genpeep.c (gen_peephole, main): Likewise.
* global.c (build_insn_chain): Likewise.
* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (unlink_other_notes, unlink_line_notes,
get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, rm_other_notes,
ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
merge_if_block, block_jumps_and_fallthru_p, find_if_block,
dead_or_predicable): Likewise.
* integrate.c (try_constants): Likewise.
* jump.c (rebuild_jump_labels, cleanup_barriers,
purge_line_number_notes, init_label_info, mark_all_labels,
squeeze_notes, get_label_before, get_label_after,
reversed_comparison_code_parts, simplejump_p, pc_set,
returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
delete_barrier, delete_prior_computation, delete_computation,
delete_related_insns, delete_for_peephole, redirect_jump):
Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
Likewise.
* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
* loop-iv.c (simplify_using_assignment): Likewise.
* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
check_insn_for_givs, check_final_value, update_giv_derive,
basic_induction_var, product_cheap_p, check_dbra_loop,
loop_insn_first_p, last_use_this_basic_block,
canonicalize_condition, get_condition, loop_regs_scan, load_mems,
try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
sms_schedule_by_order): Likewise.
* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
* postreload.c (reload_cse_simplify_operands, reload_combine,
reload_cse_move2add): Likewise.
* predict.c (can_predict_insn_p, estimate_probability,
expected_value_to_br_prob, process_note_predictions): Likewise.
* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
* profile.c (branch_prob): Likewise.
* ra-build.c (live_out_1, livethrough_conflicts_bb,
detect_webs_set_in_cond_jump): Likewise.
* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
ra_print_rtl_with_bb): Likewise.
* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
* recog.c (next_insn_tests_no_inequality, find_single_use,
split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
* reg-stack.c (next_flags_user, record_label_references,
emit_swap_insn, swap_rtx_condition, subst_stack_regs,
compensate_edge, convert_regs_1): Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
regmove_optimize, fixup_match_1, single_set_for_csa,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
find_equiv_reg): Likewise.
* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
reload_as_needed, emit_input_reload_insns, do_output_reload,
delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
Likewise.
* reorg.c (find_end_label, emit_delay_sequence,
delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
get_jump_flags, rare_destination, mostly_true_jump,
try_merge_delay_insns, redundant_insn, own_thread_p,
fill_simple_delay_slots, fill_slots_from_thread,
fill_eager_delay_slots, relax_delay_slots, make_return_insns,
dbr_schedule): Likewise.
* resource.c (find_basic_block, next_insn_no_annul,
find_dead_or_set_registers, mark_target_live_regs): Likewise.
* rtl.h (RTX_PREV): Likewise.
* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
tablejump_p, computed_jump_p, insns_safe_to_move_p,
find_first_parameter_load, can_hoist_insn_p): Likewise.
* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
is_conditionally_protected, can_schedule_ready_p,
add_branch_dependences, debug_dependencies): Likewise.
* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
Likewise.
* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
set_dominates_use, ujump_to_loop_cont): Likewise.
* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
* varasm.c (output_constant_pool_1): Likewise.
From-SVN: r84341
2004-07-09 05:29:35 +02:00
|
|
|
|
if (!NONJUMP_INSN_P (insn)
|
1994-11-22 20:38:02 +01:00
|
|
|
|
|| find_reg_note (insn, REG_LIBCALL, NULL_RTX))
|
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
|
|
|
|
return emit_insn (insns);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* First emit all insns that do not store into words of the output and remove
|
|
|
|
|
these from the list. */
|
|
|
|
|
for (insn = insns; insn; insn = next)
|
|
|
|
|
{
|
2002-03-27 23:16:20 +01:00
|
|
|
|
rtx set = 0, note;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
next = NEXT_INSN (insn);
|
|
|
|
|
|
2003-08-22 09:03:15 +02:00
|
|
|
|
/* Some ports (cris) create a libcall regions at their own. We must
|
2002-03-27 23:16:20 +01:00
|
|
|
|
avoid any potential nesting of LIBCALLs. */
|
|
|
|
|
if ((note = find_reg_note (insn, REG_LIBCALL, NULL)) != NULL)
|
|
|
|
|
remove_note (insn, note);
|
|
|
|
|
if ((note = find_reg_note (insn, REG_RETVAL, NULL)) != NULL)
|
|
|
|
|
remove_note (insn, note);
|
|
|
|
|
|
1999-09-07 07:49:18 +02:00
|
|
|
|
if (GET_CODE (PATTERN (insn)) == SET || GET_CODE (PATTERN (insn)) == USE
|
|
|
|
|
|| GET_CODE (PATTERN (insn)) == CLOBBER)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
set = PATTERN (insn);
|
|
|
|
|
else if (GET_CODE (PATTERN (insn)) == PARALLEL)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
|
|
|
|
|
if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET)
|
|
|
|
|
{
|
|
|
|
|
set = XVECEXP (PATTERN (insn), 0, i);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (set == 0)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (! reg_overlap_mentioned_p (target, SET_DEST (set)))
|
|
|
|
|
{
|
|
|
|
|
if (PREV_INSN (insn))
|
|
|
|
|
NEXT_INSN (PREV_INSN (insn)) = next;
|
|
|
|
|
else
|
|
|
|
|
insns = next;
|
|
|
|
|
|
|
|
|
|
if (next)
|
|
|
|
|
PREV_INSN (next) = PREV_INSN (insn);
|
|
|
|
|
|
|
|
|
|
add_insn (insn);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
prev = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
/* Now write the CLOBBER of the output, followed by the setting of each
|
|
|
|
|
of the words, followed by the final copy. */
|
|
|
|
|
if (target != op0 && target != op1)
|
1998-06-24 16:49:51 +02:00
|
|
|
|
emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
for (insn = insns; insn; insn = next)
|
|
|
|
|
{
|
|
|
|
|
next = NEXT_INSN (insn);
|
|
|
|
|
add_insn (insn);
|
|
|
|
|
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (op1 && REG_P (op1))
|
1998-06-24 16:49:51 +02:00
|
|
|
|
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_NO_CONFLICT, op1,
|
|
|
|
|
REG_NOTES (insn));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (op0 && REG_P (op0))
|
1998-06-24 16:49:51 +02:00
|
|
|
|
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_NO_CONFLICT, op0,
|
|
|
|
|
REG_NOTES (insn));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1993-03-04 21:37:02 +01:00
|
|
|
|
if (mov_optab->handlers[(int) GET_MODE (target)].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
last = emit_move_insn (target, target);
|
|
|
|
|
if (equiv)
|
1999-03-25 13:04:26 +01:00
|
|
|
|
set_unique_reg_note (last, REG_EQUAL, equiv);
|
1993-03-04 21:37:02 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
2000-04-05 20:36:20 +02:00
|
|
|
|
{
|
|
|
|
|
last = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
/* Remove any existing REG_EQUAL note from "last", or else it will
|
|
|
|
|
be mistaken for a note referring to the full contents of the
|
|
|
|
|
alleged libcall value when found together with the REG_RETVAL
|
|
|
|
|
note added below. An existing note can come from an insn
|
|
|
|
|
expansion at "last". */
|
|
|
|
|
remove_note (last, find_reg_note (last, REG_EQUAL, NULL_RTX));
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
if (prev == 0)
|
|
|
|
|
first = get_insns ();
|
|
|
|
|
else
|
|
|
|
|
first = NEXT_INSN (prev);
|
|
|
|
|
|
|
|
|
|
/* Encapsulate the block so it gets manipulated as a unit. */
|
1998-06-24 16:49:51 +02:00
|
|
|
|
REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
|
|
|
|
|
REG_NOTES (first));
|
|
|
|
|
REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
return last;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit code to make a call to a constant function or a library call.
|
|
|
|
|
|
|
|
|
|
INSNS is a list containing all insns emitted in the call.
|
|
|
|
|
These insns leave the result in RESULT. Our block is to copy RESULT
|
|
|
|
|
to TARGET, which is logically equivalent to EQUIV.
|
|
|
|
|
|
|
|
|
|
We first emit any insns that set a pseudo on the assumption that these are
|
|
|
|
|
loading constants into registers; doing so allows them to be safely cse'ed
|
|
|
|
|
between blocks. Then we emit all the other insns in the block, followed by
|
|
|
|
|
an insn to move RESULT to TARGET. This last insn will have a REQ_EQUAL
|
|
|
|
|
note with an operand of EQUIV.
|
|
|
|
|
|
1992-04-02 13:03:52 +02:00
|
|
|
|
Moving assignments to pseudos outside of the block is done to improve
|
|
|
|
|
the generated code, but is not required to generate correct code,
|
|
|
|
|
hence being unable to move an assignment is not grounds for not making
|
|
|
|
|
a libcall block. There are two reasons why it is safe to leave these
|
|
|
|
|
insns inside the block: First, we know that these pseudos cannot be
|
|
|
|
|
used in generated RTL outside the block since they are created for
|
|
|
|
|
temporary purposes within the block. Second, CSE will not record the
|
|
|
|
|
values of anything set inside a libcall block, so we know they must
|
|
|
|
|
be dead at the end of the block.
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
Except for the first group of insns (the ones setting pseudos), the
|
|
|
|
|
block is delimited by REG_RETVAL and REG_LIBCALL notes. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2000-09-15 17:35:03 +02:00
|
|
|
|
rtx final_dest = target;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx prev, next, first, last, insn;
|
|
|
|
|
|
2000-09-15 17:35:03 +02:00
|
|
|
|
/* If this is a reg with REG_USERVAR_P set, then it could possibly turn
|
|
|
|
|
into a MEM later. Protect the libcall block from this change. */
|
|
|
|
|
if (! REG_P (target) || REG_USERVAR_P (target))
|
|
|
|
|
target = gen_reg_rtx (GET_MODE (target));
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
2001-06-22 18:42:33 +02:00
|
|
|
|
/* If we're using non-call exceptions, a libcall corresponding to an
|
|
|
|
|
operation that may trap may also trap. */
|
|
|
|
|
if (flag_non_call_exceptions && may_trap_p (equiv))
|
|
|
|
|
{
|
|
|
|
|
for (insn = insns; insn; insn = NEXT_INSN (insn))
|
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08 Jerry Quinn <jlquinn@optonline.net>
* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
* bb-reorder.c (mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, find_jump_block,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
Likewise.
* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
link_btr_uses, move_btr_def): Likewise.
* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
expand_builtin_expect_jump): Likewise.
* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
* calls.c (expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
find_bb_boundaries): Likewise.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, insns_match_p,
flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_optimize_cfg): Likewise.
* cfgexpand.c (expand_block, construct_exit_block): Likewise.
* cfglayout.c (skip_insns_after_block, label_for_bb,
record_effective_endpoints, insn_locators_initialize,
fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
* cfgmainloop.c (create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, delete_insn_chain,
create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_branch_edge, force_nonfallthru_and_redirect,
rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
* combine.c (combine_instructions, can_combine_p, try_combine,
find_split_point, record_dead_and_set_regs, reg_dead_at_p,
distribute_notes, distribute_links, insn_cuid): Likewise.
* cse.c (fold_rtx, cse_insn, cse_around_loop,
invalidate_skipped_block, cse_set_around_loop,
cse_end_of_basic_block, cse_main, cse_basic_block,
cse_condition_code_reg): Likewise.
* cselib.c (cselib_process_insn): Likewise.
* ddg.c (create_ddg): Likewise.
* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
Likewise.
* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
gen_label_die, dwarf2out_var_location): Likewise.
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
last_call_insn, active_insn_p, next_label, prev_label,
link_cc0_insns, next_cc0_user, try_split, add_insn_after,
add_insn_before, remove_insn, add_function_usage_to,
reorder_insns, find_line_note, remove_unnecessary_notes,
emit_insn_after_1, classify_insn): Likewise.
* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
connect_post_landing_pads, sjlj_mark_call_sites,
sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
can_throw_internal, can_throw_external, set_nothrow_function_flags,
convert_to_eh_region_ranges): Likewise.
* explow.c (optimize_save_area_alloca): Likewise.
* expr.c (expand_expr_real): Likewise.
* final.c (insn_current_reference_address, compute_alignments,
shorten_branches, final, scan_ahead_for_unlikely_executed_note,
final_scan_insn, output_asm_label, leaf_function_p): Likewise.
* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
propagate_block_delete_insn, propagate_one_insn,
init_propagate_block_info, propagate_block, libcall_dead_p,
mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
Likewise.
* function.c (instantiate_virtual_regs, reorder_blocks_1,
expand_function_start, expand_function_end, contains,
thread_prologue_and_epilogue_insns,
reposition_prologue_and_epilogue_notes): Likewise.
* gcse.c (constprop_register, bypass_conditional_jumps,
insert_insn_end_bb, gcse_after_reload): Likewise.
* genemit.c (gen_expand, gen_split): Likewise.
* genpeep.c (gen_peephole, main): Likewise.
* global.c (build_insn_chain): Likewise.
* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (unlink_other_notes, unlink_line_notes,
get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, rm_other_notes,
ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
merge_if_block, block_jumps_and_fallthru_p, find_if_block,
dead_or_predicable): Likewise.
* integrate.c (try_constants): Likewise.
* jump.c (rebuild_jump_labels, cleanup_barriers,
purge_line_number_notes, init_label_info, mark_all_labels,
squeeze_notes, get_label_before, get_label_after,
reversed_comparison_code_parts, simplejump_p, pc_set,
returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
delete_barrier, delete_prior_computation, delete_computation,
delete_related_insns, delete_for_peephole, redirect_jump):
Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
Likewise.
* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
* loop-iv.c (simplify_using_assignment): Likewise.
* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
check_insn_for_givs, check_final_value, update_giv_derive,
basic_induction_var, product_cheap_p, check_dbra_loop,
loop_insn_first_p, last_use_this_basic_block,
canonicalize_condition, get_condition, loop_regs_scan, load_mems,
try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
sms_schedule_by_order): Likewise.
* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
* postreload.c (reload_cse_simplify_operands, reload_combine,
reload_cse_move2add): Likewise.
* predict.c (can_predict_insn_p, estimate_probability,
expected_value_to_br_prob, process_note_predictions): Likewise.
* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
* profile.c (branch_prob): Likewise.
* ra-build.c (live_out_1, livethrough_conflicts_bb,
detect_webs_set_in_cond_jump): Likewise.
* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
ra_print_rtl_with_bb): Likewise.
* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
* recog.c (next_insn_tests_no_inequality, find_single_use,
split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
* reg-stack.c (next_flags_user, record_label_references,
emit_swap_insn, swap_rtx_condition, subst_stack_regs,
compensate_edge, convert_regs_1): Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
regmove_optimize, fixup_match_1, single_set_for_csa,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
find_equiv_reg): Likewise.
* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
reload_as_needed, emit_input_reload_insns, do_output_reload,
delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
Likewise.
* reorg.c (find_end_label, emit_delay_sequence,
delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
get_jump_flags, rare_destination, mostly_true_jump,
try_merge_delay_insns, redundant_insn, own_thread_p,
fill_simple_delay_slots, fill_slots_from_thread,
fill_eager_delay_slots, relax_delay_slots, make_return_insns,
dbr_schedule): Likewise.
* resource.c (find_basic_block, next_insn_no_annul,
find_dead_or_set_registers, mark_target_live_regs): Likewise.
* rtl.h (RTX_PREV): Likewise.
* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
tablejump_p, computed_jump_p, insns_safe_to_move_p,
find_first_parameter_load, can_hoist_insn_p): Likewise.
* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
is_conditionally_protected, can_schedule_ready_p,
add_branch_dependences, debug_dependencies): Likewise.
* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
Likewise.
* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
set_dominates_use, ujump_to_loop_cont): Likewise.
* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
* varasm.c (output_constant_pool_1): Likewise.
From-SVN: r84341
2004-07-09 05:29:35 +02:00
|
|
|
|
if (CALL_P (insn))
|
2001-06-22 18:42:33 +02:00
|
|
|
|
{
|
|
|
|
|
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
2001-06-22 18:42:33 +02:00
|
|
|
|
if (note != 0 && INTVAL (XEXP (note, 0)) <= 0)
|
|
|
|
|
remove_note (insn, note);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
1999-01-19 10:39:37 +01:00
|
|
|
|
/* look for any CALL_INSNs in this sequence, and attach a REG_EH_REGION
|
2000-04-15 17:20:58 +02:00
|
|
|
|
reg note to indicate that this call cannot throw or execute a nonlocal
|
2000-09-18 11:46:51 +02:00
|
|
|
|
goto (unless there is already a REG_EH_REGION note, in which case
|
2001-05-11 17:28:40 +02:00
|
|
|
|
we update it). */
|
2001-06-22 18:42:33 +02:00
|
|
|
|
for (insn = insns; insn; insn = NEXT_INSN (insn))
|
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08 Jerry Quinn <jlquinn@optonline.net>
* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
* bb-reorder.c (mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, find_jump_block,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
Likewise.
* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
link_btr_uses, move_btr_def): Likewise.
* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
expand_builtin_expect_jump): Likewise.
* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
* calls.c (expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
find_bb_boundaries): Likewise.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, insns_match_p,
flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_optimize_cfg): Likewise.
* cfgexpand.c (expand_block, construct_exit_block): Likewise.
* cfglayout.c (skip_insns_after_block, label_for_bb,
record_effective_endpoints, insn_locators_initialize,
fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
* cfgmainloop.c (create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, delete_insn_chain,
create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_branch_edge, force_nonfallthru_and_redirect,
rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
* combine.c (combine_instructions, can_combine_p, try_combine,
find_split_point, record_dead_and_set_regs, reg_dead_at_p,
distribute_notes, distribute_links, insn_cuid): Likewise.
* cse.c (fold_rtx, cse_insn, cse_around_loop,
invalidate_skipped_block, cse_set_around_loop,
cse_end_of_basic_block, cse_main, cse_basic_block,
cse_condition_code_reg): Likewise.
* cselib.c (cselib_process_insn): Likewise.
* ddg.c (create_ddg): Likewise.
* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
Likewise.
* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
gen_label_die, dwarf2out_var_location): Likewise.
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
last_call_insn, active_insn_p, next_label, prev_label,
link_cc0_insns, next_cc0_user, try_split, add_insn_after,
add_insn_before, remove_insn, add_function_usage_to,
reorder_insns, find_line_note, remove_unnecessary_notes,
emit_insn_after_1, classify_insn): Likewise.
* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
connect_post_landing_pads, sjlj_mark_call_sites,
sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
can_throw_internal, can_throw_external, set_nothrow_function_flags,
convert_to_eh_region_ranges): Likewise.
* explow.c (optimize_save_area_alloca): Likewise.
* expr.c (expand_expr_real): Likewise.
* final.c (insn_current_reference_address, compute_alignments,
shorten_branches, final, scan_ahead_for_unlikely_executed_note,
final_scan_insn, output_asm_label, leaf_function_p): Likewise.
* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
propagate_block_delete_insn, propagate_one_insn,
init_propagate_block_info, propagate_block, libcall_dead_p,
mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
Likewise.
* function.c (instantiate_virtual_regs, reorder_blocks_1,
expand_function_start, expand_function_end, contains,
thread_prologue_and_epilogue_insns,
reposition_prologue_and_epilogue_notes): Likewise.
* gcse.c (constprop_register, bypass_conditional_jumps,
insert_insn_end_bb, gcse_after_reload): Likewise.
* genemit.c (gen_expand, gen_split): Likewise.
* genpeep.c (gen_peephole, main): Likewise.
* global.c (build_insn_chain): Likewise.
* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (unlink_other_notes, unlink_line_notes,
get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, rm_other_notes,
ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
merge_if_block, block_jumps_and_fallthru_p, find_if_block,
dead_or_predicable): Likewise.
* integrate.c (try_constants): Likewise.
* jump.c (rebuild_jump_labels, cleanup_barriers,
purge_line_number_notes, init_label_info, mark_all_labels,
squeeze_notes, get_label_before, get_label_after,
reversed_comparison_code_parts, simplejump_p, pc_set,
returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
delete_barrier, delete_prior_computation, delete_computation,
delete_related_insns, delete_for_peephole, redirect_jump):
Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
Likewise.
* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
* loop-iv.c (simplify_using_assignment): Likewise.
* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
check_insn_for_givs, check_final_value, update_giv_derive,
basic_induction_var, product_cheap_p, check_dbra_loop,
loop_insn_first_p, last_use_this_basic_block,
canonicalize_condition, get_condition, loop_regs_scan, load_mems,
try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
sms_schedule_by_order): Likewise.
* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
* postreload.c (reload_cse_simplify_operands, reload_combine,
reload_cse_move2add): Likewise.
* predict.c (can_predict_insn_p, estimate_probability,
expected_value_to_br_prob, process_note_predictions): Likewise.
* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
* profile.c (branch_prob): Likewise.
* ra-build.c (live_out_1, livethrough_conflicts_bb,
detect_webs_set_in_cond_jump): Likewise.
* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
ra_print_rtl_with_bb): Likewise.
* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
* recog.c (next_insn_tests_no_inequality, find_single_use,
split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
* reg-stack.c (next_flags_user, record_label_references,
emit_swap_insn, swap_rtx_condition, subst_stack_regs,
compensate_edge, convert_regs_1): Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
regmove_optimize, fixup_match_1, single_set_for_csa,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
find_equiv_reg): Likewise.
* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
reload_as_needed, emit_input_reload_insns, do_output_reload,
delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
Likewise.
* reorg.c (find_end_label, emit_delay_sequence,
delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
get_jump_flags, rare_destination, mostly_true_jump,
try_merge_delay_insns, redundant_insn, own_thread_p,
fill_simple_delay_slots, fill_slots_from_thread,
fill_eager_delay_slots, relax_delay_slots, make_return_insns,
dbr_schedule): Likewise.
* resource.c (find_basic_block, next_insn_no_annul,
find_dead_or_set_registers, mark_target_live_regs): Likewise.
* rtl.h (RTX_PREV): Likewise.
* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
tablejump_p, computed_jump_p, insns_safe_to_move_p,
find_first_parameter_load, can_hoist_insn_p): Likewise.
* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
is_conditionally_protected, can_schedule_ready_p,
add_branch_dependences, debug_dependencies): Likewise.
* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
Likewise.
* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
set_dominates_use, ujump_to_loop_cont): Likewise.
* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
* varasm.c (output_constant_pool_1): Likewise.
From-SVN: r84341
2004-07-09 05:29:35 +02:00
|
|
|
|
if (CALL_P (insn))
|
2001-06-22 18:42:33 +02:00
|
|
|
|
{
|
|
|
|
|
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
2001-06-22 18:42:33 +02:00
|
|
|
|
if (note != 0)
|
2004-02-03 06:39:57 +01:00
|
|
|
|
XEXP (note, 0) = constm1_rtx;
|
2001-06-22 18:42:33 +02:00
|
|
|
|
else
|
2004-02-03 06:39:57 +01:00
|
|
|
|
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, constm1_rtx,
|
2001-06-22 18:42:33 +02:00
|
|
|
|
REG_NOTES (insn));
|
|
|
|
|
}
|
1999-01-19 10:39:37 +01:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* First emit all insns that set pseudos. Remove them from the list as
|
1993-09-06 19:27:49 +02:00
|
|
|
|
we go. Avoid insns that set pseudos which were referenced in previous
|
1992-04-02 13:03:52 +02:00
|
|
|
|
insns. These can be generated by move_by_pieces, for example,
|
1993-09-06 19:27:49 +02:00
|
|
|
|
to update an address. Similarly, avoid insns that reference things
|
|
|
|
|
set in previous insns. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
for (insn = insns; insn; insn = next)
|
|
|
|
|
{
|
|
|
|
|
rtx set = single_set (insn);
|
2002-03-27 23:16:20 +01:00
|
|
|
|
rtx note;
|
|
|
|
|
|
2003-08-22 09:03:15 +02:00
|
|
|
|
/* Some ports (cris) create a libcall regions at their own. We must
|
2002-03-27 23:16:20 +01:00
|
|
|
|
avoid any potential nesting of LIBCALLs. */
|
|
|
|
|
if ((note = find_reg_note (insn, REG_LIBCALL, NULL)) != NULL)
|
|
|
|
|
remove_note (insn, note);
|
|
|
|
|
if ((note = find_reg_note (insn, REG_RETVAL, NULL)) != NULL)
|
|
|
|
|
remove_note (insn, note);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
next = NEXT_INSN (insn);
|
|
|
|
|
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (set != 0 && REG_P (SET_DEST (set))
|
1992-04-02 13:03:52 +02:00
|
|
|
|
&& REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER
|
1992-04-25 04:07:13 +02:00
|
|
|
|
&& (insn == insns
|
2000-04-27 06:26:08 +02:00
|
|
|
|
|| ((! INSN_P(insns)
|
|
|
|
|
|| ! reg_mentioned_p (SET_DEST (set), PATTERN (insns)))
|
1993-09-06 19:27:49 +02:00
|
|
|
|
&& ! reg_used_between_p (SET_DEST (set), insns, insn)
|
|
|
|
|
&& ! modified_in_p (SET_SRC (set), insns)
|
|
|
|
|
&& ! modified_between_p (SET_SRC (set), insns, insn))))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
if (PREV_INSN (insn))
|
|
|
|
|
NEXT_INSN (PREV_INSN (insn)) = next;
|
|
|
|
|
else
|
|
|
|
|
insns = next;
|
|
|
|
|
|
|
|
|
|
if (next)
|
|
|
|
|
PREV_INSN (next) = PREV_INSN (insn);
|
|
|
|
|
|
|
|
|
|
add_insn (insn);
|
|
|
|
|
}
|
2003-06-16 08:26:03 +02:00
|
|
|
|
|
|
|
|
|
/* Some ports use a loop to copy large arguments onto the stack.
|
|
|
|
|
Don't move anything outside such a loop. */
|
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08 Jerry Quinn <jlquinn@optonline.net>
* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
* bb-reorder.c (mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, find_jump_block,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
Likewise.
* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
link_btr_uses, move_btr_def): Likewise.
* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
expand_builtin_expect_jump): Likewise.
* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
* calls.c (expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
find_bb_boundaries): Likewise.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, insns_match_p,
flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_optimize_cfg): Likewise.
* cfgexpand.c (expand_block, construct_exit_block): Likewise.
* cfglayout.c (skip_insns_after_block, label_for_bb,
record_effective_endpoints, insn_locators_initialize,
fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
* cfgmainloop.c (create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, delete_insn_chain,
create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_branch_edge, force_nonfallthru_and_redirect,
rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
* combine.c (combine_instructions, can_combine_p, try_combine,
find_split_point, record_dead_and_set_regs, reg_dead_at_p,
distribute_notes, distribute_links, insn_cuid): Likewise.
* cse.c (fold_rtx, cse_insn, cse_around_loop,
invalidate_skipped_block, cse_set_around_loop,
cse_end_of_basic_block, cse_main, cse_basic_block,
cse_condition_code_reg): Likewise.
* cselib.c (cselib_process_insn): Likewise.
* ddg.c (create_ddg): Likewise.
* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
Likewise.
* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
gen_label_die, dwarf2out_var_location): Likewise.
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
last_call_insn, active_insn_p, next_label, prev_label,
link_cc0_insns, next_cc0_user, try_split, add_insn_after,
add_insn_before, remove_insn, add_function_usage_to,
reorder_insns, find_line_note, remove_unnecessary_notes,
emit_insn_after_1, classify_insn): Likewise.
* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
connect_post_landing_pads, sjlj_mark_call_sites,
sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
can_throw_internal, can_throw_external, set_nothrow_function_flags,
convert_to_eh_region_ranges): Likewise.
* explow.c (optimize_save_area_alloca): Likewise.
* expr.c (expand_expr_real): Likewise.
* final.c (insn_current_reference_address, compute_alignments,
shorten_branches, final, scan_ahead_for_unlikely_executed_note,
final_scan_insn, output_asm_label, leaf_function_p): Likewise.
* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
propagate_block_delete_insn, propagate_one_insn,
init_propagate_block_info, propagate_block, libcall_dead_p,
mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
Likewise.
* function.c (instantiate_virtual_regs, reorder_blocks_1,
expand_function_start, expand_function_end, contains,
thread_prologue_and_epilogue_insns,
reposition_prologue_and_epilogue_notes): Likewise.
* gcse.c (constprop_register, bypass_conditional_jumps,
insert_insn_end_bb, gcse_after_reload): Likewise.
* genemit.c (gen_expand, gen_split): Likewise.
* genpeep.c (gen_peephole, main): Likewise.
* global.c (build_insn_chain): Likewise.
* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (unlink_other_notes, unlink_line_notes,
get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, rm_other_notes,
ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
merge_if_block, block_jumps_and_fallthru_p, find_if_block,
dead_or_predicable): Likewise.
* integrate.c (try_constants): Likewise.
* jump.c (rebuild_jump_labels, cleanup_barriers,
purge_line_number_notes, init_label_info, mark_all_labels,
squeeze_notes, get_label_before, get_label_after,
reversed_comparison_code_parts, simplejump_p, pc_set,
returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
delete_barrier, delete_prior_computation, delete_computation,
delete_related_insns, delete_for_peephole, redirect_jump):
Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
Likewise.
* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
* loop-iv.c (simplify_using_assignment): Likewise.
* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
check_insn_for_givs, check_final_value, update_giv_derive,
basic_induction_var, product_cheap_p, check_dbra_loop,
loop_insn_first_p, last_use_this_basic_block,
canonicalize_condition, get_condition, loop_regs_scan, load_mems,
try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
sms_schedule_by_order): Likewise.
* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
* postreload.c (reload_cse_simplify_operands, reload_combine,
reload_cse_move2add): Likewise.
* predict.c (can_predict_insn_p, estimate_probability,
expected_value_to_br_prob, process_note_predictions): Likewise.
* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
* profile.c (branch_prob): Likewise.
* ra-build.c (live_out_1, livethrough_conflicts_bb,
detect_webs_set_in_cond_jump): Likewise.
* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
ra_print_rtl_with_bb): Likewise.
* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
* recog.c (next_insn_tests_no_inequality, find_single_use,
split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
* reg-stack.c (next_flags_user, record_label_references,
emit_swap_insn, swap_rtx_condition, subst_stack_regs,
compensate_edge, convert_regs_1): Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
regmove_optimize, fixup_match_1, single_set_for_csa,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
find_equiv_reg): Likewise.
* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
reload_as_needed, emit_input_reload_insns, do_output_reload,
delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
Likewise.
* reorg.c (find_end_label, emit_delay_sequence,
delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
get_jump_flags, rare_destination, mostly_true_jump,
try_merge_delay_insns, redundant_insn, own_thread_p,
fill_simple_delay_slots, fill_slots_from_thread,
fill_eager_delay_slots, relax_delay_slots, make_return_insns,
dbr_schedule): Likewise.
* resource.c (find_basic_block, next_insn_no_annul,
find_dead_or_set_registers, mark_target_live_regs): Likewise.
* rtl.h (RTX_PREV): Likewise.
* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
tablejump_p, computed_jump_p, insns_safe_to_move_p,
find_first_parameter_load, can_hoist_insn_p): Likewise.
* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
is_conditionally_protected, can_schedule_ready_p,
add_branch_dependences, debug_dependencies): Likewise.
* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
Likewise.
* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
set_dominates_use, ujump_to_loop_cont): Likewise.
* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
* varasm.c (output_constant_pool_1): Likewise.
From-SVN: r84341
2004-07-09 05:29:35 +02:00
|
|
|
|
if (LABEL_P (insn))
|
2003-06-16 08:26:03 +02:00
|
|
|
|
break;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
prev = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
/* Write the remaining insns followed by the final copy. */
|
|
|
|
|
|
|
|
|
|
for (insn = insns; insn; insn = next)
|
|
|
|
|
{
|
|
|
|
|
next = NEXT_INSN (insn);
|
|
|
|
|
|
|
|
|
|
add_insn (insn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
last = emit_move_insn (target, result);
|
1996-10-23 16:30:26 +02:00
|
|
|
|
if (mov_optab->handlers[(int) GET_MODE (target)].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
1999-03-25 13:04:26 +01:00
|
|
|
|
set_unique_reg_note (last, REG_EQUAL, copy_rtx (equiv));
|
2000-04-05 20:36:20 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Remove any existing REG_EQUAL note from "last", or else it will
|
|
|
|
|
be mistaken for a note referring to the full contents of the
|
|
|
|
|
libcall value when found together with the REG_RETVAL note added
|
|
|
|
|
below. An existing note can come from an insn expansion at
|
|
|
|
|
"last". */
|
|
|
|
|
remove_note (last, find_reg_note (last, REG_EQUAL, NULL_RTX));
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2000-09-17 13:32:14 +02:00
|
|
|
|
if (final_dest != target)
|
|
|
|
|
emit_move_insn (final_dest, target);
|
2000-09-15 17:35:03 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
if (prev == 0)
|
|
|
|
|
first = get_insns ();
|
|
|
|
|
else
|
|
|
|
|
first = NEXT_INSN (prev);
|
|
|
|
|
|
|
|
|
|
/* Encapsulate the block so it gets manipulated as a unit. */
|
2001-10-02 04:01:55 +02:00
|
|
|
|
if (!flag_non_call_exceptions || !may_trap_p (equiv))
|
|
|
|
|
{
|
2003-01-09 12:47:35 +01:00
|
|
|
|
/* We can't attach the REG_LIBCALL and REG_RETVAL notes
|
|
|
|
|
when the encapsulated region would not be in one basic block,
|
|
|
|
|
i.e. when there is a control_flow_insn_p insn between FIRST and LAST.
|
|
|
|
|
*/
|
|
|
|
|
bool attach_libcall_retval_notes = true;
|
|
|
|
|
next = NEXT_INSN (last);
|
|
|
|
|
for (insn = first; insn != next; insn = NEXT_INSN (insn))
|
|
|
|
|
if (control_flow_insn_p (insn))
|
|
|
|
|
{
|
|
|
|
|
attach_libcall_retval_notes = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (attach_libcall_retval_notes)
|
|
|
|
|
{
|
|
|
|
|
REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
|
|
|
|
|
REG_NOTES (first));
|
|
|
|
|
REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first,
|
|
|
|
|
REG_NOTES (last));
|
|
|
|
|
}
|
2001-10-02 04:01:55 +02:00
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate code to store zero in X. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_clr_insn (rtx x)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
emit_move_insn (x, const0_rtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate code to store 1 in X
|
|
|
|
|
assuming it contains zero beforehand. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_0_to_1_insn (rtx x)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
emit_move_insn (x, const1_rtx);
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-23 13:34:49 +02:00
|
|
|
|
/* Nonzero if we can perform a comparison of mode MODE straightforwardly.
|
2000-01-24 21:10:04 +01:00
|
|
|
|
PURPOSE describes how this comparison will be used. CODE is the rtx
|
|
|
|
|
comparison code we will be using.
|
|
|
|
|
|
|
|
|
|
??? Actually, CODE is slightly weaker than that. A target is still
|
2003-07-06 11:56:09 +02:00
|
|
|
|
required to implement all of the normal bcc operations, but not
|
2000-01-24 21:10:04 +01:00
|
|
|
|
required to implement all (or any) of the unordered bcc operations. */
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1999-09-23 13:34:49 +02:00
|
|
|
|
int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
can_compare_p (enum rtx_code code, enum machine_mode mode,
|
|
|
|
|
enum can_compare_purpose purpose)
|
1999-08-18 19:51:27 +02:00
|
|
|
|
{
|
|
|
|
|
do
|
|
|
|
|
{
|
2002-11-16 07:08:16 +01:00
|
|
|
|
if (cmp_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
2000-01-24 21:10:04 +01:00
|
|
|
|
{
|
|
|
|
|
if (purpose == ccp_jump)
|
2002-11-16 07:08:16 +01:00
|
|
|
|
return bcc_gen_fctn[(int) code] != NULL;
|
2000-01-24 21:10:04 +01:00
|
|
|
|
else if (purpose == ccp_store_flag)
|
2002-11-16 07:08:16 +01:00
|
|
|
|
return setcc_gen_code[(int) code] != CODE_FOR_nothing;
|
2000-01-24 21:10:04 +01:00
|
|
|
|
else
|
|
|
|
|
/* There's only one cmov entry point, and it's allowed to fail. */
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
1999-09-23 13:34:49 +02:00
|
|
|
|
if (purpose == ccp_jump
|
2002-11-16 07:08:16 +01:00
|
|
|
|
&& cbranch_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
1999-09-23 13:34:49 +02:00
|
|
|
|
return 1;
|
|
|
|
|
if (purpose == ccp_cmov
|
2002-11-16 07:08:16 +01:00
|
|
|
|
&& cmov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
1999-09-23 13:34:49 +02:00
|
|
|
|
return 1;
|
|
|
|
|
if (purpose == ccp_store_flag
|
2002-11-16 07:08:16 +01:00
|
|
|
|
&& cstore_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
|
1999-09-23 13:34:49 +02:00
|
|
|
|
return 1;
|
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
mode = GET_MODE_WIDER_MODE (mode);
|
1999-09-23 13:34:49 +02:00
|
|
|
|
}
|
|
|
|
|
while (mode != VOIDmode);
|
1999-08-18 19:51:27 +02:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* This function is called when we are going to emit a compare instruction that
|
|
|
|
|
compares the values found in *PX and *PY, using the rtl operator COMPARISON.
|
|
|
|
|
|
|
|
|
|
*PMODE is the mode of the inputs (in case they are const_int).
|
|
|
|
|
*PUNSIGNEDP nonzero says that the operands are unsigned;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
this matters if they need to be widened.
|
|
|
|
|
|
2001-11-16 00:44:58 +01:00
|
|
|
|
If they have mode BLKmode, then SIZE specifies the size of both operands.
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
This function performs all the setup necessary so that the caller only has
|
|
|
|
|
to emit a single comparison insn. This setup can involve doing a BLKmode
|
|
|
|
|
comparison or emitting a library call to perform the comparison if no insn
|
|
|
|
|
is available to handle it.
|
|
|
|
|
The values which are passed in through pointers can be modified; the caller
|
|
|
|
|
should perform the comparison on the modified values. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2001-11-16 00:44:58 +01:00
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
|
|
|
|
|
enum machine_mode *pmode, int *punsignedp,
|
|
|
|
|
enum can_compare_purpose purpose)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
1999-08-18 19:51:27 +02:00
|
|
|
|
enum machine_mode mode = *pmode;
|
|
|
|
|
rtx x = *px, y = *py;
|
|
|
|
|
int unsignedp = *punsignedp;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
enum mode_class class;
|
|
|
|
|
|
|
|
|
|
class = GET_MODE_CLASS (mode);
|
|
|
|
|
|
|
|
|
|
/* They could both be VOIDmode if both args are immediate constants,
|
|
|
|
|
but we should fold that at an earlier stage.
|
|
|
|
|
With no special code here, this will call abort,
|
|
|
|
|
reminding the programmer to implement such folding. */
|
|
|
|
|
|
|
|
|
|
if (mode != BLKmode && flag_force_mem)
|
|
|
|
|
{
|
2003-06-04 06:40:26 +02:00
|
|
|
|
/* Load duplicate non-volatile operands once. */
|
|
|
|
|
if (rtx_equal_p (x, y) && ! volatile_refs_p (x))
|
|
|
|
|
{
|
|
|
|
|
x = force_not_mem (x);
|
|
|
|
|
y = x;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
x = force_not_mem (x);
|
|
|
|
|
y = force_not_mem (y);
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we are inside an appropriately-short loop and one operand is an
|
|
|
|
|
expensive constant, force it into a register. */
|
builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst.
* builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst.
(expand_builtin_apply): Pass alignment to emit_block_move in bits.
(expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
(expand_builtin_memset): Likewise, but to clear_storage.
* calls.c (save_fixed_argument_area): Likewise, to move_by_pieces.
(restore_fixed_argument_area): Likewise.
(store_unaligned_arguments_into_pseudos): Likewise, to store_bit_field.
(load_register_parameters): Likewise, to emit_group_load.
(expand_call): Likewise, to emit_group_store and emit_block_move.
(emit_library_call_value_1): Likewise, to emit_block_move.
(store_one_arg): Likewise, and to emit_push_insn.
* expmed.c (extract_bit_field): Alignment is in bits, not bytes.
(extract_fixed_bit_field, extract_split_bit_field): Likewise.
* expr.c (move_by_pieces, move_by_pieces_ninsns): Likewise.
(emit_block_move, emit_group_load, emit_group_store): Likewise.
(clear_by_pieces, clear_storage, emit_push_insn): Likewise.
(expand_assigment, store_expr, store_constructor_field): Likewise.
(expand_expr_unaligned, do_jump, do_compare_and_jump): Likewise.
(store_constructor, store_field, get_inner_reference): Likewise.
Use host_integerp and tree_low_cst; sizes and positions HOST_WIDE_INT.
(expand_expr, case COMPONENT_REF): Likewise.
(copy_blkmode_from_regs): Use UNSIGNED_HOST_WIDE_INT for sizes
and positions; reindent code.
* expr.h (emit_cmp_insn, emit_cmp_and_jump_insns): Alignment unsigned.
* function.c (purge_addressof_1): Pass bit align to store_bit_field.
(assign_parms): Likewise to emit_group_store.
* optbas.c (prepare_cmp_insn): Alignment is in bits.
(emit_cmp_and_jump_insns, emit_cmp_insn): Likewise, and also unsigned.
* stmt.c (expand_value_return): Pass align in bits to emit_group_load.
(expand_return): Likewise to {extract,store}_bit_field.
* stor-layout.c (get_mode_alignment): Minor cleanup.
* config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Align is in bits.
* config/sh/sh.h (MOVE_BY_PIECES_P): Likewise.
* ch/expr.c (chill_expand_expr): Pass bit alignment to emit_block_move.
From-SVN: r32827
2000-03-30 13:47:08 +02:00
|
|
|
|
if (CONSTANT_P (x) && preserve_subexpressions_p ()
|
2000-09-15 04:56:02 +02:00
|
|
|
|
&& rtx_cost (x, COMPARE) > COSTS_N_INSNS (1))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
x = force_reg (mode, x);
|
|
|
|
|
|
builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst.
* builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst.
(expand_builtin_apply): Pass alignment to emit_block_move in bits.
(expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
(expand_builtin_memset): Likewise, but to clear_storage.
* calls.c (save_fixed_argument_area): Likewise, to move_by_pieces.
(restore_fixed_argument_area): Likewise.
(store_unaligned_arguments_into_pseudos): Likewise, to store_bit_field.
(load_register_parameters): Likewise, to emit_group_load.
(expand_call): Likewise, to emit_group_store and emit_block_move.
(emit_library_call_value_1): Likewise, to emit_block_move.
(store_one_arg): Likewise, and to emit_push_insn.
* expmed.c (extract_bit_field): Alignment is in bits, not bytes.
(extract_fixed_bit_field, extract_split_bit_field): Likewise.
* expr.c (move_by_pieces, move_by_pieces_ninsns): Likewise.
(emit_block_move, emit_group_load, emit_group_store): Likewise.
(clear_by_pieces, clear_storage, emit_push_insn): Likewise.
(expand_assigment, store_expr, store_constructor_field): Likewise.
(expand_expr_unaligned, do_jump, do_compare_and_jump): Likewise.
(store_constructor, store_field, get_inner_reference): Likewise.
Use host_integerp and tree_low_cst; sizes and positions HOST_WIDE_INT.
(expand_expr, case COMPONENT_REF): Likewise.
(copy_blkmode_from_regs): Use UNSIGNED_HOST_WIDE_INT for sizes
and positions; reindent code.
* expr.h (emit_cmp_insn, emit_cmp_and_jump_insns): Alignment unsigned.
* function.c (purge_addressof_1): Pass bit align to store_bit_field.
(assign_parms): Likewise to emit_group_store.
* optbas.c (prepare_cmp_insn): Alignment is in bits.
(emit_cmp_and_jump_insns, emit_cmp_insn): Likewise, and also unsigned.
* stmt.c (expand_value_return): Pass align in bits to emit_group_load.
(expand_return): Likewise to {extract,store}_bit_field.
* stor-layout.c (get_mode_alignment): Minor cleanup.
* config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Align is in bits.
* config/sh/sh.h (MOVE_BY_PIECES_P): Likewise.
* ch/expr.c (chill_expand_expr): Pass bit alignment to emit_block_move.
From-SVN: r32827
2000-03-30 13:47:08 +02:00
|
|
|
|
if (CONSTANT_P (y) && preserve_subexpressions_p ()
|
2000-09-15 04:56:02 +02:00
|
|
|
|
&& rtx_cost (y, COMPARE) > COSTS_N_INSNS (1))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
y = force_reg (mode, y);
|
|
|
|
|
|
1999-01-03 21:43:14 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
/* Abort if we have a non-canonical comparison. The RTL documentation
|
|
|
|
|
states that canonical comparisons are required only for targets which
|
|
|
|
|
have cc0. */
|
|
|
|
|
if (CONSTANT_P (x) && ! CONSTANT_P (y))
|
2002-11-16 07:08:16 +01:00
|
|
|
|
abort ();
|
1999-01-03 21:43:14 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Don't let both operands fail to indicate the mode. */
|
|
|
|
|
if (GET_MODE (x) == VOIDmode && GET_MODE (y) == VOIDmode)
|
|
|
|
|
x = force_reg (mode, x);
|
|
|
|
|
|
|
|
|
|
/* Handle all BLKmode compares. */
|
|
|
|
|
|
|
|
|
|
if (mode == BLKmode)
|
|
|
|
|
{
|
2003-10-07 09:25:32 +02:00
|
|
|
|
enum machine_mode cmp_mode, result_mode;
|
|
|
|
|
enum insn_code cmp_code;
|
|
|
|
|
tree length_type;
|
|
|
|
|
rtx libfunc;
|
1999-08-18 19:51:27 +02:00
|
|
|
|
rtx result;
|
2003-10-07 09:25:32 +02:00
|
|
|
|
rtx opalign
|
2001-11-16 14:22:59 +01:00
|
|
|
|
= GEN_INT (MIN (MEM_ALIGN (x), MEM_ALIGN (y)) / BITS_PER_UNIT);
|
1999-08-18 19:51:27 +02:00
|
|
|
|
|
2003-10-07 09:25:32 +02:00
|
|
|
|
if (size == 0)
|
|
|
|
|
abort ();
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
emit_queue ();
|
|
|
|
|
x = protect_from_queue (x, 0);
|
|
|
|
|
y = protect_from_queue (y, 0);
|
2003-10-07 09:25:32 +02:00
|
|
|
|
size = protect_from_queue (size, 0);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2003-10-07 09:25:32 +02:00
|
|
|
|
/* Try to use a memory block compare insn - either cmpstr
|
|
|
|
|
or cmpmem will do. */
|
|
|
|
|
for (cmp_mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
|
|
|
|
|
cmp_mode != VOIDmode;
|
|
|
|
|
cmp_mode = GET_MODE_WIDER_MODE (cmp_mode))
|
2003-07-11 23:04:56 +02:00
|
|
|
|
{
|
2003-10-07 09:25:32 +02:00
|
|
|
|
cmp_code = cmpmem_optab[cmp_mode];
|
|
|
|
|
if (cmp_code == CODE_FOR_nothing)
|
|
|
|
|
cmp_code = cmpstr_optab[cmp_mode];
|
|
|
|
|
if (cmp_code == CODE_FOR_nothing)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* Must make sure the size fits the insn's mode. */
|
|
|
|
|
if ((GET_CODE (size) == CONST_INT
|
|
|
|
|
&& INTVAL (size) >= (1 << GET_MODE_BITSIZE (cmp_mode)))
|
|
|
|
|
|| (GET_MODE_BITSIZE (GET_MODE (size))
|
|
|
|
|
> GET_MODE_BITSIZE (cmp_mode)))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
result_mode = insn_data[cmp_code].operand[0].mode;
|
2003-07-11 23:04:56 +02:00
|
|
|
|
result = gen_reg_rtx (result_mode);
|
2003-10-07 09:25:32 +02:00
|
|
|
|
size = convert_to_mode (cmp_mode, size, 1);
|
|
|
|
|
emit_insn (GEN_FCN (cmp_code) (result, x, y, size, opalign));
|
|
|
|
|
|
|
|
|
|
*px = result;
|
|
|
|
|
*py = const0_rtx;
|
|
|
|
|
*pmode = result_mode;
|
|
|
|
|
return;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
2003-10-07 09:25:32 +02:00
|
|
|
|
|
c-decl.c, [...]: Don't check TARGET_MEM_FUNCTIONS.
* c-decl.c, config/m32r/m32r.c, expr.c, optabs.c: Don't check
TARGET_MEM_FUNCTIONS.
* system.h: Poison TARGET_MEM_FUNCTIONS.
* libfuncs.h (LTI_bcopy, LTI_bcmp, LTI_bzero, bcopy_libfunc,
bcmp_libfunc, bzero_libfunc): Remove.
* optabs.c (init_obtabs): Don't set bcopy_libfunc, bcmp_libfunc or
bzero_libfunc.
* doc/tm.texi (TARGET_MEM_FUNCTIONS): Remove.
* doc/standards.texi: Don't mention calling BSD string functions.
* doc/invoke.texi: Likewise. Mention that memmove may be called.
* config/vax/t-memfuncs: New.
* config/memcmp.c, config/memcpy.c, config/memmove.c,
config/memset.c: New.
* config/pdp11/t-pdp11 (LIB2FUNCS_EXTRA): Use these files.
* config.gcc (vax-*-bsd*, vax-*-sysv*, vax-*-ultrix*): Use
vax/t-memfuncs.
* config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h,
config/avr/avr.h, config/c4x/c4x.h, config/cris/aout.h,
config/elfos.h, config/gnu.h, config/h8300/h8300.h,
config/i386/gas.h, config/ia64/ia64.h, config/interix.h,
config/ip2k/ip2k.h, config/lynx-ng.h, config/m32r/m32r.h,
config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h,
config/netbsd.h, config/openbsd.h, config/pa/pa.h,
config/rs6000/rs6000.h, config/rtems.h, config/s390/s390.h,
config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h,
config/svr3.h: Don't define TARGET_MEM_FUNCTIONS.
From-SVN: r84130
2004-07-05 21:49:20 +02:00
|
|
|
|
/* Otherwise call a library function, memcmp. */
|
2003-10-07 09:25:32 +02:00
|
|
|
|
libfunc = memcmp_libfunc;
|
|
|
|
|
length_type = sizetype;
|
|
|
|
|
result_mode = TYPE_MODE (integer_type_node);
|
|
|
|
|
cmp_mode = TYPE_MODE (length_type);
|
|
|
|
|
size = convert_to_mode (TYPE_MODE (length_type), size,
|
builtins.c, [...]: Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED.
* builtins.c, c-aux-info.c, c-common.c, c-cppbuiltin.c, c-decl.c:
Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED.
* c-format.c, c-opts.c, c-pretty-print.c, c-typeck.c: Likewise.
* calls.c, convert.c, dbxout.c, dojump.c, dwarf2out.c: Likewise.
* expmed.c, expr.c, fold-const.c, function.c, integrate.c: Likewise.
* optabs.c, sdbout.c, stmt.c, stor-layout.c, tree-dump.c: Likewise.
* tree.c, config/iq2000/iq2000.c, config/m32r/m32r.c: Likewise.
* config/mips/mips.c, config/rs6000/rs6000.c: Likewise.
* config/s390/s390.c, config/sparc/sparc.c, objc/objc-act.c: Likewise.
* stor-layout.c (layout_type, case COMPLEX_TYPE): Test for
REAL_TYPE, not INTEGER_TYPE.
(layout_type, case VECTOR_TYPE): Simplify code.
* tree.c (build_vector_type_for_mode): Remove dup unsigned setting.
* tree.h: Update comments.
(STRIP_NOPS): Use TYPE_UNSIGNED.
(TYPE_UNSIGNED): New macro.
(TYPE_TRAP_SIGNED): Remove now redundant check.
(SAVE_EXPR_NOPLACEHOLDER): Don't use TREE_UNSIGNED.
* cp/call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
* cp/class.c (check_bitfield_decl): Likewise.
* cp/cvt.c (type_promotes_to): Likewise.
* cp/decl.c (finish_enum): Likewise.
* cp/mangle.c (write_builtin_type): Likewise.
* cp/semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
* cp/typeck.c (type_after_usual_arithmetic_conversions): Likewise.
(build_binary_op): Likewise.
* f/com.c (ffecom_arrayref_): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
(ffecom_expr_): Likewise.
* java/jcf-write.c (generate_bytecode_insns): Use TYPE_UNSIGNED.
* treelang/treetree.c (tree_lang_signed_or_unsigned_type):
Use TYPE_UNSIGNED, not TREE_UNSIGNED.
* ada/decl.c (gnat_to_gnu_entity, make_type_from_size):
Use TYPE_UNSIGNED, not TREE_UNSIGNED.
* ada/trans.c (tree_transform, convert_with_check): Likewise.
* ada/utils.c (gnat_signed_or_unsigned_type): Likewise.
(build_vms_descriptor, unchecked_convert): Likewise.
* ada/utils2.c (nonbinary_modular_operation): Likewise.
From-SVN: r80287
2004-04-01 05:50:43 +02:00
|
|
|
|
TYPE_UNSIGNED (length_type));
|
2003-10-07 09:25:32 +02:00
|
|
|
|
|
|
|
|
|
result = emit_library_call_value (libfunc, 0, LCT_PURE_MAKE_BLOCK,
|
|
|
|
|
result_mode, 3,
|
|
|
|
|
XEXP (x, 0), Pmode,
|
|
|
|
|
XEXP (y, 0), Pmode,
|
|
|
|
|
size, cmp_mode);
|
1999-08-18 19:51:27 +02:00
|
|
|
|
*px = result;
|
|
|
|
|
*py = const0_rtx;
|
|
|
|
|
*pmode = result_mode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2004-03-03 01:46:06 +01:00
|
|
|
|
/* Don't allow operands to the compare to trap, as that can put the
|
|
|
|
|
compare and branch in different basic blocks. */
|
|
|
|
|
if (flag_non_call_exceptions)
|
|
|
|
|
{
|
|
|
|
|
if (may_trap_p (x))
|
|
|
|
|
x = force_reg (mode, x);
|
|
|
|
|
if (may_trap_p (y))
|
|
|
|
|
y = force_reg (mode, y);
|
|
|
|
|
}
|
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
*px = x;
|
|
|
|
|
*py = y;
|
2000-01-24 21:10:04 +01:00
|
|
|
|
if (can_compare_p (*pcomparison, mode, purpose))
|
1999-08-18 19:51:27 +02:00
|
|
|
|
return;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Handle a lib call just for the mode we are using. */
|
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
if (cmp_optab->handlers[(int) mode].libfunc && class != MODE_FLOAT)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
rtx libfunc = cmp_optab->handlers[(int) mode].libfunc;
|
1996-03-02 00:00:41 +01:00
|
|
|
|
rtx result;
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* If we want unsigned, and this mode has a distinct unsigned
|
|
|
|
|
comparison routine, use that. */
|
|
|
|
|
if (unsignedp && ucmp_optab->handlers[(int) mode].libfunc)
|
|
|
|
|
libfunc = ucmp_optab->handlers[(int) mode].libfunc;
|
|
|
|
|
|
2002-09-17 21:02:58 +02:00
|
|
|
|
result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST_MAKE_BLOCK,
|
|
|
|
|
word_mode, 2, x, mode, y, mode);
|
1996-03-02 00:00:41 +01:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Integer comparison returns a result that must be compared against 1,
|
|
|
|
|
so that even if we do an unsigned compare afterward,
|
|
|
|
|
there is still a value that can represent the result "less than". */
|
1999-08-18 19:51:27 +02:00
|
|
|
|
*px = result;
|
|
|
|
|
*py = const1_rtx;
|
|
|
|
|
*pmode = word_mode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (class == MODE_FLOAT)
|
1999-08-23 18:09:52 +02:00
|
|
|
|
prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
/* Before emitting an insn with code ICODE, make sure that X, which is going
|
|
|
|
|
to be used for operand OPNUM of the insn, is converted from mode MODE to
|
2001-10-09 08:03:16 +02:00
|
|
|
|
WIDER_MODE (UNSIGNEDP determines whether it is an unsigned conversion), and
|
1999-08-18 19:51:27 +02:00
|
|
|
|
that it is accepted by the operand predicate. Return the new value. */
|
2000-04-18 20:14:10 +02:00
|
|
|
|
|
1999-09-23 13:34:49 +02:00
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
prepare_operand (int icode, rtx x, int opnum, enum machine_mode mode,
|
|
|
|
|
enum machine_mode wider_mode, int unsignedp)
|
1999-08-18 19:51:27 +02:00
|
|
|
|
{
|
|
|
|
|
x = protect_from_queue (x, 0);
|
|
|
|
|
|
|
|
|
|
if (mode != wider_mode)
|
|
|
|
|
x = convert_modes (wider_mode, mode, x, unsignedp);
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[opnum].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[opnum].mode))
|
2003-07-19 02:28:05 +02:00
|
|
|
|
{
|
|
|
|
|
if (no_new_pseudos)
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
x = copy_to_mode_reg (insn_data[icode].operand[opnum].mode, x);
|
|
|
|
|
}
|
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Subroutine of emit_cmp_and_jump_insns; this function is called when we know
|
|
|
|
|
we can do the comparison.
|
|
|
|
|
The arguments are the same as for emit_cmp_and_jump_insns; but LABEL may
|
|
|
|
|
be NULL_RTX which indicates that only a comparison is to be generated. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode,
|
|
|
|
|
enum rtx_code comparison, int unsignedp, rtx label)
|
1999-08-18 19:51:27 +02:00
|
|
|
|
{
|
|
|
|
|
rtx test = gen_rtx_fmt_ee (comparison, mode, x, y);
|
|
|
|
|
enum mode_class class = GET_MODE_CLASS (mode);
|
|
|
|
|
enum machine_mode wider_mode = mode;
|
|
|
|
|
|
|
|
|
|
/* Try combined insns first. */
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
enum insn_code icode;
|
|
|
|
|
PUT_MODE (test, wider_mode);
|
|
|
|
|
|
1999-09-23 13:34:49 +02:00
|
|
|
|
if (label)
|
2003-07-06 11:56:09 +02:00
|
|
|
|
{
|
2002-11-16 07:08:16 +01:00
|
|
|
|
icode = cbranch_optab->handlers[(int) wider_mode].insn_code;
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1999-09-23 13:34:49 +02:00
|
|
|
|
if (icode != CODE_FOR_nothing
|
|
|
|
|
&& (*insn_data[icode].operand[0].predicate) (test, wider_mode))
|
|
|
|
|
{
|
|
|
|
|
x = prepare_operand (icode, x, 1, mode, wider_mode, unsignedp);
|
|
|
|
|
y = prepare_operand (icode, y, 2, mode, wider_mode, unsignedp);
|
|
|
|
|
emit_jump_insn (GEN_FCN (icode) (test, x, y, label));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
/* Handle some compares against zero. */
|
|
|
|
|
icode = (int) tst_optab->handlers[(int) wider_mode].insn_code;
|
|
|
|
|
if (y == CONST0_RTX (mode) && icode != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp);
|
|
|
|
|
emit_insn (GEN_FCN (icode) (x));
|
|
|
|
|
if (label)
|
|
|
|
|
emit_jump_insn ((*bcc_gen_fctn[(int) comparison]) (label));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Handle compares for which there is a directly suitable insn. */
|
|
|
|
|
|
|
|
|
|
icode = (int) cmp_optab->handlers[(int) wider_mode].insn_code;
|
|
|
|
|
if (icode != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp);
|
|
|
|
|
y = prepare_operand (icode, y, 1, mode, wider_mode, unsignedp);
|
|
|
|
|
emit_insn (GEN_FCN (icode) (x, y));
|
|
|
|
|
if (label)
|
|
|
|
|
emit_jump_insn ((*bcc_gen_fctn[(int) comparison]) (label));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (class != MODE_INT && class != MODE_FLOAT
|
|
|
|
|
&& class != MODE_COMPLEX_FLOAT)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
wider_mode = GET_MODE_WIDER_MODE (wider_mode);
|
2002-11-16 07:08:16 +01:00
|
|
|
|
}
|
|
|
|
|
while (wider_mode != VOIDmode);
|
1999-08-18 19:51:27 +02:00
|
|
|
|
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-03 21:43:14 +01:00
|
|
|
|
/* Generate code to compare X with Y so that the condition codes are
|
|
|
|
|
set and to jump to LABEL if the condition is true. If X is a
|
|
|
|
|
constant and Y is not a constant, then the comparison is swapped to
|
|
|
|
|
ensure that the comparison RTL has the canonical form.
|
|
|
|
|
|
1999-02-14 21:08:39 +01:00
|
|
|
|
UNSIGNEDP nonzero says that X and Y are unsigned; this matters if they
|
|
|
|
|
need to be widened by emit_cmp_insn. UNSIGNEDP is also used to select
|
|
|
|
|
the proper branch condition code.
|
1999-01-03 21:43:14 +01:00
|
|
|
|
|
2001-11-16 00:44:58 +01:00
|
|
|
|
If X and Y have mode BLKmode, then SIZE specifies the size of both X and Y.
|
1999-01-03 21:43:14 +01:00
|
|
|
|
|
1999-02-14 21:08:39 +01:00
|
|
|
|
MODE is the mode of the inputs (in case they are const_int).
|
|
|
|
|
|
|
|
|
|
COMPARISON is the rtl operator to compare with (EQ, NE, GT, etc.). It will
|
|
|
|
|
be passed unchanged to emit_cmp_insn, then potentially converted into an
|
|
|
|
|
unsigned variant based on UNSIGNEDP to select a proper jump instruction. */
|
1999-01-03 21:43:14 +01:00
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_cmp_and_jump_insns (rtx x, rtx y, enum rtx_code comparison, rtx size,
|
|
|
|
|
enum machine_mode mode, int unsignedp, rtx label)
|
1999-01-03 21:43:14 +01:00
|
|
|
|
{
|
2001-05-22 09:40:26 +02:00
|
|
|
|
rtx op0 = x, op1 = y;
|
|
|
|
|
|
|
|
|
|
/* Swap operands and condition to ensure canonical RTL. */
|
|
|
|
|
if (swap_commutative_operands_p (x, y))
|
1999-01-03 21:43:14 +01:00
|
|
|
|
{
|
2001-05-22 09:40:26 +02:00
|
|
|
|
/* If we're not emitting a branch, this means some caller
|
|
|
|
|
is out of sync. */
|
|
|
|
|
if (! label)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
op0 = y, op1 = x;
|
|
|
|
|
comparison = swap_condition (comparison);
|
1999-01-03 21:43:14 +01:00
|
|
|
|
}
|
1999-05-10 14:05:24 +02:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
/* If OP0 is still a constant, then both X and Y must be constants. Force
|
|
|
|
|
X into a register to avoid aborting in emit_cmp_insn due to non-canonical
|
|
|
|
|
RTL. */
|
|
|
|
|
if (CONSTANT_P (op0))
|
|
|
|
|
op0 = force_reg (mode, op0);
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
emit_queue ();
|
1999-02-14 21:08:39 +01:00
|
|
|
|
if (unsignedp)
|
|
|
|
|
comparison = unsigned_condition (comparison);
|
2001-11-16 00:44:58 +01:00
|
|
|
|
|
|
|
|
|
prepare_cmp_insn (&op0, &op1, &comparison, size, &mode, &unsignedp,
|
1999-09-23 13:34:49 +02:00
|
|
|
|
ccp_jump);
|
1999-08-18 19:51:27 +02:00
|
|
|
|
emit_cmp_and_jump_insn_1 (op0, op1, mode, comparison, unsignedp, label);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like emit_cmp_and_jump_insns, but generate only the comparison. */
|
builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst.
* builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst.
(expand_builtin_apply): Pass alignment to emit_block_move in bits.
(expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
(expand_builtin_memset): Likewise, but to clear_storage.
* calls.c (save_fixed_argument_area): Likewise, to move_by_pieces.
(restore_fixed_argument_area): Likewise.
(store_unaligned_arguments_into_pseudos): Likewise, to store_bit_field.
(load_register_parameters): Likewise, to emit_group_load.
(expand_call): Likewise, to emit_group_store and emit_block_move.
(emit_library_call_value_1): Likewise, to emit_block_move.
(store_one_arg): Likewise, and to emit_push_insn.
* expmed.c (extract_bit_field): Alignment is in bits, not bytes.
(extract_fixed_bit_field, extract_split_bit_field): Likewise.
* expr.c (move_by_pieces, move_by_pieces_ninsns): Likewise.
(emit_block_move, emit_group_load, emit_group_store): Likewise.
(clear_by_pieces, clear_storage, emit_push_insn): Likewise.
(expand_assigment, store_expr, store_constructor_field): Likewise.
(expand_expr_unaligned, do_jump, do_compare_and_jump): Likewise.
(store_constructor, store_field, get_inner_reference): Likewise.
Use host_integerp and tree_low_cst; sizes and positions HOST_WIDE_INT.
(expand_expr, case COMPONENT_REF): Likewise.
(copy_blkmode_from_regs): Use UNSIGNED_HOST_WIDE_INT for sizes
and positions; reindent code.
* expr.h (emit_cmp_insn, emit_cmp_and_jump_insns): Alignment unsigned.
* function.c (purge_addressof_1): Pass bit align to store_bit_field.
(assign_parms): Likewise to emit_group_store.
* optbas.c (prepare_cmp_insn): Alignment is in bits.
(emit_cmp_and_jump_insns, emit_cmp_insn): Likewise, and also unsigned.
* stmt.c (expand_value_return): Pass align in bits to emit_group_load.
(expand_return): Likewise to {extract,store}_bit_field.
* stor-layout.c (get_mode_alignment): Minor cleanup.
* config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Align is in bits.
* config/sh/sh.h (MOVE_BY_PIECES_P): Likewise.
* ch/expr.c (chill_expand_expr): Pass bit alignment to emit_block_move.
From-SVN: r32827
2000-03-30 13:47:08 +02:00
|
|
|
|
|
1999-08-18 19:51:27 +02:00
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size,
|
|
|
|
|
enum machine_mode mode, int unsignedp)
|
1999-08-18 19:51:27 +02:00
|
|
|
|
{
|
2001-11-16 00:44:58 +01:00
|
|
|
|
emit_cmp_and_jump_insns (x, y, comparison, size, mode, unsignedp, 0);
|
1999-01-03 21:43:14 +01:00
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Emit a library call comparison between floating point X and Y.
|
|
|
|
|
COMPARISON is the rtl operator to compare with (EQ, NE, GT, etc.). */
|
|
|
|
|
|
1999-08-23 18:09:52 +02:00
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison,
|
|
|
|
|
enum machine_mode *pmode, int *punsignedp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
1999-08-23 18:09:52 +02:00
|
|
|
|
enum rtx_code comparison = *pcomparison;
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
enum rtx_code swapped = swap_condition (comparison);
|
|
|
|
|
rtx x = protect_from_queue (*px, 0);
|
|
|
|
|
rtx y = protect_from_queue (*py, 0);
|
|
|
|
|
enum machine_mode orig_mode = GET_MODE (x);
|
|
|
|
|
enum machine_mode mode;
|
2003-10-07 01:09:28 +02:00
|
|
|
|
rtx value, target, insns, equiv;
|
1994-02-27 16:49:00 +01:00
|
|
|
|
rtx libfunc = 0;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
for (mode = orig_mode; mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
if ((libfunc = code_to_optab[comparison]->handlers[mode].libfunc))
|
|
|
|
|
break;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
if ((libfunc = code_to_optab[swapped]->handlers[mode].libfunc))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
rtx tmp;
|
|
|
|
|
tmp = x; x = y; y = tmp;
|
|
|
|
|
comparison = swapped;
|
|
|
|
|
break;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
if (mode == VOIDmode)
|
1994-02-27 16:49:00 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
if (mode != orig_mode)
|
|
|
|
|
{
|
|
|
|
|
x = convert_to_mode (mode, x, 0);
|
|
|
|
|
y = convert_to_mode (mode, y, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-09 14:57:30 +02:00
|
|
|
|
/* Attach a REG_EQUAL note describing the semantics of the libcall to
|
|
|
|
|
the RTL. The allows the RTL optimizers to delete the libcall if the
|
|
|
|
|
condition can be determined at compile-time. */
|
|
|
|
|
if (comparison == UNORDERED)
|
|
|
|
|
{
|
|
|
|
|
rtx temp = simplify_gen_relational (NE, word_mode, mode, x, x);
|
|
|
|
|
equiv = simplify_gen_relational (NE, word_mode, mode, y, y);
|
|
|
|
|
equiv = simplify_gen_ternary (IF_THEN_ELSE, word_mode, word_mode,
|
|
|
|
|
temp, const_true_rtx, equiv);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
equiv = simplify_gen_relational (comparison, word_mode, mode, x, y);
|
|
|
|
|
if (! FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison))
|
2003-10-06 14:48:49 +02:00
|
|
|
|
{
|
2003-10-09 14:57:30 +02:00
|
|
|
|
rtx true_rtx, false_rtx;
|
2003-10-07 01:09:28 +02:00
|
|
|
|
|
2003-10-09 14:57:30 +02:00
|
|
|
|
switch (comparison)
|
|
|
|
|
{
|
|
|
|
|
case EQ:
|
|
|
|
|
true_rtx = const0_rtx;
|
|
|
|
|
false_rtx = const_true_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NE:
|
|
|
|
|
true_rtx = const_true_rtx;
|
|
|
|
|
false_rtx = const0_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GT:
|
|
|
|
|
true_rtx = const1_rtx;
|
|
|
|
|
false_rtx = const0_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GE:
|
|
|
|
|
true_rtx = const0_rtx;
|
|
|
|
|
false_rtx = constm1_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LT:
|
|
|
|
|
true_rtx = constm1_rtx;
|
|
|
|
|
false_rtx = const0_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LE:
|
|
|
|
|
true_rtx = const0_rtx;
|
|
|
|
|
false_rtx = const1_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
2003-10-06 14:48:49 +02:00
|
|
|
|
}
|
2003-10-09 14:57:30 +02:00
|
|
|
|
equiv = simplify_gen_ternary (IF_THEN_ELSE, word_mode, word_mode,
|
|
|
|
|
equiv, true_rtx, false_rtx);
|
2003-10-06 14:48:49 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2003-10-07 01:09:28 +02:00
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
|
|
|
|
|
word_mode, 2, x, mode, y, mode);
|
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
|
|
|
|
target = gen_reg_rtx (word_mode);
|
|
|
|
|
emit_libcall_block (insns, target, value, equiv);
|
|
|
|
|
|
2003-10-06 14:48:49 +02:00
|
|
|
|
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
if (comparison == UNORDERED
|
|
|
|
|
|| FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison))
|
|
|
|
|
comparison = NE;
|
|
|
|
|
|
2003-10-07 01:09:28 +02:00
|
|
|
|
*px = target;
|
1999-08-18 19:51:27 +02:00
|
|
|
|
*py = const0_rtx;
|
|
|
|
|
*pmode = word_mode;
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
*pcomparison = comparison;
|
1999-08-18 19:51:27 +02:00
|
|
|
|
*punsignedp = 0;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate code to indirectly jump to a location given in the rtx LOC. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_indirect_jump (rtx loc)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2002-11-16 07:08:16 +01:00
|
|
|
|
if (! ((*insn_data[(int) CODE_FOR_indirect_jump].operand[0].predicate)
|
1993-01-25 20:54:36 +01:00
|
|
|
|
(loc, Pmode)))
|
|
|
|
|
loc = copy_to_mode_reg (Pmode, loc);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
emit_jump_insn (gen_indirect_jump (loc));
|
1992-05-25 21:54:20 +02:00
|
|
|
|
emit_barrier ();
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1995-01-25 05:18:30 +01:00
|
|
|
|
#ifdef HAVE_conditional_move
|
|
|
|
|
|
|
|
|
|
/* Emit a conditional move instruction if the machine supports one for that
|
|
|
|
|
condition and machine mode.
|
|
|
|
|
|
|
|
|
|
OP0 and OP1 are the operands that should be compared using CODE. CMODE is
|
|
|
|
|
the mode to use should they be constants. If it is VOIDmode, they cannot
|
|
|
|
|
both be constants.
|
|
|
|
|
|
|
|
|
|
OP2 should be stored in TARGET if the comparison is true, otherwise OP3
|
|
|
|
|
should be stored there. MODE is the mode to use should they be constants.
|
|
|
|
|
If it is VOIDmode, they cannot both be constants.
|
|
|
|
|
|
|
|
|
|
The result is either TARGET (perhaps modified) or NULL_RTX if the operation
|
|
|
|
|
is not supported. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
|
|
|
|
enum machine_mode cmode, rtx op2, rtx op3,
|
|
|
|
|
enum machine_mode mode, int unsignedp)
|
1995-01-25 05:18:30 +01:00
|
|
|
|
{
|
|
|
|
|
rtx tem, subtarget, comparison, insn;
|
|
|
|
|
enum insn_code icode;
|
2001-05-17 23:21:21 +02:00
|
|
|
|
enum rtx_code reversed;
|
1995-01-25 05:18:30 +01:00
|
|
|
|
|
|
|
|
|
/* If one operand is constant, make it the second one. Only do this
|
|
|
|
|
if the other operand is not constant as well. */
|
|
|
|
|
|
2001-05-17 23:21:21 +02:00
|
|
|
|
if (swap_commutative_operands_p (op0, op1))
|
1995-01-25 05:18:30 +01:00
|
|
|
|
{
|
|
|
|
|
tem = op0;
|
|
|
|
|
op0 = op1;
|
|
|
|
|
op1 = tem;
|
|
|
|
|
code = swap_condition (code);
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-07 07:49:18 +02:00
|
|
|
|
/* get_condition will prefer to generate LT and GT even if the old
|
|
|
|
|
comparison was against zero, so undo that canonicalization here since
|
|
|
|
|
comparisons against zero are cheaper. */
|
2003-07-22 02:36:52 +02:00
|
|
|
|
if (code == LT && op1 == const1_rtx)
|
1999-09-07 07:49:18 +02:00
|
|
|
|
code = LE, op1 = const0_rtx;
|
2003-07-22 02:36:52 +02:00
|
|
|
|
else if (code == GT && op1 == constm1_rtx)
|
1999-09-07 07:49:18 +02:00
|
|
|
|
code = GE, op1 = const0_rtx;
|
|
|
|
|
|
1995-01-25 05:18:30 +01:00
|
|
|
|
if (cmode == VOIDmode)
|
|
|
|
|
cmode = GET_MODE (op0);
|
|
|
|
|
|
2001-05-17 23:21:21 +02:00
|
|
|
|
if (swap_commutative_operands_p (op2, op3)
|
|
|
|
|
&& ((reversed = reversed_comparison_code_parts (code, op0, op1, NULL))
|
|
|
|
|
!= UNKNOWN))
|
1995-01-25 05:18:30 +01:00
|
|
|
|
{
|
|
|
|
|
tem = op2;
|
|
|
|
|
op2 = op3;
|
|
|
|
|
op3 = tem;
|
2001-05-17 23:21:21 +02:00
|
|
|
|
code = reversed;
|
1995-01-25 05:18:30 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mode == VOIDmode)
|
|
|
|
|
mode = GET_MODE (op2);
|
|
|
|
|
|
|
|
|
|
icode = movcc_gen_code[mode];
|
|
|
|
|
|
|
|
|
|
if (icode == CODE_FOR_nothing)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
{
|
|
|
|
|
op2 = force_not_mem (op2);
|
|
|
|
|
op3 = force_not_mem (op3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (target)
|
|
|
|
|
target = protect_from_queue (target, 1);
|
|
|
|
|
else
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
subtarget = target;
|
|
|
|
|
|
|
|
|
|
emit_queue ();
|
|
|
|
|
|
|
|
|
|
op2 = protect_from_queue (op2, 0);
|
|
|
|
|
op3 = protect_from_queue (op3, 0);
|
|
|
|
|
|
|
|
|
|
/* If the insn doesn't accept these operands, put them in pseudos. */
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[0].predicate)
|
|
|
|
|
(subtarget, insn_data[icode].operand[0].mode))
|
|
|
|
|
subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
|
1995-01-25 05:18:30 +01:00
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[2].predicate)
|
|
|
|
|
(op2, insn_data[icode].operand[2].mode))
|
|
|
|
|
op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
|
1995-01-25 05:18:30 +01:00
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! (*insn_data[icode].operand[3].predicate)
|
|
|
|
|
(op3, insn_data[icode].operand[3].mode))
|
|
|
|
|
op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
|
1995-01-25 05:18:30 +01:00
|
|
|
|
|
|
|
|
|
/* Everything should now be in the suitable form, so emit the compare insn
|
|
|
|
|
and then the conditional move. */
|
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
|
comparison
|
2001-11-16 00:44:58 +01:00
|
|
|
|
= compare_from_rtx (op0, op1, code, unsignedp, cmode, NULL_RTX);
|
1995-01-25 05:18:30 +01:00
|
|
|
|
|
|
|
|
|
/* ??? Watch for const0_rtx (nop) and const_true_rtx (unconditional)? */
|
2000-02-11 20:35:57 +01:00
|
|
|
|
/* We can get const0_rtx or const_true_rtx in some circumstances. Just
|
|
|
|
|
return NULL and let the caller figure out how best to deal with this
|
|
|
|
|
situation. */
|
1995-01-25 05:18:30 +01:00
|
|
|
|
if (GET_CODE (comparison) != code)
|
2000-02-11 20:35:57 +01:00
|
|
|
|
return NULL_RTX;
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1995-01-25 05:18:30 +01:00
|
|
|
|
insn = GEN_FCN (icode) (subtarget, comparison, op2, op3);
|
|
|
|
|
|
|
|
|
|
/* If that failed, then give up. */
|
|
|
|
|
if (insn == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
emit_insn (insn);
|
|
|
|
|
|
|
|
|
|
if (subtarget != target)
|
|
|
|
|
convert_move (target, subtarget, 0);
|
|
|
|
|
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-27 00:25:14 +02:00
|
|
|
|
/* Return nonzero if a conditional move of mode MODE is supported.
|
1995-01-25 05:18:30 +01:00
|
|
|
|
|
|
|
|
|
This function is for combine so it can tell whether an insn that looks
|
|
|
|
|
like a conditional move is actually supported by the hardware. If we
|
|
|
|
|
guess wrong we lose a bit on optimization, but that's it. */
|
|
|
|
|
/* ??? sparc64 supports conditionally moving integers values based on fp
|
|
|
|
|
comparisons, and vice versa. How do we handle them? */
|
|
|
|
|
|
|
|
|
|
int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
can_conditionally_move_p (enum machine_mode mode)
|
1995-01-25 05:18:30 +01:00
|
|
|
|
{
|
|
|
|
|
if (movcc_gen_code[mode] != CODE_FOR_nothing)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* HAVE_conditional_move */
|
2003-01-07 22:09:21 +01:00
|
|
|
|
|
|
|
|
|
/* Emit a conditional addition instruction if the machine supports one for that
|
|
|
|
|
condition and machine mode.
|
|
|
|
|
|
|
|
|
|
OP0 and OP1 are the operands that should be compared using CODE. CMODE is
|
|
|
|
|
the mode to use should they be constants. If it is VOIDmode, they cannot
|
|
|
|
|
both be constants.
|
|
|
|
|
|
|
|
|
|
OP2 should be stored in TARGET if the comparison is true, otherwise OP2+OP3
|
|
|
|
|
should be stored there. MODE is the mode to use should they be constants.
|
|
|
|
|
If it is VOIDmode, they cannot both be constants.
|
|
|
|
|
|
|
|
|
|
The result is either TARGET (perhaps modified) or NULL_RTX if the operation
|
|
|
|
|
is not supported. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
|
|
|
|
enum machine_mode cmode, rtx op2, rtx op3,
|
|
|
|
|
enum machine_mode mode, int unsignedp)
|
2003-01-07 22:09:21 +01:00
|
|
|
|
{
|
|
|
|
|
rtx tem, subtarget, comparison, insn;
|
|
|
|
|
enum insn_code icode;
|
|
|
|
|
enum rtx_code reversed;
|
|
|
|
|
|
|
|
|
|
/* If one operand is constant, make it the second one. Only do this
|
|
|
|
|
if the other operand is not constant as well. */
|
|
|
|
|
|
|
|
|
|
if (swap_commutative_operands_p (op0, op1))
|
|
|
|
|
{
|
|
|
|
|
tem = op0;
|
|
|
|
|
op0 = op1;
|
|
|
|
|
op1 = tem;
|
|
|
|
|
code = swap_condition (code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* get_condition will prefer to generate LT and GT even if the old
|
|
|
|
|
comparison was against zero, so undo that canonicalization here since
|
|
|
|
|
comparisons against zero are cheaper. */
|
2003-07-22 02:36:52 +02:00
|
|
|
|
if (code == LT && op1 == const1_rtx)
|
2003-01-07 22:09:21 +01:00
|
|
|
|
code = LE, op1 = const0_rtx;
|
2003-07-22 02:36:52 +02:00
|
|
|
|
else if (code == GT && op1 == constm1_rtx)
|
2003-01-07 22:09:21 +01:00
|
|
|
|
code = GE, op1 = const0_rtx;
|
|
|
|
|
|
|
|
|
|
if (cmode == VOIDmode)
|
|
|
|
|
cmode = GET_MODE (op0);
|
|
|
|
|
|
|
|
|
|
if (swap_commutative_operands_p (op2, op3)
|
|
|
|
|
&& ((reversed = reversed_comparison_code_parts (code, op0, op1, NULL))
|
|
|
|
|
!= UNKNOWN))
|
|
|
|
|
{
|
|
|
|
|
tem = op2;
|
|
|
|
|
op2 = op3;
|
|
|
|
|
op3 = tem;
|
|
|
|
|
code = reversed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mode == VOIDmode)
|
|
|
|
|
mode = GET_MODE (op2);
|
|
|
|
|
|
|
|
|
|
icode = addcc_optab->handlers[(int) mode].insn_code;
|
|
|
|
|
|
|
|
|
|
if (icode == CODE_FOR_nothing)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
{
|
|
|
|
|
op2 = force_not_mem (op2);
|
|
|
|
|
op3 = force_not_mem (op3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (target)
|
|
|
|
|
target = protect_from_queue (target, 1);
|
|
|
|
|
else
|
|
|
|
|
target = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
subtarget = target;
|
|
|
|
|
|
|
|
|
|
emit_queue ();
|
|
|
|
|
|
|
|
|
|
op2 = protect_from_queue (op2, 0);
|
|
|
|
|
op3 = protect_from_queue (op3, 0);
|
|
|
|
|
|
|
|
|
|
/* If the insn doesn't accept these operands, put them in pseudos. */
|
|
|
|
|
|
|
|
|
|
if (! (*insn_data[icode].operand[0].predicate)
|
|
|
|
|
(subtarget, insn_data[icode].operand[0].mode))
|
|
|
|
|
subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
|
|
|
|
|
|
|
|
|
|
if (! (*insn_data[icode].operand[2].predicate)
|
|
|
|
|
(op2, insn_data[icode].operand[2].mode))
|
|
|
|
|
op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
|
|
|
|
|
|
|
|
|
|
if (! (*insn_data[icode].operand[3].predicate)
|
|
|
|
|
(op3, insn_data[icode].operand[3].mode))
|
|
|
|
|
op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
|
|
|
|
|
|
|
|
|
|
/* Everything should now be in the suitable form, so emit the compare insn
|
|
|
|
|
and then the conditional move. */
|
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
|
comparison
|
2003-01-07 22:09:21 +01:00
|
|
|
|
= compare_from_rtx (op0, op1, code, unsignedp, cmode, NULL_RTX);
|
|
|
|
|
|
|
|
|
|
/* ??? Watch for const0_rtx (nop) and const_true_rtx (unconditional)? */
|
|
|
|
|
/* We can get const0_rtx or const_true_rtx in some circumstances. Just
|
|
|
|
|
return NULL and let the caller figure out how best to deal with this
|
|
|
|
|
situation. */
|
|
|
|
|
if (GET_CODE (comparison) != code)
|
|
|
|
|
return NULL_RTX;
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
2003-01-07 22:09:21 +01:00
|
|
|
|
insn = GEN_FCN (icode) (subtarget, comparison, op2, op3);
|
|
|
|
|
|
|
|
|
|
/* If that failed, then give up. */
|
|
|
|
|
if (insn == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
emit_insn (insn);
|
|
|
|
|
|
|
|
|
|
if (subtarget != target)
|
|
|
|
|
convert_move (target, subtarget, 0);
|
|
|
|
|
|
|
|
|
|
return target;
|
|
|
|
|
}
|
1995-01-25 05:18:30 +01:00
|
|
|
|
|
2003-04-09 19:50:08 +02:00
|
|
|
|
/* These functions attempt to generate an insn body, rather than
|
|
|
|
|
emitting the insn, but if the gen function already emits them, we
|
|
|
|
|
make no attempt to turn them back into naked patterns.
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
They do not protect from queued increments,
|
|
|
|
|
because they may be used 1) in protect_from_queue itself
|
|
|
|
|
and 2) in other passes where there is no queue. */
|
|
|
|
|
|
|
|
|
|
/* Generate and return an insn body to add Y to X. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
gen_add2_insn (rtx x, rtx y)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2003-07-06 11:56:09 +02:00
|
|
|
|
int icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! ((*insn_data[icode].operand[0].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[0].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[1].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[1].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[2].predicate)
|
|
|
|
|
(y, insn_data[icode].operand[2].mode)))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
return (GEN_FCN (icode) (x, x, y));
|
|
|
|
|
}
|
|
|
|
|
|
expr.h: Split out optab- and libfunc-related code to...
* expr.h: Split out optab- and libfunc-related code to...
* optabs.h, libfuncs.h: ... these new headers.
* Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h.
(OPTABS_H): New.
(various .o rules): Add $(OPTABS_H) and/or libfuncs.h to
dependencies.
* mkconfig.sh: Don't include insn-codes.h from config.h.
* reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether
enum insn_code is available. Move reload_in_optab and
reload_out_optab array declarations to optabs.h.
* regmove.c (gen_add3_insn): Move to optabs.c, export from
there, prototype in expr.h.
* gencodes.c: Cleanup: zap global variables, don't use
printf where puts will do, don't bother defining MAX_INSN_CODE
which nothing uses, let CODE_FOR_nothing get its value implicitly.
* genemit.c, genopinit.c: Include optabs.h in generated file.
* genoutput.c: Include insn-codes.h in generated file.
* builtins.c, caller-save.c, combine.c, doloop.c, explow.c,
expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c,
reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c,
config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c,
config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c:
Include optabs.h.
* builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c,
optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/m88k/m88k.c, config/sparc/sparc.c:
Include libfuncs.h.
* reload.c: Include expr.h and optabs.h before reload.h.
* config/alpha/alpha.c: Include tree.h before reload.h.
* config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h,
and reload.h in that order.
* config/sparc/sparc.c: Include debug.h.
* recog.c: Include insn-codes.h.
cp:
* Make-lang.in (cp/except.o): Add libfuncs.h to dependencies.
* except.c: Include libfuncs.h.
java:
* Make-lang.in (java/decl.o): Update dependencies.
* decl.c: Include libfuncs.h, don't include toplev.h.
From-SVN: r44858
2001-08-13 17:56:51 +02:00
|
|
|
|
/* Generate and return an insn body to add r1 and c,
|
|
|
|
|
storing the result in r0. */
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
gen_add3_insn (rtx r0, rtx r1, rtx c)
|
expr.h: Split out optab- and libfunc-related code to...
* expr.h: Split out optab- and libfunc-related code to...
* optabs.h, libfuncs.h: ... these new headers.
* Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h.
(OPTABS_H): New.
(various .o rules): Add $(OPTABS_H) and/or libfuncs.h to
dependencies.
* mkconfig.sh: Don't include insn-codes.h from config.h.
* reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether
enum insn_code is available. Move reload_in_optab and
reload_out_optab array declarations to optabs.h.
* regmove.c (gen_add3_insn): Move to optabs.c, export from
there, prototype in expr.h.
* gencodes.c: Cleanup: zap global variables, don't use
printf where puts will do, don't bother defining MAX_INSN_CODE
which nothing uses, let CODE_FOR_nothing get its value implicitly.
* genemit.c, genopinit.c: Include optabs.h in generated file.
* genoutput.c: Include insn-codes.h in generated file.
* builtins.c, caller-save.c, combine.c, doloop.c, explow.c,
expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c,
reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c,
config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c,
config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c:
Include optabs.h.
* builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c,
optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/m88k/m88k.c, config/sparc/sparc.c:
Include libfuncs.h.
* reload.c: Include expr.h and optabs.h before reload.h.
* config/alpha/alpha.c: Include tree.h before reload.h.
* config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h,
and reload.h in that order.
* config/sparc/sparc.c: Include debug.h.
* recog.c: Include insn-codes.h.
cp:
* Make-lang.in (cp/except.o): Add libfuncs.h to dependencies.
* except.c: Include libfuncs.h.
java:
* Make-lang.in (java/decl.o): Update dependencies.
* decl.c: Include libfuncs.h, don't include toplev.h.
From-SVN: r44858
2001-08-13 17:56:51 +02:00
|
|
|
|
{
|
|
|
|
|
int icode = (int) add_optab->handlers[(int) GET_MODE (r0)].insn_code;
|
|
|
|
|
|
2002-11-16 07:08:16 +01:00
|
|
|
|
if (icode == CODE_FOR_nothing
|
expr.h: Split out optab- and libfunc-related code to...
* expr.h: Split out optab- and libfunc-related code to...
* optabs.h, libfuncs.h: ... these new headers.
* Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h.
(OPTABS_H): New.
(various .o rules): Add $(OPTABS_H) and/or libfuncs.h to
dependencies.
* mkconfig.sh: Don't include insn-codes.h from config.h.
* reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether
enum insn_code is available. Move reload_in_optab and
reload_out_optab array declarations to optabs.h.
* regmove.c (gen_add3_insn): Move to optabs.c, export from
there, prototype in expr.h.
* gencodes.c: Cleanup: zap global variables, don't use
printf where puts will do, don't bother defining MAX_INSN_CODE
which nothing uses, let CODE_FOR_nothing get its value implicitly.
* genemit.c, genopinit.c: Include optabs.h in generated file.
* genoutput.c: Include insn-codes.h in generated file.
* builtins.c, caller-save.c, combine.c, doloop.c, explow.c,
expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c,
reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c,
config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c,
config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c:
Include optabs.h.
* builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c,
optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/m88k/m88k.c, config/sparc/sparc.c:
Include libfuncs.h.
* reload.c: Include expr.h and optabs.h before reload.h.
* config/alpha/alpha.c: Include tree.h before reload.h.
* config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h,
and reload.h in that order.
* config/sparc/sparc.c: Include debug.h.
* recog.c: Include insn-codes.h.
cp:
* Make-lang.in (cp/except.o): Add libfuncs.h to dependencies.
* except.c: Include libfuncs.h.
java:
* Make-lang.in (java/decl.o): Update dependencies.
* decl.c: Include libfuncs.h, don't include toplev.h.
From-SVN: r44858
2001-08-13 17:56:51 +02:00
|
|
|
|
|| ! ((*insn_data[icode].operand[0].predicate)
|
|
|
|
|
(r0, insn_data[icode].operand[0].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[1].predicate)
|
|
|
|
|
(r1, insn_data[icode].operand[1].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[2].predicate)
|
|
|
|
|
(c, insn_data[icode].operand[2].mode)))
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
|
|
|
|
|
return (GEN_FCN (icode) (r0, r1, c));
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
have_add2_insn (rtx x, rtx y)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2001-07-09 22:21:48 +02:00
|
|
|
|
int icode;
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (x) == VOIDmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
|
icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
|
2001-07-09 22:21:48 +02:00
|
|
|
|
|
|
|
|
|
if (icode == CODE_FOR_nothing)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (! ((*insn_data[icode].operand[0].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[0].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[1].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[1].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[2].predicate)
|
|
|
|
|
(y, insn_data[icode].operand[2].mode)))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return 1;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate and return an insn body to subtract Y from X. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
gen_sub2_insn (rtx x, rtx y)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2003-07-06 11:56:09 +02:00
|
|
|
|
int icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
if (! ((*insn_data[icode].operand[0].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[0].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[1].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[1].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[2].predicate)
|
|
|
|
|
(y, insn_data[icode].operand[2].mode)))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
return (GEN_FCN (icode) (x, x, y));
|
|
|
|
|
}
|
|
|
|
|
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
/* Generate and return an insn body to subtract r1 and c,
|
|
|
|
|
storing the result in r0. */
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
gen_sub3_insn (rtx r0, rtx r1, rtx c)
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
{
|
|
|
|
|
int icode = (int) sub_optab->handlers[(int) GET_MODE (r0)].insn_code;
|
|
|
|
|
|
2002-11-16 07:08:16 +01:00
|
|
|
|
if (icode == CODE_FOR_nothing
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
|| ! ((*insn_data[icode].operand[0].predicate)
|
|
|
|
|
(r0, insn_data[icode].operand[0].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[1].predicate)
|
|
|
|
|
(r1, insn_data[icode].operand[1].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[2].predicate)
|
|
|
|
|
(c, insn_data[icode].operand[2].mode)))
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
|
|
|
|
|
return (GEN_FCN (icode) (r0, r1, c));
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
have_sub2_insn (rtx x, rtx y)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
2001-07-09 22:21:48 +02:00
|
|
|
|
int icode;
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (x) == VOIDmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
|
icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
|
2001-07-09 22:21:48 +02:00
|
|
|
|
|
|
|
|
|
if (icode == CODE_FOR_nothing)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (! ((*insn_data[icode].operand[0].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[0].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[1].predicate)
|
|
|
|
|
(x, insn_data[icode].operand[1].mode))
|
|
|
|
|
|| ! ((*insn_data[icode].operand[2].predicate)
|
|
|
|
|
(y, insn_data[icode].operand[2].mode)))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return 1;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1993-02-21 07:51:56 +01:00
|
|
|
|
/* Generate the body of an instruction to copy Y into X.
|
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
|
|
|
|
It may be a list of insns, if one insn isn't enough. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
gen_move_insn (rtx x, rtx y)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
1993-02-21 07:51:56 +01:00
|
|
|
|
rtx seq;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1993-02-21 07:51:56 +01:00
|
|
|
|
start_sequence ();
|
|
|
|
|
emit_move_insn_1 (x, y);
|
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
|
|
|
|
seq = get_insns ();
|
1993-02-21 07:51:56 +01:00
|
|
|
|
end_sequence ();
|
|
|
|
|
return seq;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1992-01-18 00:19:29 +01:00
|
|
|
|
/* Return the insn code used to extend FROM_MODE to TO_MODE.
|
|
|
|
|
UNSIGNEDP specifies zero-extension instead of sign-extension. If
|
|
|
|
|
no such operation exists, CODE_FOR_nothing will be returned. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1992-01-18 00:19:29 +01:00
|
|
|
|
enum insn_code
|
2003-07-06 11:56:09 +02:00
|
|
|
|
can_extend_p (enum machine_mode to_mode, enum machine_mode from_mode,
|
|
|
|
|
int unsignedp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
convert_optab tab;
|
* tm.texi (POINTERS_EXTEND_UNSIGNED) Modify definition.
* optabs.c (can_extend_p) Check HAVE_ptr_extend for a specialized
pointer extension instruction.
* combine.c (nonzero_bits,num_sign_bit_copies) Likewise.
* simplify-rtx.c (simplify_unary_operation) Likewise.
* explow.c (convert_memory_address) Check value of
POINTERS_EXTEND_UNSIGNED to avoid some conversions when
less than zero.
* config/ia64/t-hpux (LIBGCC, INSTALL_LIBGCC, MULTILIB_OPTIONS,
MULTILIB_DIRNAMES, MULTILIB_MATCHES) Add multilib support.
* config/ia64/hpux.h (CPP_SPEC, ASM_SPEC, SUBTARGET_SWITCHES)
Add Multilib Support.
(POINTERS_EXTEND_UNSIGNED) Define for ILP32 support.
* config/ia64/ia64.h (MASK_ILP32, TARGET_ILP32, SUBTARGET_SWITCHES)
Add Multilib Support.
(POINTER_SIZE, LONG_TYPE_SIZE, MAX_LONG_TYPE_SIZE) Modify for ILP32
support.
* config/ia64/ia64.c (rtx_needs_barrier) Add support for addp4.
* config/ia64/ia64.md (ptr_extend) New instruction to "swizzle"
a 32 bit HP-UX pointer into a 64 bit HP-UX pointer.
From-SVN: r44166
2001-07-20 01:26:51 +02:00
|
|
|
|
#ifdef HAVE_ptr_extend
|
|
|
|
|
if (unsignedp < 0)
|
|
|
|
|
return CODE_FOR_ptr_extend;
|
|
|
|
|
#endif
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
|
|
|
|
|
tab = unsignedp ? zext_optab : sext_optab;
|
|
|
|
|
return tab->handlers[to_mode][from_mode].insn_code;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate the body of an insn to extend Y (with mode MFROM)
|
|
|
|
|
into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
gen_extend_insn (rtx x, rtx y, enum machine_mode mto,
|
|
|
|
|
enum machine_mode mfrom, int unsignedp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
enum insn_code icode = can_extend_p (mto, mfrom, unsignedp);
|
|
|
|
|
return GEN_FCN (icode) (x, y);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* can_fix_p and can_float_p say whether the target machine
|
|
|
|
|
can directly convert a given fixed point type to
|
|
|
|
|
a given floating point type, or vice versa.
|
|
|
|
|
The returned value is the CODE_FOR_... value to use,
|
1993-03-30 22:29:35 +02:00
|
|
|
|
or CODE_FOR_nothing if these modes cannot be directly converted.
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1993-03-30 22:29:35 +02:00
|
|
|
|
*TRUNCP_PTR is set to 1 if it is necessary to output
|
1991-12-30 04:19:53 +01:00
|
|
|
|
an explicit FTRUNC insn before the fix insn; otherwise 0. */
|
|
|
|
|
|
|
|
|
|
static enum insn_code
|
2003-07-06 11:56:09 +02:00
|
|
|
|
can_fix_p (enum machine_mode fixmode, enum machine_mode fltmode,
|
|
|
|
|
int unsignedp, int *truncp_ptr)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
convert_optab tab;
|
|
|
|
|
enum insn_code icode;
|
|
|
|
|
|
|
|
|
|
tab = unsignedp ? ufixtrunc_optab : sfixtrunc_optab;
|
|
|
|
|
icode = tab->handlers[fixmode][fltmode].insn_code;
|
|
|
|
|
if (icode != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
*truncp_ptr = 0;
|
|
|
|
|
return icode;
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2004-02-19 19:50:57 +01:00
|
|
|
|
/* FIXME: This requires a port to define both FIX and FTRUNC pattern
|
|
|
|
|
for this to work. We need to rework the fix* and ftrunc* patterns
|
|
|
|
|
and documentation. */
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
tab = unsignedp ? ufix_optab : sfix_optab;
|
|
|
|
|
icode = tab->handlers[fixmode][fltmode].insn_code;
|
|
|
|
|
if (icode != CODE_FOR_nothing
|
|
|
|
|
&& ftrunc_optab->handlers[fltmode].insn_code != CODE_FOR_nothing)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
*truncp_ptr = 1;
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
return icode;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
|
|
|
|
|
*truncp_ptr = 0;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return CODE_FOR_nothing;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static enum insn_code
|
2003-07-06 11:56:09 +02:00
|
|
|
|
can_float_p (enum machine_mode fltmode, enum machine_mode fixmode,
|
|
|
|
|
int unsignedp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
convert_optab tab;
|
|
|
|
|
|
|
|
|
|
tab = unsignedp ? ufloat_optab : sfloat_optab;
|
|
|
|
|
return tab->handlers[fltmode][fixmode].insn_code;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate code to convert FROM to floating point
|
1992-01-18 00:19:29 +01:00
|
|
|
|
and store in TO. FROM must be fixed point and not VOIDmode.
|
1991-12-30 04:19:53 +01:00
|
|
|
|
UNSIGNEDP nonzero means regard FROM as unsigned.
|
|
|
|
|
Normally this is done by correcting the final value
|
|
|
|
|
if it is negative. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_float (rtx to, rtx from, int unsignedp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
enum insn_code icode;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx target = to;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
enum machine_mode fmode, imode;
|
|
|
|
|
|
1992-01-18 00:19:29 +01:00
|
|
|
|
/* Crash now, because we won't be able to decide which mode to use. */
|
|
|
|
|
if (GET_MODE (from) == VOIDmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Look for an insn to do the conversion. Do it in the specified
|
|
|
|
|
modes if possible; otherwise convert either input, output or both to
|
|
|
|
|
wider mode. If the integer mode is wider than the mode of FROM,
|
|
|
|
|
we can do the conversion signed even if the input is unsigned. */
|
|
|
|
|
|
2003-02-07 20:38:04 +01:00
|
|
|
|
for (fmode = GET_MODE (to); fmode != VOIDmode;
|
|
|
|
|
fmode = GET_MODE_WIDER_MODE (fmode))
|
|
|
|
|
for (imode = GET_MODE (from); imode != VOIDmode;
|
|
|
|
|
imode = GET_MODE_WIDER_MODE (imode))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
int doing_unsigned = unsignedp;
|
|
|
|
|
|
2000-05-14 23:18:13 +02:00
|
|
|
|
if (fmode != GET_MODE (to)
|
|
|
|
|
&& significand_size (fmode) < GET_MODE_BITSIZE (GET_MODE (from)))
|
|
|
|
|
continue;
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
icode = can_float_p (fmode, imode, unsignedp);
|
|
|
|
|
if (icode == CODE_FOR_nothing && imode != GET_MODE (from) && unsignedp)
|
|
|
|
|
icode = can_float_p (fmode, imode, 0), doing_unsigned = 0;
|
|
|
|
|
|
|
|
|
|
if (icode != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
to = protect_from_queue (to, 1);
|
1992-07-17 06:23:56 +02:00
|
|
|
|
from = protect_from_queue (from, 0);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
if (imode != GET_MODE (from))
|
|
|
|
|
from = convert_to_mode (imode, from, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (fmode != GET_MODE (to))
|
|
|
|
|
target = gen_reg_rtx (fmode);
|
|
|
|
|
|
|
|
|
|
emit_unop_insn (icode, target, from,
|
|
|
|
|
doing_unsigned ? UNSIGNED_FLOAT : FLOAT);
|
|
|
|
|
|
|
|
|
|
if (target != to)
|
|
|
|
|
convert_move (to, target, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2002-11-16 07:08:16 +01:00
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Unsigned integer, and no way to convert directly.
|
|
|
|
|
Convert as signed, then conditionally adjust the result. */
|
|
|
|
|
if (unsignedp)
|
|
|
|
|
{
|
|
|
|
|
rtx label = gen_label_rtx ();
|
|
|
|
|
rtx temp;
|
|
|
|
|
REAL_VALUE_TYPE offset;
|
|
|
|
|
|
|
|
|
|
emit_queue ();
|
|
|
|
|
|
|
|
|
|
to = protect_from_queue (to, 1);
|
|
|
|
|
from = protect_from_queue (from, 0);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
from = force_not_mem (from);
|
|
|
|
|
|
1993-03-18 22:28:43 +01:00
|
|
|
|
/* Look for a usable floating mode FMODE wider than the source and at
|
|
|
|
|
least as wide as the target. Using FMODE will avoid rounding woes
|
|
|
|
|
with unsigned values greater than the signed maximum value. */
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
1993-03-18 22:28:43 +01:00
|
|
|
|
for (fmode = GET_MODE (to); fmode != VOIDmode;
|
|
|
|
|
fmode = GET_MODE_WIDER_MODE (fmode))
|
|
|
|
|
if (GET_MODE_BITSIZE (GET_MODE (from)) < GET_MODE_BITSIZE (fmode)
|
|
|
|
|
&& can_float_p (fmode, GET_MODE (from), 0) != CODE_FOR_nothing)
|
|
|
|
|
break;
|
1994-05-30 16:33:41 +02:00
|
|
|
|
|
1993-03-18 22:28:43 +01:00
|
|
|
|
if (fmode == VOIDmode)
|
|
|
|
|
{
|
1994-05-30 16:33:41 +02:00
|
|
|
|
/* There is no such mode. Pretend the target is wide enough. */
|
1993-03-18 22:28:43 +01:00
|
|
|
|
fmode = GET_MODE (to);
|
1994-05-30 16:33:41 +02:00
|
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
|
/* Avoid double-rounding when TO is narrower than FROM. */
|
1994-05-30 16:33:41 +02:00
|
|
|
|
if ((significand_size (fmode) + 1)
|
|
|
|
|
< GET_MODE_BITSIZE (GET_MODE (from)))
|
|
|
|
|
{
|
|
|
|
|
rtx temp1;
|
|
|
|
|
rtx neglabel = gen_label_rtx ();
|
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
|
/* Don't use TARGET if it isn't a register, is a hard register,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
or is the wrong mode. */
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
if (!REG_P (target)
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|| REGNO (target) < FIRST_PSEUDO_REGISTER
|
|
|
|
|
|| GET_MODE (target) != fmode)
|
1994-05-30 18:38:00 +02:00
|
|
|
|
target = gen_reg_rtx (fmode);
|
|
|
|
|
|
1994-05-30 16:33:41 +02:00
|
|
|
|
imode = GET_MODE (from);
|
|
|
|
|
do_pending_stack_adjust ();
|
|
|
|
|
|
|
|
|
|
/* Test whether the sign bit is set. */
|
1999-09-23 13:34:49 +02:00
|
|
|
|
emit_cmp_and_jump_insns (from, const0_rtx, LT, NULL_RTX, imode,
|
2001-11-16 00:44:58 +01:00
|
|
|
|
0, neglabel);
|
1994-05-30 16:33:41 +02:00
|
|
|
|
|
|
|
|
|
/* The sign bit is not set. Convert as signed. */
|
|
|
|
|
expand_float (target, from, 0);
|
|
|
|
|
emit_jump_insn (gen_jump (label));
|
1995-10-21 23:17:23 +01:00
|
|
|
|
emit_barrier ();
|
1994-05-30 16:33:41 +02:00
|
|
|
|
|
|
|
|
|
/* The sign bit is set.
|
|
|
|
|
Convert to a usable (positive signed) value by shifting right
|
|
|
|
|
one bit, while remembering if a nonzero bit was shifted
|
|
|
|
|
out; i.e., compute (from & 1) | (from >> 1). */
|
|
|
|
|
|
|
|
|
|
emit_label (neglabel);
|
|
|
|
|
temp = expand_binop (imode, and_optab, from, const1_rtx,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
NULL_RTX, 1, OPTAB_LIB_WIDEN);
|
1994-06-18 16:21:32 +02:00
|
|
|
|
temp1 = expand_shift (RSHIFT_EXPR, imode, from, integer_one_node,
|
|
|
|
|
NULL_RTX, 1);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
temp = expand_binop (imode, ior_optab, temp, temp1, temp, 1,
|
1994-06-23 00:15:30 +02:00
|
|
|
|
OPTAB_LIB_WIDEN);
|
1994-05-30 16:33:41 +02:00
|
|
|
|
expand_float (target, temp, 0);
|
|
|
|
|
|
|
|
|
|
/* Multiply by 2 to undo the shift above. */
|
1994-10-10 23:46:30 +01:00
|
|
|
|
temp = expand_binop (fmode, add_optab, target, target,
|
2002-11-16 07:08:16 +01:00
|
|
|
|
target, 0, OPTAB_LIB_WIDEN);
|
1994-10-10 23:46:30 +01:00
|
|
|
|
if (temp != target)
|
|
|
|
|
emit_move_insn (target, temp);
|
|
|
|
|
|
1994-05-30 16:33:41 +02:00
|
|
|
|
do_pending_stack_adjust ();
|
|
|
|
|
emit_label (label);
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
1993-03-18 22:28:43 +01:00
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* If we are about to do some arithmetic to correct for an
|
|
|
|
|
unsigned operand, do it in a pseudo-register. */
|
|
|
|
|
|
1993-03-18 22:28:43 +01:00
|
|
|
|
if (GET_MODE (to) != fmode
|
alias.c (record_set, [...]): Use REG_P.
2004-06-15 Jerry Quinn <jlquinn@optonline.net>
* alias.c (record_set, record_base_value, canon_rtx, get_addr,
nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
Likewise.
* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
expand_builtin_strcmp, expand_builtin_strncmp,
expand_builtin_frame_address): Likewise.
* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
insert_one_insn): Likewise.
* calls.c (prepare_call_address, precompute_register_parameters,
precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (flow_active_insn_p): Likewise.
* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
make_extraction, recog_for_combine, gen_lowpart_for_combine,
simplify_comparison, record_dead_and_set_regs_1,
record_dead_and_set_regs, record_promoted_value,
check_promoted_subreg, get_last_value_validate, get_last_value,
reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
unmentioned_reg_p_1): Likewise.
* conflict.c (mark_reg): Likewise.
* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
mention_regs, insert_regs, lookup, lookup_for_remove, insert,
merge_equiv_classes, flush_hash_table, invalidate,
remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
record_jump_cond, cse_insn, addr_affects_sp_p,
invalidate_from_clobbers, cse_process_notes, cse_around_loop,
cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
cselib_record_set, cselib_record_sets): Likewise.
* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
dbxout_block): Likewise.
* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
* dojump.c (do_jump): Likewise.
* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
is_based_loc, rtl_for_decl_location): Likewise.
* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
set_decl_incoming_rtl, mark_user_reg): Likewise.
* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
copy_to_suggested_reg, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (store_bit_field, store_fixed_bit_field,
store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
extract_split_bit_field, expand_divmod, emit_store_flag_force):
Likewise.
* expr.c (convert_move, convert_modes,
block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
use_group_regs, emit_move_insn, emit_move_insn_1,
compress_float_constant, push_block, emit_single_push_insn,
emit_push_insn, get_subtarget, expand_assignment, store_expr,
store_constructor, store_field, force_operand, safe_from_p,
expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
Likewise.
* final.c (profile_function, final_scan_insn, alter_subreg,
get_mem_expr_from_op, output_asm_operand_names, output_operand,
only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
find_regno_partial, propagate_one_insn, init_propagate_block_info,
insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
attempt_auto_inc, find_auto_inc, mark_used_regs,
count_or_remove_death_notes_bb): Likewise.
* function.c (find_temp_slot_from_address, update_temp_slot_address,
preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
purge_single_hard_subreg_set, instantiate_decl,
instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
expand_function_start, diddle_return_value, clobber_return_register,
expand_function_end, keep_stack_depressed, handle_epilogue_set,
update_epilogue_consts): Likewise.
* genemit.c (gen_exp, gen_insn): Likewise.
* genrecog.c (make_insn_sequence): Likewise.
* global.c (global_conflicts, expand_preferences, mark_reg_store,
mark_reg_conflicts, set_preference, reg_becomes_live,
build_insn_chain, mark_reg_change): Likewise.
* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
Likewise.
* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
Likewise.
* integrate.c (copy_rtx_and_substitute, try_constants,
subst_constants, mark_stores, allocate_initial_values): Likewise.
* jump.c (reversed_comparison_code_parts, delete_prior_computation,
delete_computation, rtx_renumbered_equal_p, true_regnum,
reg_or_subregno): Likewise.
* lcm.c (reg_dies, reg_becomes_live): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
wipe_dead_reg, no_conflict_p): Likewise.
* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
find_single_use_in_loop, count_one_set, loop_bivs_init_find,
loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
maybe_eliminate_biv_1, record_initial, update_reg_last_use,
canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
try_swap_copy_prop): Likewise.
* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
Likewise.
* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
reload_cse_simplify_operands, reload_combine,
reload_combine_note_store, reload_combine_note_use,
reload_cse_move2add, move2add_note_store): Likewise.
* print-rtl.c (print_rtx): Likewise.
* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
contains_pseudo, handle_asm_insn): Likewise.
* ra-debug.c (ra_print_rtx_object, dump_constraints,
dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, emit_colors,
remove_suspicious_death_notes): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
register_operand, scratch_operand, nonmemory_operand,
constrain_operands): Likewise.
* reg-stack (check_asm_stack_operands, remove_regno_note,
emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
subst_asm_stack_regs): Likewise.
* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
record_address_regs, reg_scan_mark_refs): Likewise.
* regmove.c (discover_flags_reg, replacement_quality,
copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
fixup_match_1): Likewise.
* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
kill_set_value, copyprop_hardreg_forward_1): Likewise.
* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
reload_inner_reg_of_subreg, can_reload_into, push_reload,
combine_reloads, find_dummy_reload, hard_reg_set_here_p,
operands_match_p, decompose, find_reloads, find_reloads_toplev,
find_reloads_address, subst_indexed_address, find_reloads_address_1,
find_reloads_subreg_address, find_replacement,
refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
find_reg, delete_dead_insn, alter_reg, eliminate_regs,
elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
do_output_reload, emit_reload_insns, gen_reload,
delete_address_reloads_1, inc_for_reload): Likewise.
* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
update_reg_unused_notes, fill_slots_from_thread): Likewise.
* resource.c (update_live_status, mark_referenced_resources,
mark_set_resources, mark_target_live_regs): Likewise.
* rtlanal.c (nonzero_address_p, get_jump_table_offset,
global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
parms_set, find_first_parameter_load, keep_with_call_p,
hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
sched_analyze): Likewise.
* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
Likewise.
* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
simplify_binary_operation, simplify_const_relational_operation,
simplify_subreg): Likewise.
* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
expand_end_stmt_expr, expand_return, expand_decl,
expand_anon_union_decl): Likewise.
* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
find_splittable_regs, find_splittable_givs, find_common_reg_term,
loop_iterations): Likewise.
* var-tracking.c (variable_union, variable_part_different_p,
variable_different_p, count_uses, add_uses, add_stores,
compute_bb_dataflow, set_variable_part, delete_variable_part,
emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
Likewise.
* varasm.c (assemble_variable): Likewise.
From-SVN: r83195
2004-06-15 20:02:40 +02:00
|
|
|
|
|| !REG_P (to) || REGNO (to) < FIRST_PSEUDO_REGISTER)
|
1993-03-18 22:28:43 +01:00
|
|
|
|
target = gen_reg_rtx (fmode);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* Convert as signed integer to floating. */
|
|
|
|
|
expand_float (target, from, 0);
|
|
|
|
|
|
|
|
|
|
/* If FROM is negative (and therefore TO is negative),
|
|
|
|
|
correct its value by 2**bitwidth. */
|
|
|
|
|
|
|
|
|
|
do_pending_stack_adjust ();
|
1999-02-14 21:08:39 +01:00
|
|
|
|
emit_cmp_and_jump_insns (from, const0_rtx, GE, NULL_RTX, GET_MODE (from),
|
2001-11-16 00:44:58 +01:00
|
|
|
|
0, label);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
real.c, real.h: Rewrite from scratch.
gcc/
* real.c, real.h: Rewrite from scratch.
* Makefile.in (simplify-rtx.o): Depend on TREE_H.
(paranoia): New target.
* builtins.c (fold_builtin_inf): Use new real.h interface.
* c-common.c (builtin_define_with_hex_fp_value): Likewise.
* c-lex.c (interpret_float): Likewise.
* emit-rtl.c (gen_lowpart_common): Likewise.
* optabs.c (expand_float): Use real_2expN.
* config/ia64/ia64.md (divsi3, udivsi3): Likewise.
* defaults.h (INTEL_EXTENDED_IEEE_FORMAT): New.
(FLOAT_WORDS_BIG_ENDIAN): New.
* cse.c (find_comparison_args): Don't pass FLOAT_STORE_FLAG_VALUE
directly to REAL_VALUE_NEGATIVE.
* loop.c (canonicalize_condition): Likewise.
* simplify-rtx.c: Include tree.h.
(simplify_unary_operation): Don't handle FIX and UNSIGNED_FIX
with floating-point result modes.
* toplev.c (backend_init): Call init_real_once.
* fold-const.c (force_fit_type): Don't call CHECK_FLOAT_VALUE.
* tree.c (build_real): Likewise.
* config/alpha/alpha.c, config/vax/vax.c (float_strings,
float_values, inited_float_values, check_float_value): Remove.
* config/alpha/alpha.h, config/m68hc11/m68hc11.h,
config/m88k/m88k.h, config/vax/vax.h (CHECK_FLOAT_VALUE): Remove.
* doc/tm.texi (CHECK_FLOAT_VALUE): Remove.
gcc/f/
* target.c (ffetarget_real1): Don't pass FFETARGET_ATOF_
directly to ffetarget_make_real1.
(ffetarget_real2): Similarly.
* target.h (ffetarget_cvt_r1_to_rv_, ffetarget_cvt_rv_to_r2_,
ffetarget_cvt_r2_to_rv_): Use new real.h interface and simplify.
gcc/java/
* jcf-parse.c (get_constant): Runtime check for IEEE format;
use new real.h interface.
* jcf-write.c (find_constant_index): Use new real.h interface.
* lex.c (IS_ZERO): Use REAL_VALUES_EQUAL.
contrib/
* paranoia.cc: New file.
From-SVN: r57198
2002-09-16 18:36:39 +02:00
|
|
|
|
real_2expN (&offset, GET_MODE_BITSIZE (GET_MODE (from)));
|
1993-03-18 22:28:43 +01:00
|
|
|
|
temp = expand_binop (fmode, add_optab, target,
|
1994-04-21 21:32:38 +02:00
|
|
|
|
CONST_DOUBLE_FROM_REAL_VALUE (offset, fmode),
|
1991-12-30 04:19:53 +01:00
|
|
|
|
target, 0, OPTAB_LIB_WIDEN);
|
|
|
|
|
if (temp != target)
|
|
|
|
|
emit_move_insn (target, temp);
|
1994-05-30 16:33:41 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
do_pending_stack_adjust ();
|
|
|
|
|
emit_label (label);
|
1994-06-23 00:15:30 +02:00
|
|
|
|
goto done;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* No hardware instruction available; call a library routine. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
rtx libfunc;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
rtx insns;
|
1993-09-15 15:38:01 +02:00
|
|
|
|
rtx value;
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
convert_optab tab = unsignedp ? ufloat_optab : sfloat_optab;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
to = protect_from_queue (to, 1);
|
1992-07-17 06:23:56 +02:00
|
|
|
|
from = protect_from_queue (from, 0);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
if (GET_MODE_SIZE (GET_MODE (from)) < GET_MODE_SIZE (SImode))
|
|
|
|
|
from = convert_to_mode (SImode, from, unsignedp);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
from = force_not_mem (from);
|
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
|
|
|
|
|
if (!libfunc)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
|
2000-09-17 14:45:51 +02:00
|
|
|
|
GET_MODE (to), 1, from,
|
|
|
|
|
GET_MODE (from));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
1993-09-15 15:38:01 +02:00
|
|
|
|
emit_libcall_block (insns, target, value,
|
1998-06-24 16:49:51 +02:00
|
|
|
|
gen_rtx_FLOAT (GET_MODE (to), from));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1994-05-30 16:33:41 +02:00
|
|
|
|
done:
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Copy result to requested destination
|
|
|
|
|
if we have been computing in a temp location. */
|
|
|
|
|
|
|
|
|
|
if (target != to)
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE (target) == GET_MODE (to))
|
|
|
|
|
emit_move_insn (to, target);
|
|
|
|
|
else
|
|
|
|
|
convert_move (to, target, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-02-19 19:50:57 +01:00
|
|
|
|
/* Generate code to convert FROM to fixed point and store in TO. FROM
|
|
|
|
|
must be floating point. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
expand_fix (rtx to, rtx from, int unsignedp)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
enum insn_code icode;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx target = to;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
enum machine_mode fmode, imode;
|
|
|
|
|
int must_trunc = 0;
|
|
|
|
|
|
|
|
|
|
/* We first try to find a pair of modes, one real and one integer, at
|
|
|
|
|
least as wide as FROM and TO, respectively, in which we can open-code
|
|
|
|
|
this conversion. If the integer mode is wider than the mode of TO,
|
|
|
|
|
we can do the conversion either signed or unsigned. */
|
|
|
|
|
|
2002-01-10 11:21:30 +01:00
|
|
|
|
for (fmode = GET_MODE (from); fmode != VOIDmode;
|
|
|
|
|
fmode = GET_MODE_WIDER_MODE (fmode))
|
|
|
|
|
for (imode = GET_MODE (to); imode != VOIDmode;
|
|
|
|
|
imode = GET_MODE_WIDER_MODE (imode))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
int doing_unsigned = unsignedp;
|
|
|
|
|
|
|
|
|
|
icode = can_fix_p (imode, fmode, unsignedp, &must_trunc);
|
|
|
|
|
if (icode == CODE_FOR_nothing && imode != GET_MODE (to) && unsignedp)
|
|
|
|
|
icode = can_fix_p (imode, fmode, 0, &must_trunc), doing_unsigned = 0;
|
|
|
|
|
|
|
|
|
|
if (icode != CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
to = protect_from_queue (to, 1);
|
1992-07-17 06:23:56 +02:00
|
|
|
|
from = protect_from_queue (from, 0);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
if (fmode != GET_MODE (from))
|
|
|
|
|
from = convert_to_mode (fmode, from, 0);
|
|
|
|
|
|
|
|
|
|
if (must_trunc)
|
2004-02-19 19:50:57 +01:00
|
|
|
|
{
|
|
|
|
|
rtx temp = gen_reg_rtx (GET_MODE (from));
|
|
|
|
|
from = expand_unop (GET_MODE (from), ftrunc_optab, from,
|
|
|
|
|
temp, 0);
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
if (imode != GET_MODE (to))
|
|
|
|
|
target = gen_reg_rtx (imode);
|
|
|
|
|
|
|
|
|
|
emit_unop_insn (icode, target, from,
|
|
|
|
|
doing_unsigned ? UNSIGNED_FIX : FIX);
|
|
|
|
|
if (target != to)
|
|
|
|
|
convert_move (to, target, unsignedp);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For an unsigned conversion, there is one more way to do it.
|
|
|
|
|
If we have a signed conversion, we generate code that compares
|
|
|
|
|
the real value to the largest representable positive number. If if
|
|
|
|
|
is smaller, the conversion is done normally. Otherwise, subtract
|
|
|
|
|
one plus the highest signed number, convert, and add it back.
|
|
|
|
|
|
|
|
|
|
We only need to check all real modes, since we know we didn't find
|
2003-07-06 11:56:09 +02:00
|
|
|
|
anything with a wider integer mode.
|
2003-02-26 12:09:33 +01:00
|
|
|
|
|
|
|
|
|
This code used to extend FP value into mode wider than the destination.
|
|
|
|
|
This is not needed. Consider, for instance conversion from SFmode
|
|
|
|
|
into DImode.
|
|
|
|
|
|
|
|
|
|
The hot path trought the code is dealing with inputs smaller than 2^63
|
|
|
|
|
and doing just the conversion, so there is no bits to lose.
|
|
|
|
|
|
|
|
|
|
In the other path we know the value is positive in the range 2^63..2^64-1
|
|
|
|
|
inclusive. (as for other imput overflow happens and result is undefined)
|
2003-07-01 14:18:01 +02:00
|
|
|
|
So we know that the most important bit set in mantissa corresponds to
|
2003-02-26 12:09:33 +01:00
|
|
|
|
2^63. The subtraction of 2^63 should not generate any rounding as it
|
|
|
|
|
simply clears out that bit. The rest is trivial. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1992-07-06 22:04:10 +02:00
|
|
|
|
if (unsignedp && GET_MODE_BITSIZE (GET_MODE (to)) <= HOST_BITS_PER_WIDE_INT)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
for (fmode = GET_MODE (from); fmode != VOIDmode;
|
|
|
|
|
fmode = GET_MODE_WIDER_MODE (fmode))
|
2003-02-26 12:09:33 +01:00
|
|
|
|
if (CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0,
|
|
|
|
|
&must_trunc))
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
1993-03-31 07:51:30 +02:00
|
|
|
|
int bitsize;
|
|
|
|
|
REAL_VALUE_TYPE offset;
|
|
|
|
|
rtx limit, lab1, lab2, insn;
|
|
|
|
|
|
|
|
|
|
bitsize = GET_MODE_BITSIZE (GET_MODE (to));
|
real.c, real.h: Rewrite from scratch.
gcc/
* real.c, real.h: Rewrite from scratch.
* Makefile.in (simplify-rtx.o): Depend on TREE_H.
(paranoia): New target.
* builtins.c (fold_builtin_inf): Use new real.h interface.
* c-common.c (builtin_define_with_hex_fp_value): Likewise.
* c-lex.c (interpret_float): Likewise.
* emit-rtl.c (gen_lowpart_common): Likewise.
* optabs.c (expand_float): Use real_2expN.
* config/ia64/ia64.md (divsi3, udivsi3): Likewise.
* defaults.h (INTEL_EXTENDED_IEEE_FORMAT): New.
(FLOAT_WORDS_BIG_ENDIAN): New.
* cse.c (find_comparison_args): Don't pass FLOAT_STORE_FLAG_VALUE
directly to REAL_VALUE_NEGATIVE.
* loop.c (canonicalize_condition): Likewise.
* simplify-rtx.c: Include tree.h.
(simplify_unary_operation): Don't handle FIX and UNSIGNED_FIX
with floating-point result modes.
* toplev.c (backend_init): Call init_real_once.
* fold-const.c (force_fit_type): Don't call CHECK_FLOAT_VALUE.
* tree.c (build_real): Likewise.
* config/alpha/alpha.c, config/vax/vax.c (float_strings,
float_values, inited_float_values, check_float_value): Remove.
* config/alpha/alpha.h, config/m68hc11/m68hc11.h,
config/m88k/m88k.h, config/vax/vax.h (CHECK_FLOAT_VALUE): Remove.
* doc/tm.texi (CHECK_FLOAT_VALUE): Remove.
gcc/f/
* target.c (ffetarget_real1): Don't pass FFETARGET_ATOF_
directly to ffetarget_make_real1.
(ffetarget_real2): Similarly.
* target.h (ffetarget_cvt_r1_to_rv_, ffetarget_cvt_rv_to_r2_,
ffetarget_cvt_r2_to_rv_): Use new real.h interface and simplify.
gcc/java/
* jcf-parse.c (get_constant): Runtime check for IEEE format;
use new real.h interface.
* jcf-write.c (find_constant_index): Use new real.h interface.
* lex.c (IS_ZERO): Use REAL_VALUES_EQUAL.
contrib/
* paranoia.cc: New file.
From-SVN: r57198
2002-09-16 18:36:39 +02:00
|
|
|
|
real_2expN (&offset, bitsize - 1);
|
1994-04-21 21:32:38 +02:00
|
|
|
|
limit = CONST_DOUBLE_FROM_REAL_VALUE (offset, fmode);
|
1993-03-31 07:51:30 +02:00
|
|
|
|
lab1 = gen_label_rtx ();
|
|
|
|
|
lab2 = gen_label_rtx ();
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
emit_queue ();
|
|
|
|
|
to = protect_from_queue (to, 1);
|
|
|
|
|
from = protect_from_queue (from, 0);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
from = force_not_mem (from);
|
|
|
|
|
|
|
|
|
|
if (fmode != GET_MODE (from))
|
|
|
|
|
from = convert_to_mode (fmode, from, 0);
|
|
|
|
|
|
|
|
|
|
/* See if we need to do the subtraction. */
|
|
|
|
|
do_pending_stack_adjust ();
|
1999-02-14 21:08:39 +01:00
|
|
|
|
emit_cmp_and_jump_insns (from, limit, GE, NULL_RTX, GET_MODE (from),
|
2001-11-16 00:44:58 +01:00
|
|
|
|
0, lab1);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
/* If not, do the signed "fix" and branch around fixup code. */
|
|
|
|
|
expand_fix (to, from, 0);
|
|
|
|
|
emit_jump_insn (gen_jump (lab2));
|
|
|
|
|
emit_barrier ();
|
|
|
|
|
|
|
|
|
|
/* Otherwise, subtract 2**(N-1), convert to signed number,
|
|
|
|
|
then add 2**(N-1). Do the addition using XOR since this
|
|
|
|
|
will often generate better code. */
|
|
|
|
|
emit_label (lab1);
|
|
|
|
|
target = expand_binop (GET_MODE (from), sub_optab, from, limit,
|
1992-07-06 22:04:10 +02:00
|
|
|
|
NULL_RTX, 0, OPTAB_LIB_WIDEN);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
expand_fix (to, target, 0);
|
|
|
|
|
target = expand_binop (GET_MODE (to), xor_optab, to,
|
emit-rtl.c (gen_int_mode): New function.
* emit-rtl.c (gen_int_mode): New function.
* rtl.h: Prototype for it.
* combine.c (make_extraction, simplify_comparison), expmed.c
(store_bit_field, expand_mult_highpart, expand_divmod), expr.c
(convert_modes, store_field), optabs.c (expand_fix),
simplify-rtx.c (neg_const_int, simplify_unary_real),
* config/rs6000/rs6000.c, config/rs6000/rs6000.md:
Use it instead of GEN_INT (trunc_int_for_mode (...)).
From-SVN: r51030
2002-03-19 19:00:43 +01:00
|
|
|
|
gen_int_mode
|
|
|
|
|
((HOST_WIDE_INT) 1 << (bitsize - 1),
|
|
|
|
|
GET_MODE (to)),
|
1991-12-30 04:19:53 +01:00
|
|
|
|
to, 1, OPTAB_LIB_WIDEN);
|
|
|
|
|
|
|
|
|
|
if (target != to)
|
|
|
|
|
emit_move_insn (to, target);
|
|
|
|
|
|
|
|
|
|
emit_label (lab2);
|
|
|
|
|
|
1996-10-23 16:30:26 +02:00
|
|
|
|
if (mov_optab->handlers[(int) GET_MODE (to)].insn_code
|
|
|
|
|
!= CODE_FOR_nothing)
|
|
|
|
|
{
|
|
|
|
|
/* Make a place for a REG_NOTE and add it. */
|
|
|
|
|
insn = emit_move_insn (to, to);
|
1999-03-25 13:04:26 +01:00
|
|
|
|
set_unique_reg_note (insn,
|
|
|
|
|
REG_EQUAL,
|
|
|
|
|
gen_rtx_fmt_e (UNSIGNED_FIX,
|
|
|
|
|
GET_MODE (to),
|
|
|
|
|
copy_rtx (from)));
|
1996-10-23 16:30:26 +02:00
|
|
|
|
}
|
1999-09-07 07:49:18 +02:00
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We can't do it with an insn, so use a library call. But first ensure
|
|
|
|
|
that the mode of TO is at least as wide as SImode, since those are the
|
|
|
|
|
only library calls we know about. */
|
|
|
|
|
|
|
|
|
|
if (GET_MODE_SIZE (GET_MODE (to)) < GET_MODE_SIZE (SImode))
|
|
|
|
|
{
|
|
|
|
|
target = gen_reg_rtx (SImode);
|
|
|
|
|
|
|
|
|
|
expand_fix (target, from, unsignedp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx insns;
|
1994-09-27 23:32:07 +01:00
|
|
|
|
rtx value;
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
rtx libfunc;
|
|
|
|
|
|
|
|
|
|
convert_optab tab = unsignedp ? ufix_optab : sfix_optab;
|
|
|
|
|
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
|
|
|
|
|
if (!libfunc)
|
|
|
|
|
abort ();
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
|
|
|
|
to = protect_from_queue (to, 1);
|
|
|
|
|
from = protect_from_queue (from, 0);
|
|
|
|
|
|
|
|
|
|
if (flag_force_mem)
|
|
|
|
|
from = force_not_mem (from);
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
|
2000-09-17 14:45:51 +02:00
|
|
|
|
GET_MODE (to), 1, from,
|
|
|
|
|
GET_MODE (from));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
insns = get_insns ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
|
1994-09-27 23:32:07 +01:00
|
|
|
|
emit_libcall_block (insns, target, value,
|
1998-06-24 16:49:51 +02:00
|
|
|
|
gen_rtx_fmt_e (unsignedp ? UNSIGNED_FIX : FIX,
|
|
|
|
|
GET_MODE (to), from));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
2003-07-06 11:56:09 +02:00
|
|
|
|
|
1996-01-16 14:20:15 +01:00
|
|
|
|
if (target != to)
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE (to) == GET_MODE (target))
|
|
|
|
|
emit_move_insn (to, target);
|
|
|
|
|
else
|
|
|
|
|
convert_move (to, target, 0);
|
|
|
|
|
}
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
/* Report whether we have an instruction to perform the operation
|
|
|
|
|
specified by CODE on operands of mode MODE. */
|
|
|
|
|
int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
have_insn_for (enum rtx_code code, enum machine_mode mode)
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
{
|
|
|
|
|
return (code_to_optab[(int) code] != 0
|
|
|
|
|
&& (code_to_optab[(int) code]->handlers[(int) mode].insn_code
|
|
|
|
|
!= CODE_FOR_nothing));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Create a blank optab. */
|
|
|
|
|
static optab
|
2003-07-06 11:56:09 +02:00
|
|
|
|
new_optab (void)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
|
|
|
|
int i;
|
2003-07-19 16:47:15 +02:00
|
|
|
|
optab op = ggc_alloc (sizeof (struct optab));
|
1991-12-30 04:19:53 +01:00
|
|
|
|
for (i = 0; i < NUM_MACHINE_MODES; i++)
|
|
|
|
|
{
|
|
|
|
|
op->handlers[i].insn_code = CODE_FOR_nothing;
|
|
|
|
|
op->handlers[i].libfunc = 0;
|
|
|
|
|
}
|
1993-08-03 23:33:37 +02:00
|
|
|
|
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
return op;
|
|
|
|
|
}
|
1993-08-03 23:33:37 +02:00
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
static convert_optab
|
|
|
|
|
new_convert_optab (void)
|
|
|
|
|
{
|
|
|
|
|
int i, j;
|
|
|
|
|
convert_optab op = ggc_alloc (sizeof (struct convert_optab));
|
|
|
|
|
for (i = 0; i < NUM_MACHINE_MODES; i++)
|
|
|
|
|
for (j = 0; j < NUM_MACHINE_MODES; j++)
|
|
|
|
|
{
|
|
|
|
|
op->handlers[i][j].insn_code = CODE_FOR_nothing;
|
|
|
|
|
op->handlers[i][j].libfunc = 0;
|
|
|
|
|
}
|
|
|
|
|
return op;
|
|
|
|
|
}
|
|
|
|
|
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
/* Same, but fill in its code as CODE, and write it into the
|
|
|
|
|
code_to_optab table. */
|
|
|
|
|
static inline optab
|
2003-07-06 11:56:09 +02:00
|
|
|
|
init_optab (enum rtx_code code)
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
{
|
|
|
|
|
optab op = new_optab ();
|
|
|
|
|
op->code = code;
|
|
|
|
|
code_to_optab[(int) code] = op;
|
|
|
|
|
return op;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Same, but fill in its code as CODE, and do _not_ write it into
|
|
|
|
|
the code_to_optab table. */
|
|
|
|
|
static inline optab
|
2003-07-06 11:56:09 +02:00
|
|
|
|
init_optabv (enum rtx_code code)
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
{
|
|
|
|
|
optab op = new_optab ();
|
|
|
|
|
op->code = code;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
return op;
|
|
|
|
|
}
|
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* Conversion optabs never go in the code_to_optab table. */
|
|
|
|
|
static inline convert_optab
|
|
|
|
|
init_convert_optab (enum rtx_code code)
|
|
|
|
|
{
|
|
|
|
|
convert_optab op = new_convert_optab ();
|
|
|
|
|
op->code = code;
|
|
|
|
|
return op;
|
|
|
|
|
}
|
|
|
|
|
|
1992-06-23 02:28:39 +02:00
|
|
|
|
/* Initialize the libfunc fields of an entire group of entries in some
|
|
|
|
|
optab. Each entry is set equal to a string consisting of a leading
|
|
|
|
|
pair of underscores followed by a generic operation name followed by
|
2003-10-11 21:00:49 +02:00
|
|
|
|
a mode name (downshifted to lowercase) followed by a single character
|
1992-06-23 02:28:39 +02:00
|
|
|
|
representing the number of operands for the given operation (which is
|
|
|
|
|
usually one of the characters '2', '3', or '4').
|
|
|
|
|
|
|
|
|
|
OPTABLE is the table in which libfunc fields are to be initialized.
|
|
|
|
|
FIRST_MODE is the first machine mode index in the given optab to
|
|
|
|
|
initialize.
|
|
|
|
|
LAST_MODE is the last machine mode index in the given optab to
|
|
|
|
|
initialize.
|
|
|
|
|
OPNAME is the generic (string) name of the operation.
|
|
|
|
|
SUFFIX is the character which specifies the number of operands for
|
|
|
|
|
the given generic operation.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
init_libfuncs (optab optable, int first_mode, int last_mode,
|
|
|
|
|
const char *opname, int suffix)
|
1992-06-23 02:28:39 +02:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int mode;
|
|
|
|
|
unsigned opname_len = strlen (opname);
|
1992-06-23 02:28:39 +02:00
|
|
|
|
|
1992-11-06 22:04:59 +01:00
|
|
|
|
for (mode = first_mode; (int) mode <= (int) last_mode;
|
|
|
|
|
mode = (enum machine_mode) ((int) mode + 1))
|
1992-06-23 02:28:39 +02:00
|
|
|
|
{
|
2002-11-16 07:08:16 +01:00
|
|
|
|
const char *mname = GET_MODE_NAME (mode);
|
2001-10-11 05:16:15 +02:00
|
|
|
|
unsigned mname_len = strlen (mname);
|
|
|
|
|
char *libfunc_name = alloca (2 + opname_len + mname_len + 1 + 1);
|
|
|
|
|
char *p;
|
|
|
|
|
const char *q;
|
1992-06-23 02:28:39 +02:00
|
|
|
|
|
|
|
|
|
p = libfunc_name;
|
|
|
|
|
*p++ = '_';
|
|
|
|
|
*p++ = '_';
|
|
|
|
|
for (q = opname; *q; )
|
|
|
|
|
*p++ = *q++;
|
|
|
|
|
for (q = mname; *q; q++)
|
system.h (CTYPE_CONV, [...]): New macros.
* system.h (CTYPE_CONV, TOUPPER, TOLOWER): New macros. Use
CTYPE_CONV in all ctype macros.
* cccp.c (initialize_char_syntax): Use uppercase ctype macro
from system.h.
* cexp.y (initialize_random_junk): Likewise.
* c4x.c (c4x_interrupt_function_p, c4x_handle_pragma): Likewise.
* i370.c (handle_pragma): Likewise.
* i370.h (ASM_OUTPUT_LABELREF, ASM_OUTPUT_ASCII): Likewise.
* v850.c (override_options): Likewise.
* doprint.c (_doprnt): Likewise.
* fixinc/fixincl.c (main, quoted_file_exists, extract_quoted_files):
Likewise.
* fixinc/server.c (load_data): Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* genattr.c (write_upcase, gen_attr): Likewise.
* genattrtab.c (convert_const_symbol_ref, evaluate_eq_attr,
write_upcase): Likewise.
* genemit.c (print_code): Likewise.
* genopinit.c (gen_insn): Likewise.
* genpeep.c (print_code): Likewise.
* genrecog.c (print_code): Likewise.
* optabs.c (init_libfuncs): Likewise.
ch:
* lex.c (maybe_downcase, getlc, handle_generic_pragma,
check_newline): Likewise.
f:
* bad.c (ffebad_finish): Likewise.
* fini.c (main): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_hash_): Likewise.
* src.c (ffesrc_init_1): Likewise.
From-SVN: r29463
1999-09-17 00:20:44 +02:00
|
|
|
|
*p++ = TOLOWER (*q);
|
1992-06-23 02:28:39 +02:00
|
|
|
|
*p++ = suffix;
|
stringpool.c: New file.
* stringpool.c: New file.
* ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete.
(ggc_alloc_string): Now in stringpool.o.
* ggc-page.c, ggc-simple.c: Do not define or allocate empty_string.
* ggc.h: Delete prototype of ggc_add_string_root. #define
ggc_add_string_root and ggc_mark_string to nothing. Prototype
init_stringpool and stringpool_statistics.
(ggc_alloc_string): Returns a const char *.
* tree.c (hash_table, do_identifier_warnings): Delete.
(init_obstacks): Don't initialize the identifier hash table.
(get_identifier, maybe_get_identifier, start_identifier_warnings,
set_identifier_size): Now in stringpool.c.
* tree.h (struct tree_string): Constify pointer field.
(approx_sqrt): Prototype.
* Makefile.in (stringpool.o): Add rule, mention in OBJS.
* toplev.c (approx_sqrt): New function.
(compile_file): Call stringpool_statistics if mem_report is on.
(main): Call init_stringpool.
* builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c
(process_directive), c-typeck.c (constructor_asmspec, struct
initializer_stack, start_init), except.c (create_rethrow_ref),
stmt.c (digit_strings), toplev.c (decode_f_option), tree.c
(built_in_filename), varasm,c (in_named_name,
assemble_static_space, struct constant_descriptor, struct
deferred_string, struct pool_constant, force_const_mem),
i386.c (pic_label_name, global_offset_table_name), rs6000.c
(rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *.
* c-common.c (combine_strings): Combine strings in scratch
buffer, then pass to build_string.
* optabs.c (init_libfuncs), profile.c (init_edge_profiler,
output_func_start_profiler), stmt.c (init_stmt), alpha.c
(alpha_need_linkage), arm.c (arm_encode_call_attribute),
i386.c (load_pic_register), ia64.c (ia64_encode_section_info),
rs6000.c (rs6000_encode_section_info): Create string in
scratch buffer, then pass to ggc_alloc_string.
* stmt.c (expand_asm_operands): If we must adjust the
constraint strings, do so by creating a new one, not by
modifying the old one in place. Constify some char *s.
* config/pa/pa.c (hppa_encode_label): Drop unnecessary second
argument. Create string in scratch buffer, then pass to
ggc_alloc_string.
* config/pa/pa-protos.h: Update prototype.
* config/pa/elf.h, config/pa/pa.h, config/pa/som.h:
hppa_encode_label takes only one argument.
* c-parse.in (if_prefix): Find the filename and line number at
$-2 and $-1 respectively.
* diagnostic.c (error_recursion): Add missing newline, use
fputs, translate string.
cp:
* lex.c (struct impl_files, internal_filename): Constify a char *.
java:
* jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
Create string in scratch buffer, then pass to build_string.
From-SVN: r37514
2000-11-17 07:05:31 +01:00
|
|
|
|
*p = '\0';
|
1999-09-09 09:07:41 +02:00
|
|
|
|
|
1992-06-23 02:28:39 +02:00
|
|
|
|
optable->handlers[(int) mode].libfunc
|
2003-04-11 21:45:32 +02:00
|
|
|
|
= init_one_libfunc (ggc_alloc_string (libfunc_name, p - libfunc_name));
|
1992-06-23 02:28:39 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Initialize the libfunc fields of an entire group of entries in some
|
|
|
|
|
optab which correspond to all integer mode operations. The parameters
|
|
|
|
|
have the same meaning as similarly named ones for the `init_libfuncs'
|
|
|
|
|
routine. (See above). */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
init_integral_libfuncs (optab optable, const char *opname, int suffix)
|
1992-06-23 02:28:39 +02:00
|
|
|
|
{
|
2003-03-21 17:58:35 +01:00
|
|
|
|
int maxsize = 2*BITS_PER_WORD;
|
|
|
|
|
if (maxsize < LONG_LONG_TYPE_SIZE)
|
|
|
|
|
maxsize = LONG_LONG_TYPE_SIZE;
|
libgcc-std.ver (__clztf2): New.
* libgcc-std.ver (__clztf2): New.
(__ctztf2, __popcounttf2, __paritytf2): New.
* libgcc2.c (__clzSI2, __clzDI2, __ctzSI2, __ctzDI2, __popcountSI2,
__popcountDI2, __paritySI2, __parityDI2): Use UWmode and UDWmode;
adjust code to match the different type sizes.
* libgcc2.h (__clzSI2, __ctzSI2, __popcountSI2, __paritySI2,
__clzDI2, __ctzDI2, __popcountDI2, __parityDI2): New macros.
* optabs.c (init_integral_libfuncs): Don't hard-code SImode and
TImode; select word_mode and twice that.
(init_floating_libfuncs): Don't hard-code SFmode and TFmode;
select the modes from float, double, and long double.
(init_optabs): Remove duplicate initializations.
From-SVN: r62606
2003-02-09 19:35:22 +01:00
|
|
|
|
init_libfuncs (optable, word_mode,
|
2003-03-21 17:58:35 +01:00
|
|
|
|
mode_for_size (maxsize, MODE_INT, 0),
|
libgcc-std.ver (__clztf2): New.
* libgcc-std.ver (__clztf2): New.
(__ctztf2, __popcounttf2, __paritytf2): New.
* libgcc2.c (__clzSI2, __clzDI2, __ctzSI2, __ctzDI2, __popcountSI2,
__popcountDI2, __paritySI2, __parityDI2): Use UWmode and UDWmode;
adjust code to match the different type sizes.
* libgcc2.h (__clzSI2, __ctzSI2, __popcountSI2, __paritySI2,
__clzDI2, __ctzDI2, __popcountDI2, __parityDI2): New macros.
* optabs.c (init_integral_libfuncs): Don't hard-code SImode and
TImode; select word_mode and twice that.
(init_floating_libfuncs): Don't hard-code SFmode and TFmode;
select the modes from float, double, and long double.
(init_optabs): Remove duplicate initializations.
From-SVN: r62606
2003-02-09 19:35:22 +01:00
|
|
|
|
opname, suffix);
|
1992-06-23 02:28:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Initialize the libfunc fields of an entire group of entries in some
|
|
|
|
|
optab which correspond to all real mode operations. The parameters
|
|
|
|
|
have the same meaning as similarly named ones for the `init_libfuncs'
|
|
|
|
|
routine. (See above). */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
init_floating_libfuncs (optab optable, const char *opname, int suffix)
|
1992-06-23 02:28:39 +02:00
|
|
|
|
{
|
2003-10-20 20:28:27 +02:00
|
|
|
|
init_libfuncs (optable, MIN_MODE_FLOAT, MAX_MODE_FLOAT, opname, suffix);
|
1992-06-23 02:28:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* Initialize the libfunc fields of an entire group of entries of an
|
|
|
|
|
inter-mode-class conversion optab. The string formation rules are
|
|
|
|
|
similar to the ones for init_libfuncs, above, but instead of having
|
|
|
|
|
a mode name and an operand count these functions have two mode names
|
|
|
|
|
and no operand count. */
|
|
|
|
|
static void
|
|
|
|
|
init_interclass_conv_libfuncs (convert_optab tab, const char *opname,
|
|
|
|
|
enum mode_class from_class,
|
|
|
|
|
enum mode_class to_class)
|
|
|
|
|
{
|
|
|
|
|
enum machine_mode first_from_mode = GET_CLASS_NARROWEST_MODE (from_class);
|
|
|
|
|
enum machine_mode first_to_mode = GET_CLASS_NARROWEST_MODE (to_class);
|
|
|
|
|
size_t opname_len = strlen (opname);
|
|
|
|
|
size_t max_mname_len = 0;
|
|
|
|
|
|
|
|
|
|
enum machine_mode fmode, tmode;
|
|
|
|
|
const char *fname, *tname;
|
|
|
|
|
const char *q;
|
|
|
|
|
char *libfunc_name, *suffix;
|
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
|
|
for (fmode = first_from_mode;
|
|
|
|
|
fmode != VOIDmode;
|
|
|
|
|
fmode = GET_MODE_WIDER_MODE (fmode))
|
|
|
|
|
max_mname_len = MAX (max_mname_len, strlen (GET_MODE_NAME (fmode)));
|
|
|
|
|
|
|
|
|
|
for (tmode = first_to_mode;
|
|
|
|
|
tmode != VOIDmode;
|
|
|
|
|
tmode = GET_MODE_WIDER_MODE (tmode))
|
|
|
|
|
max_mname_len = MAX (max_mname_len, strlen (GET_MODE_NAME (tmode)));
|
|
|
|
|
|
|
|
|
|
libfunc_name = alloca (2 + opname_len + 2*max_mname_len + 1 + 1);
|
|
|
|
|
libfunc_name[0] = '_';
|
|
|
|
|
libfunc_name[1] = '_';
|
|
|
|
|
memcpy (&libfunc_name[2], opname, opname_len);
|
|
|
|
|
suffix = libfunc_name + opname_len + 2;
|
|
|
|
|
|
|
|
|
|
for (fmode = first_from_mode; fmode != VOIDmode;
|
|
|
|
|
fmode = GET_MODE_WIDER_MODE (fmode))
|
|
|
|
|
for (tmode = first_to_mode; tmode != VOIDmode;
|
|
|
|
|
tmode = GET_MODE_WIDER_MODE (tmode))
|
|
|
|
|
{
|
|
|
|
|
fname = GET_MODE_NAME (fmode);
|
|
|
|
|
tname = GET_MODE_NAME (tmode);
|
|
|
|
|
|
|
|
|
|
p = suffix;
|
|
|
|
|
for (q = fname; *q; p++, q++)
|
|
|
|
|
*p = TOLOWER (*q);
|
|
|
|
|
for (q = tname; *q; p++, q++)
|
|
|
|
|
*p = TOLOWER (*q);
|
|
|
|
|
|
|
|
|
|
*p = '\0';
|
|
|
|
|
|
|
|
|
|
tab->handlers[tmode][fmode].libfunc
|
|
|
|
|
= init_one_libfunc (ggc_alloc_string (libfunc_name,
|
|
|
|
|
p - libfunc_name));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Initialize the libfunc fields of an entire group of entries of an
|
|
|
|
|
intra-mode-class conversion optab. The string formation rules are
|
|
|
|
|
similar to the ones for init_libfunc, above. WIDENING says whether
|
|
|
|
|
the optab goes from narrow to wide modes or vice versa. These functions
|
|
|
|
|
have two mode names _and_ an operand count. */
|
|
|
|
|
static void
|
|
|
|
|
init_intraclass_conv_libfuncs (convert_optab tab, const char *opname,
|
|
|
|
|
enum mode_class class, bool widening)
|
|
|
|
|
{
|
|
|
|
|
enum machine_mode first_mode = GET_CLASS_NARROWEST_MODE (class);
|
|
|
|
|
size_t opname_len = strlen (opname);
|
|
|
|
|
size_t max_mname_len = 0;
|
|
|
|
|
|
|
|
|
|
enum machine_mode nmode, wmode;
|
|
|
|
|
const char *nname, *wname;
|
|
|
|
|
const char *q;
|
|
|
|
|
char *libfunc_name, *suffix;
|
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
|
|
for (nmode = first_mode; nmode != VOIDmode;
|
|
|
|
|
nmode = GET_MODE_WIDER_MODE (nmode))
|
|
|
|
|
max_mname_len = MAX (max_mname_len, strlen (GET_MODE_NAME (nmode)));
|
|
|
|
|
|
|
|
|
|
libfunc_name = alloca (2 + opname_len + 2*max_mname_len + 1 + 1);
|
|
|
|
|
libfunc_name[0] = '_';
|
|
|
|
|
libfunc_name[1] = '_';
|
|
|
|
|
memcpy (&libfunc_name[2], opname, opname_len);
|
|
|
|
|
suffix = libfunc_name + opname_len + 2;
|
|
|
|
|
|
|
|
|
|
for (nmode = first_mode; nmode != VOIDmode;
|
|
|
|
|
nmode = GET_MODE_WIDER_MODE (nmode))
|
|
|
|
|
for (wmode = GET_MODE_WIDER_MODE (nmode); wmode != VOIDmode;
|
|
|
|
|
wmode = GET_MODE_WIDER_MODE (wmode))
|
|
|
|
|
{
|
|
|
|
|
nname = GET_MODE_NAME (nmode);
|
|
|
|
|
wname = GET_MODE_NAME (wmode);
|
|
|
|
|
|
|
|
|
|
p = suffix;
|
|
|
|
|
for (q = widening ? nname : wname; *q; p++, q++)
|
|
|
|
|
*p = TOLOWER (*q);
|
|
|
|
|
for (q = widening ? wname : nname; *q; p++, q++)
|
|
|
|
|
*p = TOLOWER (*q);
|
|
|
|
|
|
|
|
|
|
*p++ = '2';
|
|
|
|
|
*p = '\0';
|
|
|
|
|
|
2003-10-07 18:07:28 +02:00
|
|
|
|
tab->handlers[widening ? wmode : nmode]
|
|
|
|
|
[widening ? nmode : wmode].libfunc
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
= init_one_libfunc (ggc_alloc_string (libfunc_name,
|
|
|
|
|
p - libfunc_name));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1999-09-09 09:07:41 +02:00
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
init_one_libfunc (const char *name)
|
1999-09-09 09:07:41 +02:00
|
|
|
|
{
|
2003-04-11 23:15:36 +02:00
|
|
|
|
rtx symbol;
|
|
|
|
|
|
system.h (ENCODE_SECTION_INFO): Poison it.
* system.h (ENCODE_SECTION_INFO): Poison it.
* target-def.h (TARGET_ENCODE_SECTION_INFO): New.
* target.h (encode_section_info): New.
* varasm.c (make_decl_rtl, output_constant_def): Use it.
* hooks.c (hook_tree_int_void): New.
* hooks.h: Declare it.
* config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c,
config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h,
config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h,
config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h,
config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h,
config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c,
config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c,
config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h,
config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h,
config/mcore/mcore-protos.h, config/mcore/mcore.c,
config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c,
config/mmix/mmix.h, config/rs6000/rs6000-protos.h,
config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h,
config/stormy16/stormy16.c, config/stormy16/stormy16.h:
Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO
referencing existing function. Make function static.
* config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c,
config/arc/arc.h, config/arm/arm.c, config/arm/arm.h,
config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c,
config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c,
config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c,
config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h,
config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c,
config/pa/pa.h, config/romp/romp.c, config/romp/romp.h,
config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c,
config/s390/s390.h, config/sh/sh.c, config/sh/sh.h,
config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c,
config/v850/v850.h, config/vax/vax.c, config/vax/vms.h,
config/xtensa/xtensa.c, config/xtensa/xtensa.h:
Move ENCODE_SECTION_INFO to out-of-line function and add
TARGET_ENCODE_SECTION_INFO.
* config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro.
(ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise.
* config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename
from SUBTARGET_*
(switch_to_section): Replace in_rdata case with in_readonly_data.
* config/h8300/h8300.c (h8300_encode_label): Make static.
* config/h8300/h8300-protos.h: Update.
* config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename
from rs6000_encode_section_info; make static.
(rs6000_xcoff_encode_section_info): New.
* config/v850/v850.c (v850_encode_data_area): Make static.
* config/v850/v850-protos.h: Update.
* config/vax/vax.c: Include flags.h.
(vms_select_section): Fix typo.
* doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous
ENCODE_SECTION_INFO docs.
From-SVN: r53606
2002-05-19 07:23:27 +02:00
|
|
|
|
/* Create a FUNCTION_DECL that can be passed to
|
|
|
|
|
targetm.encode_section_info. */
|
2001-09-21 22:42:14 +02:00
|
|
|
|
/* ??? We don't have any type information except for this is
|
2001-09-26 22:02:51 +02:00
|
|
|
|
a function. Pretend this is "int foo()". */
|
2001-09-21 22:42:14 +02:00
|
|
|
|
tree decl = build_decl (FUNCTION_DECL, get_identifier (name),
|
2001-09-26 22:02:51 +02:00
|
|
|
|
build_function_type (integer_type_node, NULL_TREE));
|
2001-09-21 22:42:14 +02:00
|
|
|
|
DECL_ARTIFICIAL (decl) = 1;
|
|
|
|
|
DECL_EXTERNAL (decl) = 1;
|
|
|
|
|
TREE_PUBLIC (decl) = 1;
|
|
|
|
|
|
2003-04-11 23:15:36 +02:00
|
|
|
|
symbol = XEXP (DECL_RTL (decl), 0);
|
|
|
|
|
|
|
|
|
|
/* Zap the nonsensical SYMBOL_REF_DECL for this. What we're left with
|
|
|
|
|
are the flags assigned by targetm.encode_section_info. */
|
|
|
|
|
SYMBOL_REF_DECL (symbol) = 0;
|
|
|
|
|
|
|
|
|
|
return symbol;
|
1999-09-09 09:07:41 +02:00
|
|
|
|
}
|
|
|
|
|
|
target.h (init_libfuncs): New hook.
* target.h (init_libfuncs): New hook.
* target-def.h: Default TARGET_INIT_BUILTINS and
TARGET_INIT_LIBFUNCS to hook_void_void. Add
TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER.
* builtins.c (default_init_builtins): Delete.
* expr.h (default_init_builtins): Delete prototype.
* doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST.
Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL.
Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL,
DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL,
MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL,
and UMODDI3_LIBCALL,
* Makefile.in (optabs.o): Depends on target.h.
* defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL.
* optabs.c: Include target.h.
(prepare_float_lib_cmp): No need for #ifdef around use of
FLOAT_LIB_COMPARE_RETURNS_BOOL.
(set_optab_libfunc): New function.
(init_optabs): Delete use of all *_LIBCALL defines.
Call targetm.init_libfuncs not INIT_TARGET_OPTABS.
* optabs.h: Prototype set_optab_libfunc.
* config.gcc: Remove all references to pa/long_double.h,
ia64/hpux_longdouble.h, and gofast.h.
(mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST
to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file.
* config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c
* config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c
* config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c, config/vax/vax.c:
Provide a definition for TARGET_INIT_LIBFUNCS. Where
necessary, include optabs.h, libfuncs.h, and/or config/gofast.h.
* config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h
* config/avr/avr.h, config/cris/cris.h, config/frv/frv.h
* config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h
* config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h
* config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h
* config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h
* config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h
* config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS,
INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros.
* config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0.
Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here.
* config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE,
HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here.
* config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete.
* config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC.
* config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 0.
* config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 1.
* config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 0.
* config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h:
Define US_SOFTWARE_GOFAST.
* config/vax/vax.h: Default TARGET_ELF to 0.
* config/vax/elf.h: Redefine TARGET_ELF to 1.
* config/gofast.h: Don't define any macros here. Provide one
static function, gofast_maybe_init_libfuncs, which does what
INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST
is already defined. Do not clear negation libfuncs. Do
not mess with HFmode, XFmode, or TFmode libfuncs.
* config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME.
From-SVN: r72009
2003-10-02 02:44:29 +02:00
|
|
|
|
/* Call this to reset the function entry for one optab (OPTABLE) in mode
|
|
|
|
|
MODE to NAME, which should be either 0 or a string constant. */
|
|
|
|
|
void
|
|
|
|
|
set_optab_libfunc (optab optable, enum machine_mode mode, const char *name)
|
|
|
|
|
{
|
|
|
|
|
if (name)
|
|
|
|
|
optable->handlers[mode].libfunc = init_one_libfunc (name);
|
|
|
|
|
else
|
|
|
|
|
optable->handlers[mode].libfunc = 0;
|
|
|
|
|
}
|
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* Call this to reset the function entry for one conversion optab
|
|
|
|
|
(OPTABLE) from mode FMODE to mode TMODE to NAME, which should be
|
|
|
|
|
either 0 or a string constant. */
|
|
|
|
|
void
|
|
|
|
|
set_conv_libfunc (convert_optab optable, enum machine_mode tmode,
|
|
|
|
|
enum machine_mode fmode, const char *name)
|
|
|
|
|
{
|
|
|
|
|
if (name)
|
|
|
|
|
optable->handlers[tmode][fmode].libfunc = init_one_libfunc (name);
|
|
|
|
|
else
|
|
|
|
|
optable->handlers[tmode][fmode].libfunc = 0;
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
/* Call this once to initialize the contents of the optabs
|
|
|
|
|
appropriately for the current target machine. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
init_optabs (void)
|
1991-12-30 04:19:53 +01:00
|
|
|
|
{
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
unsigned int i;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1993-03-30 22:29:35 +02:00
|
|
|
|
/* Start by initializing all tables to contain CODE_FOR_nothing. */
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
1993-03-30 22:29:35 +02:00
|
|
|
|
for (i = 0; i < NUM_RTX_CODE; i++)
|
|
|
|
|
setcc_gen_code[i] = CODE_FOR_nothing;
|
|
|
|
|
|
1995-01-25 05:18:30 +01:00
|
|
|
|
#ifdef HAVE_conditional_move
|
|
|
|
|
for (i = 0; i < NUM_MACHINE_MODES; i++)
|
|
|
|
|
movcc_gen_code[i] = CODE_FOR_nothing;
|
|
|
|
|
#endif
|
|
|
|
|
|
1993-03-30 22:29:35 +02:00
|
|
|
|
add_optab = init_optab (PLUS);
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
addv_optab = init_optabv (PLUS);
|
1993-03-30 22:29:35 +02:00
|
|
|
|
sub_optab = init_optab (MINUS);
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
subv_optab = init_optabv (MINUS);
|
1993-03-30 22:29:35 +02:00
|
|
|
|
smul_optab = init_optab (MULT);
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
smulv_optab = init_optabv (MULT);
|
1994-06-29 02:21:32 +02:00
|
|
|
|
smul_highpart_optab = init_optab (UNKNOWN);
|
|
|
|
|
umul_highpart_optab = init_optab (UNKNOWN);
|
1993-03-30 22:29:35 +02:00
|
|
|
|
smul_widen_optab = init_optab (UNKNOWN);
|
|
|
|
|
umul_widen_optab = init_optab (UNKNOWN);
|
|
|
|
|
sdiv_optab = init_optab (DIV);
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
sdivv_optab = init_optabv (DIV);
|
1993-03-30 22:29:35 +02:00
|
|
|
|
sdivmod_optab = init_optab (UNKNOWN);
|
|
|
|
|
udiv_optab = init_optab (UDIV);
|
|
|
|
|
udivmod_optab = init_optab (UNKNOWN);
|
|
|
|
|
smod_optab = init_optab (MOD);
|
|
|
|
|
umod_optab = init_optab (UMOD);
|
optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem.
* optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem.
(fmod_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize fmod_optab and drem_optab.
* genopinit.c (optabs): Implement fmod_optab and drem_optab
using fmod?f3 and drem?f3 patterns.
* builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_FMOD{,F,L}
using fmod_optab and BUILT_IN_DREM{,F,L} using drem_optab.
(expand_builtin): Expand BUILT_IN_FMOD{,F,L} and
BUILT_IN_DREM{,F,L} using expand_builtin_mathfn_2 if
flag_unsafe_math_optimizations is set.
* reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FPREM_F,
UNSPEC_FPREM_U, UNSPEC_FPREM1_F and UNSPEC_FPREM1_U.
* config/i386/i386.c (ix86_emit_fp_unordered_jump): New function.
* config/i386/i386-protos.h (ix86_emit_fp_unordered_jump):
Prototype here.
* config/i386/i386.md (UNSPEC_FPREM_F, UNSPEC_FPREM_U,
UNSPEC_FPREM1_F, UNSPEC_FPREM1_U): New unspecs to represent x87's
fprem and fprem1 instructions.
(*x86_fnstsw_1): Change input parameter to (reg:CCFP 18).
Rename insn definition to x86_fnstsw_1.
(fpremxf4, fprem1xf4): New patterns to implement fprem and fprem1
x87 instructions.
(fmodsf3, fmoddf3, fmodxf3): New expanders to implement fmodf, fmod
and fmodl built-ins as inline x87 intrinsics.
(dremsf3, dremdf3, dremxf3): New expanders to implement dremf, drem
and dreml built-ins as inline x87 intrinsics.
* testsuite/gcc.dg/builtins-40.c: New test.
From-SVN: r81555
2004-05-06 07:19:24 +02:00
|
|
|
|
fmod_optab = init_optab (UNKNOWN);
|
|
|
|
|
drem_optab = init_optab (UNKNOWN);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
ftrunc_optab = init_optab (UNKNOWN);
|
|
|
|
|
and_optab = init_optab (AND);
|
|
|
|
|
ior_optab = init_optab (IOR);
|
|
|
|
|
xor_optab = init_optab (XOR);
|
|
|
|
|
ashl_optab = init_optab (ASHIFT);
|
|
|
|
|
ashr_optab = init_optab (ASHIFTRT);
|
|
|
|
|
lshr_optab = init_optab (LSHIFTRT);
|
|
|
|
|
rotl_optab = init_optab (ROTATE);
|
|
|
|
|
rotr_optab = init_optab (ROTATERT);
|
|
|
|
|
smin_optab = init_optab (SMIN);
|
|
|
|
|
smax_optab = init_optab (SMAX);
|
|
|
|
|
umin_optab = init_optab (UMIN);
|
|
|
|
|
umax_optab = init_optab (UMAX);
|
2003-02-11 20:34:11 +01:00
|
|
|
|
pow_optab = init_optab (UNKNOWN);
|
|
|
|
|
atan2_optab = init_optab (UNKNOWN);
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
|
|
|
|
|
/* These three have codes assigned exclusively for the sake of
|
|
|
|
|
have_insn_for. */
|
|
|
|
|
mov_optab = init_optab (SET);
|
|
|
|
|
movstrict_optab = init_optab (STRICT_LOW_PART);
|
|
|
|
|
cmp_optab = init_optab (COMPARE);
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
ucmp_optab = init_optab (UNKNOWN);
|
|
|
|
|
tst_optab = init_optab (UNKNOWN);
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
|
|
|
|
|
eq_optab = init_optab (EQ);
|
|
|
|
|
ne_optab = init_optab (NE);
|
|
|
|
|
gt_optab = init_optab (GT);
|
|
|
|
|
ge_optab = init_optab (GE);
|
|
|
|
|
lt_optab = init_optab (LT);
|
|
|
|
|
le_optab = init_optab (LE);
|
|
|
|
|
unord_optab = init_optab (UNORDERED);
|
|
|
|
|
|
1991-12-30 04:19:53 +01:00
|
|
|
|
neg_optab = init_optab (NEG);
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
negv_optab = init_optabv (NEG);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
abs_optab = init_optab (ABS);
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
absv_optab = init_optabv (ABS);
|
2003-01-07 22:09:21 +01:00
|
|
|
|
addcc_optab = init_optab (UNKNOWN);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
one_cmpl_optab = init_optab (NOT);
|
|
|
|
|
ffs_optab = init_optab (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
|
|
|
|
clz_optab = init_optab (CLZ);
|
|
|
|
|
ctz_optab = init_optab (CTZ);
|
|
|
|
|
popcount_optab = init_optab (POPCOUNT);
|
|
|
|
|
parity_optab = init_optab (PARITY);
|
1992-03-14 06:07:15 +01:00
|
|
|
|
sqrt_optab = init_optab (SQRT);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
floor_optab = init_optab (UNKNOWN);
|
|
|
|
|
ceil_optab = init_optab (UNKNOWN);
|
|
|
|
|
round_optab = init_optab (UNKNOWN);
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
btrunc_optab = init_optab (UNKNOWN);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
nearbyint_optab = init_optab (UNKNOWN);
|
builtins.c: Implement support for sincos function.
2004-04-06 Uros Bizjak <uros@kss-loka.si>
* builtins.c: Implement support for sincos function.
(expand_builtin_mathfn): Remove BUILT_IN_SIN{,F,L} and
BUILT_IN_COS{,F,L}.
(expand_builtin_mathfn_3): New function.
(expand_builtin): Expand BUILT_IN_SIN{,F,L} and
BUILT_IN_COS{,F,L} using expand_builtin_mathfn_3 if
flag_unsafe_math_optimization is set.
* optabs.h (enum optab_index): Add new OTI_sincos.
(sincos_optab): Define corresponding macro.
* optabs.c (init_optabs): Initialize sincos_optab.
(expand_twoval_unop): New function.
* genopinit.c (optabs): Implement sincos_optab using sincos?f3
patterns.
* reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_SINCOS_COS
and UNSPEC_SINCOS_SIN.
* config/i386/i386.md (sincosdf3, sincossf3, *sincosextendsfdf3,
sincosxf3): New patterns to implement sincos, sincosf and sincosl
built-ins as inline x87 intrinsics. Define splits for
sindf2, sinsf2, *sinextendsfdf2, sinxf2, cosdf2,
cossf2, *cosextendsfdf2 and cosxf2 patterns from corresponding
sincos patterns.
(sindf2, sinsf2, sinxf2): Rename to *sindf2, *sinsf2, *sinxf2.
(cosdf2, cossf2, cosxf2): Rename to *cosdf2, *cossf2, *cosxf2.
(UNSPEC_SINCOS_SIN, UNPEC_SINCOS_COS): New unspecs to represent
x87's unspec insn.
* gcc.dg/builtins-36.c: New test.
From-SVN: r80463
2004-04-06 21:34:33 +02:00
|
|
|
|
sincos_optab = init_optab (UNKNOWN);
|
1992-08-28 03:22:53 +02:00
|
|
|
|
sin_optab = init_optab (UNKNOWN);
|
optabs.h (enum optab_index): Add new OTI_asin and OTI_acos.
2004-04-20 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Add new OTI_asin and OTI_acos.
(asin_optab, acos_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize asin_optab and acos_optab.
* genopinit.c (optabs): Implement asin_optab and acos_optab
using asin?f2 and acos?f2 patterns.
* builtins.c (expand_builtin_mathfn): Handle BUILT_IN_ASIN{,F,L}
using asin_optab, and BUILT_IN_ACOS{,F,L} using acos_optab.
(expand_builtin): Expand BUILT_IN_ASIN{,F,L} and BUILT_IN_ACOS{,F,L}
using expand_builtin_mathfn if flag_unsafe_math_optimizations is set.
* config/i386/i386.md (asindf2, asinsf2, asinxf2, acosdf2,
acossf2, acosxf2): New expanders to implement asin, asinf, asinl,
acos, acosf and acosl built-ins as inline x87 intrinsics.
* gcc.dg/builtins-39.c: New test.
From-SVN: r80921
2004-04-20 21:40:31 +02:00
|
|
|
|
asin_optab = init_optab (UNKNOWN);
|
1992-08-28 03:22:53 +02:00
|
|
|
|
cos_optab = init_optab (UNKNOWN);
|
optabs.h (enum optab_index): Add new OTI_asin and OTI_acos.
2004-04-20 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Add new OTI_asin and OTI_acos.
(asin_optab, acos_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize asin_optab and acos_optab.
* genopinit.c (optabs): Implement asin_optab and acos_optab
using asin?f2 and acos?f2 patterns.
* builtins.c (expand_builtin_mathfn): Handle BUILT_IN_ASIN{,F,L}
using asin_optab, and BUILT_IN_ACOS{,F,L} using acos_optab.
(expand_builtin): Expand BUILT_IN_ASIN{,F,L} and BUILT_IN_ACOS{,F,L}
using expand_builtin_mathfn if flag_unsafe_math_optimizations is set.
* config/i386/i386.md (asindf2, asinsf2, asinxf2, acosdf2,
acossf2, acosxf2): New expanders to implement asin, asinf, asinl,
acos, acosf and acosl built-ins as inline x87 intrinsics.
* gcc.dg/builtins-39.c: New test.
From-SVN: r80921
2004-04-20 21:40:31 +02:00
|
|
|
|
acos_optab = init_optab (UNKNOWN);
|
2002-08-04 01:21:31 +02:00
|
|
|
|
exp_optab = init_optab (UNKNOWN);
|
optabs.h (enum optab_index): Add new OTI_exp10 and OTI_exp2.
2004-03-10 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Add new OTI_exp10 and OTI_exp2.
(exp10_optab, exp2_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize exp10_optab and exp2_optab.
* genopinit.c (optabs): Implement exp10_optab and exp2_optab
using exp10?f2 and exp2?f2 patterns.
* builtins.c (expand_builtin_mathfn): Handle BUILT_IN_EXP10{,F,L}
using exp10_optab, and BUILT_IN_EXP2{,F,L} using exp2_optab.
(expand_builtin): Expand BUILT_IN_EXP10{,F,L} and BUILT_IN_EXP2{,F,L}
using expand_builtin_mathfn if flag_unsafe_math_optimizations is set.
* config/i386/i386.md (exp10sf2, exp10df2, exp10xf2, exp2sf2,
exp2df2, exp2xf2): New patterns to implement exp10, exp10f, exp10l,
exp2, exp2f and exp2l built-ins as inline x87 intrinsics.
* gcc.dg/builtins-34.c: New test.
From-SVN: r79279
2004-03-10 23:36:22 +01:00
|
|
|
|
exp10_optab = init_optab (UNKNOWN);
|
|
|
|
|
exp2_optab = init_optab (UNKNOWN);
|
2004-05-03 07:31:45 +02:00
|
|
|
|
expm1_optab = init_optab (UNKNOWN);
|
optabs.h (enum optab_index): Add new OTI_logb and OTI_ilogb.
2004-04-14 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Add new OTI_logb and OTI_ilogb.
(logb_optab, ilogb_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize logb_optab and ilogb_optab.
* genopinit.c (optabs): Implement logb_optab and ilogb_optab
using logb?f2 and ilogb?i2 patterns.
* builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOGB{,F,L}
using logb_optab, and BUILT_IN_ILOGB{,F,L} using ilogb_optab.
(expand_builtin): Expand BUILT_IN_LOGB{,F,L} and BUILT_IN_ILOGB{,F,L}
using expand_builtin_mathfn if flag_unsafe_math_optimizations is set.
* reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_XTRACT_FRACT
and UNSPEC_XTRACT_EXP.
* config/i386/i386.md (*fxtractdf3, *fxtractsf3, *fxtractxf3): New
patterns to implement fxtract x87 instruction.
(logbdf2, logbsf2, logbxf2, ilogbsi2): New expanders to implement
logb, logbf, logbl, ilogb, ilogbf and ilogbl built-ins as inline x87
intrinsics.
(UNSPEC_XTRACT_FRACT, UNSPEC_XTRACT_EXP): New unspecs to represent
x87's fxtract insn.
* gcc.dg/builtins-38.c: New test.
From-SVN: r80709
2004-04-15 04:43:46 +02:00
|
|
|
|
logb_optab = init_optab (UNKNOWN);
|
|
|
|
|
ilogb_optab = init_optab (UNKNOWN);
|
2002-08-04 01:21:31 +02:00
|
|
|
|
log_optab = init_optab (UNKNOWN);
|
optabs.h (enum optab_index): Add new OTI_log10 and OTI_log2.
2004-02-11 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Add new OTI_log10 and OTI_log2.
(log10_optab, log2_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize log10_optab and log2_optab.
* genopinit.c (optabs): Implement log10_optab and log2_optab
using log10?f2 and log2?f2 patterns.
* builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOG10{,F,L}
using log10_optab, and BUILT_IN_LOG2{,F,L} using log2_optab.
(expand_builtin): Expand BUILT_IN_LOG10{,F,L} and BUILT_IN_LOG2{,F,L}
using expand_builtin_mathfn if flag_unsafe_math_optimizations is set.
* config/i386/i386.md (log10sf2, log10df2, log10xf2, log2sf2,
log2df2, log2xf2): New patterns to implement log10, log10f, log10l,
log2, log2f and log2l built-ins as inline x87 intrinsics.
* gcc.dg/builtins-33.c: New test.
From-SVN: r77675
2004-02-12 00:39:41 +01:00
|
|
|
|
log10_optab = init_optab (UNKNOWN);
|
|
|
|
|
log2_optab = init_optab (UNKNOWN);
|
2004-05-07 07:38:21 +02:00
|
|
|
|
log1p_optab = init_optab (UNKNOWN);
|
optabs.h (enum optab_index): Add new OTI_tan and OTI_atan.
* optabs.h (enum optab_index): Add new OTI_tan and OTI_atan.
(tan_optab, atan_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize tan_optab and atan_optab.
* genopinit.c (optabs): Implement tan_optab and atan_optab
using tan?f2 and atan?f2 patterns.
* builtins.c (expand_builtin_mathfn): Handle BUILT_IN_TAN{,F,L}
using tan_optab, and BUILT_IN_ATAN{,F,L} using atan_optab.
Change the default value of errno_set to false.
(expand_builtin): Expand BUILT_IN_TAN{,F,L} and BUILT_IN_ATAN{,F,L}
using expand_builtin_mathfn.
* config/i386/i386.md (atansf2, atandf2, atanxf2, atantf2): New
expander patterns implemented using existing atan2?f3 patterns.
* gcc.dg/i386-387-5.c: New test case.
* gcc.dg/i386-387-6.c: New test case.
* gcc.dg/builtins-23.c: New test case.
From-SVN: r68013
2003-06-16 14:53:16 +02:00
|
|
|
|
tan_optab = init_optab (UNKNOWN);
|
|
|
|
|
atan_optab = init_optab (UNKNOWN);
|
1992-03-29 06:32:58 +02:00
|
|
|
|
strlen_optab = init_optab (UNKNOWN);
|
1999-09-23 13:34:49 +02:00
|
|
|
|
cbranch_optab = init_optab (UNKNOWN);
|
|
|
|
|
cmov_optab = init_optab (UNKNOWN);
|
|
|
|
|
cstore_optab = init_optab (UNKNOWN);
|
2001-07-20 22:07:58 +02:00
|
|
|
|
push_optab = init_optab (UNKNOWN);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
2004-01-01 15:13:44 +01:00
|
|
|
|
vec_extract_optab = init_optab (UNKNOWN);
|
|
|
|
|
vec_set_optab = init_optab (UNKNOWN);
|
|
|
|
|
vec_init_optab = init_optab (UNKNOWN);
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* Conversions. */
|
|
|
|
|
sext_optab = init_convert_optab (SIGN_EXTEND);
|
|
|
|
|
zext_optab = init_convert_optab (ZERO_EXTEND);
|
|
|
|
|
trunc_optab = init_convert_optab (TRUNCATE);
|
|
|
|
|
sfix_optab = init_convert_optab (FIX);
|
|
|
|
|
ufix_optab = init_convert_optab (UNSIGNED_FIX);
|
|
|
|
|
sfixtrunc_optab = init_convert_optab (UNKNOWN);
|
|
|
|
|
ufixtrunc_optab = init_convert_optab (UNKNOWN);
|
|
|
|
|
sfloat_optab = init_convert_optab (FLOAT);
|
|
|
|
|
ufloat_optab = init_convert_optab (UNSIGNED_FLOAT);
|
|
|
|
|
|
1993-03-30 22:29:35 +02:00
|
|
|
|
for (i = 0; i < NUM_MACHINE_MODES; i++)
|
|
|
|
|
{
|
2004-07-07 21:25:01 +02:00
|
|
|
|
movmem_optab[i] = CODE_FOR_nothing;
|
|
|
|
|
clrmem_optab[i] = CODE_FOR_nothing;
|
2003-10-07 09:25:32 +02:00
|
|
|
|
cmpstr_optab[i] = CODE_FOR_nothing;
|
|
|
|
|
cmpmem_optab[i] = CODE_FOR_nothing;
|
1993-03-30 22:29:35 +02:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SECONDARY_RELOADS
|
|
|
|
|
reload_in_optab[i] = reload_out_optab[i] = CODE_FOR_nothing;
|
1991-12-30 04:19:53 +01:00
|
|
|
|
#endif
|
1993-03-30 22:29:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Fill in the optabs with the insns we support. */
|
|
|
|
|
init_all_optabs ();
|
|
|
|
|
|
|
|
|
|
/* Initialize the optabs with the names of the library functions. */
|
1992-06-23 02:28:39 +02:00
|
|
|
|
init_integral_libfuncs (add_optab, "add", '3');
|
|
|
|
|
init_floating_libfuncs (add_optab, "add", '3');
|
2000-10-18 23:33:41 +02:00
|
|
|
|
init_integral_libfuncs (addv_optab, "addv", '3');
|
|
|
|
|
init_floating_libfuncs (addv_optab, "add", '3');
|
1992-06-23 02:28:39 +02:00
|
|
|
|
init_integral_libfuncs (sub_optab, "sub", '3');
|
|
|
|
|
init_floating_libfuncs (sub_optab, "sub", '3');
|
2000-10-18 23:33:41 +02:00
|
|
|
|
init_integral_libfuncs (subv_optab, "subv", '3');
|
|
|
|
|
init_floating_libfuncs (subv_optab, "sub", '3');
|
1992-06-23 02:28:39 +02:00
|
|
|
|
init_integral_libfuncs (smul_optab, "mul", '3');
|
|
|
|
|
init_floating_libfuncs (smul_optab, "mul", '3');
|
2000-10-18 23:33:41 +02:00
|
|
|
|
init_integral_libfuncs (smulv_optab, "mulv", '3');
|
|
|
|
|
init_floating_libfuncs (smulv_optab, "mul", '3');
|
1993-03-30 22:29:35 +02:00
|
|
|
|
init_integral_libfuncs (sdiv_optab, "div", '3');
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
init_floating_libfuncs (sdiv_optab, "div", '3');
|
2000-10-18 23:33:41 +02:00
|
|
|
|
init_integral_libfuncs (sdivv_optab, "divv", '3');
|
1993-03-30 22:29:35 +02:00
|
|
|
|
init_integral_libfuncs (udiv_optab, "udiv", '3');
|
|
|
|
|
init_integral_libfuncs (sdivmod_optab, "divmod", '4');
|
|
|
|
|
init_integral_libfuncs (udivmod_optab, "udivmod", '4');
|
|
|
|
|
init_integral_libfuncs (smod_optab, "mod", '3');
|
|
|
|
|
init_integral_libfuncs (umod_optab, "umod", '3');
|
|
|
|
|
init_floating_libfuncs (ftrunc_optab, "ftrunc", '2');
|
|
|
|
|
init_integral_libfuncs (and_optab, "and", '3');
|
|
|
|
|
init_integral_libfuncs (ior_optab, "ior", '3');
|
|
|
|
|
init_integral_libfuncs (xor_optab, "xor", '3');
|
|
|
|
|
init_integral_libfuncs (ashl_optab, "ashl", '3');
|
|
|
|
|
init_integral_libfuncs (ashr_optab, "ashr", '3');
|
|
|
|
|
init_integral_libfuncs (lshr_optab, "lshr", '3');
|
|
|
|
|
init_integral_libfuncs (smin_optab, "min", '3');
|
|
|
|
|
init_floating_libfuncs (smin_optab, "min", '3');
|
|
|
|
|
init_integral_libfuncs (smax_optab, "max", '3');
|
|
|
|
|
init_floating_libfuncs (smax_optab, "max", '3');
|
|
|
|
|
init_integral_libfuncs (umin_optab, "umin", '3');
|
|
|
|
|
init_integral_libfuncs (umax_optab, "umax", '3');
|
|
|
|
|
init_integral_libfuncs (neg_optab, "neg", '2');
|
|
|
|
|
init_floating_libfuncs (neg_optab, "neg", '2');
|
2000-10-18 23:33:41 +02:00
|
|
|
|
init_integral_libfuncs (negv_optab, "negv", '2');
|
|
|
|
|
init_floating_libfuncs (negv_optab, "neg", '2');
|
1993-03-30 22:29:35 +02:00
|
|
|
|
init_integral_libfuncs (one_cmpl_optab, "one_cmpl", '2');
|
|
|
|
|
init_integral_libfuncs (ffs_optab, "ffs", '2');
|
[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
|
|
|
|
init_integral_libfuncs (clz_optab, "clz", '2');
|
|
|
|
|
init_integral_libfuncs (ctz_optab, "ctz", '2');
|
|
|
|
|
init_integral_libfuncs (popcount_optab, "popcount", '2');
|
|
|
|
|
init_integral_libfuncs (parity_optab, "parity", '2');
|
1993-03-30 22:29:35 +02:00
|
|
|
|
|
|
|
|
|
/* Comparison libcalls for integers MUST come in pairs, signed/unsigned. */
|
|
|
|
|
init_integral_libfuncs (cmp_optab, "cmp", '2');
|
|
|
|
|
init_integral_libfuncs (ucmp_optab, "ucmp", '2');
|
|
|
|
|
init_floating_libfuncs (cmp_optab, "cmp", '2');
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
* libfuncs.h
(LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2)
(LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2)
(LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2)
(LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2)
(LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2)
(LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2)
(LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2)
(eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc)
(lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc)
(nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc)
(lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc)
(gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc)
(unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc)
(gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc
(eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc)
(lttf2_libfunc, letf2_libfunc, unordtf2_libfunc):
Delete.
* optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le)
(OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab)
(le_optab, unord_optab): New.
* optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs
from the code_to_optab table, not a giant switch; use
swap_condition; do widening only if a comparison function that
we can call exists in a wider mode, not if a cmp_optab insn or
libfunc exists in a wider mode; call protect_from_queue
exactly once on each operand.
(init_optabs): Initialize the new optabs, not the deleted libfuncs.
* config/gofast.h, config/ia64/ia64.c, config/mips/mips.c
* config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c:
Set floating point comparison libfuncs using set_optab_libfunc
on the appropriate optab.
* config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo.
* config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI
selector conditionals.
From-SVN: r72101
2003-10-04 23:36:08 +02:00
|
|
|
|
/* EQ etc are floating point only. */
|
|
|
|
|
init_floating_libfuncs (eq_optab, "eq", '2');
|
|
|
|
|
init_floating_libfuncs (ne_optab, "ne", '2');
|
|
|
|
|
init_floating_libfuncs (gt_optab, "gt", '2');
|
|
|
|
|
init_floating_libfuncs (ge_optab, "ge", '2');
|
|
|
|
|
init_floating_libfuncs (lt_optab, "lt", '2');
|
|
|
|
|
init_floating_libfuncs (le_optab, "le", '2');
|
|
|
|
|
init_floating_libfuncs (unord_optab, "unord", '2');
|
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* Conversions. */
|
|
|
|
|
init_interclass_conv_libfuncs (sfloat_optab, "float", MODE_INT, MODE_FLOAT);
|
|
|
|
|
init_interclass_conv_libfuncs (sfix_optab, "fix", MODE_FLOAT, MODE_INT);
|
|
|
|
|
init_interclass_conv_libfuncs (ufix_optab, "fixuns", MODE_FLOAT, MODE_INT);
|
1991-12-30 04:19:53 +01:00
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* sext_optab is also used for FLOAT_EXTEND. */
|
|
|
|
|
init_intraclass_conv_libfuncs (sext_optab, "extend", MODE_FLOAT, true);
|
|
|
|
|
init_intraclass_conv_libfuncs (trunc_optab, "trunc", MODE_FLOAT, false);
|
1999-09-09 09:07:41 +02:00
|
|
|
|
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
/* Use cabs for double complex abs, since systems generally have cabs.
|
|
|
|
|
Don't define any libcall for float complex, so that cabs will be used. */
|
|
|
|
|
if (complex_double_type_node)
|
|
|
|
|
abs_optab->handlers[TYPE_MODE (complex_double_type_node)].libfunc
|
|
|
|
|
= init_one_libfunc ("cabs");
|
1999-09-09 09:07:41 +02:00
|
|
|
|
|
2003-11-21 07:52:23 +01:00
|
|
|
|
/* The ffs function operates on `int'. */
|
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
From-SVN: r72178
2003-10-07 04:23:42 +02:00
|
|
|
|
ffs_optab->handlers[(int) mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)].libfunc
|
|
|
|
|
= init_one_libfunc ("ffs");
|
1999-09-09 09:07:41 +02:00
|
|
|
|
|
2002-03-31 11:52:42 +02:00
|
|
|
|
abort_libfunc = init_one_libfunc ("abort");
|
1999-09-09 09:07:41 +02:00
|
|
|
|
memcpy_libfunc = init_one_libfunc ("memcpy");
|
2001-04-14 05:39:22 +02:00
|
|
|
|
memmove_libfunc = init_one_libfunc ("memmove");
|
1999-09-09 09:07:41 +02:00
|
|
|
|
memcmp_libfunc = init_one_libfunc ("memcmp");
|
|
|
|
|
memset_libfunc = init_one_libfunc ("memset");
|
2003-04-11 21:45:32 +02:00
|
|
|
|
setbits_libfunc = init_one_libfunc ("__setbits");
|
1999-09-09 09:07:41 +02:00
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
|
unwind_resume_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
|
|
|
|
|
? "_Unwind_SjLj_Resume"
|
|
|
|
|
: "_Unwind_Resume");
|
1997-05-08 00:50:11 +02:00
|
|
|
|
#ifndef DONT_USE_BUILTIN_SETJMP
|
1999-09-09 09:07:41 +02:00
|
|
|
|
setjmp_libfunc = init_one_libfunc ("__builtin_setjmp");
|
|
|
|
|
longjmp_libfunc = init_one_libfunc ("__builtin_longjmp");
|
1997-04-23 22:11:52 +02:00
|
|
|
|
#else
|
1999-09-09 09:07:41 +02:00
|
|
|
|
setjmp_libfunc = init_one_libfunc ("setjmp");
|
|
|
|
|
longjmp_libfunc = init_one_libfunc ("longjmp");
|
1997-04-23 22:11:52 +02:00
|
|
|
|
#endif
|
2001-03-28 13:04:51 +02:00
|
|
|
|
unwind_sjlj_register_libfunc = init_one_libfunc ("_Unwind_SjLj_Register");
|
|
|
|
|
unwind_sjlj_unregister_libfunc
|
|
|
|
|
= init_one_libfunc ("_Unwind_SjLj_Unregister");
|
1996-07-23 22:03:47 +02:00
|
|
|
|
|
1998-07-30 12:38:22 +02:00
|
|
|
|
/* For function entry/exit instrumentation. */
|
|
|
|
|
profile_function_entry_libfunc
|
1999-09-09 09:07:41 +02:00
|
|
|
|
= init_one_libfunc ("__cyg_profile_func_enter");
|
1998-07-30 12:38:22 +02:00
|
|
|
|
profile_function_exit_libfunc
|
1999-09-09 09:07:41 +02:00
|
|
|
|
= init_one_libfunc ("__cyg_profile_func_exit");
|
1998-07-30 12:38:22 +02:00
|
|
|
|
|
2003-04-11 21:45:32 +02:00
|
|
|
|
gcov_flush_libfunc = init_one_libfunc ("__gcov_flush");
|
|
|
|
|
|
2003-06-05 18:31:49 +02:00
|
|
|
|
if (HAVE_conditional_trap)
|
|
|
|
|
trap_rtx = gen_rtx_fmt_ee (EQ, VOIDmode, NULL_RTX, NULL_RTX);
|
1998-06-17 18:14:09 +02:00
|
|
|
|
|
1994-07-12 00:37:14 +02:00
|
|
|
|
/* Allow the target to add more libcalls or rename some, etc. */
|
target.h (init_libfuncs): New hook.
* target.h (init_libfuncs): New hook.
* target-def.h: Default TARGET_INIT_BUILTINS and
TARGET_INIT_LIBFUNCS to hook_void_void. Add
TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER.
* builtins.c (default_init_builtins): Delete.
* expr.h (default_init_builtins): Delete prototype.
* doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST.
Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL.
Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL,
DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL,
MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL,
and UMODDI3_LIBCALL,
* Makefile.in (optabs.o): Depends on target.h.
* defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL.
* optabs.c: Include target.h.
(prepare_float_lib_cmp): No need for #ifdef around use of
FLOAT_LIB_COMPARE_RETURNS_BOOL.
(set_optab_libfunc): New function.
(init_optabs): Delete use of all *_LIBCALL defines.
Call targetm.init_libfuncs not INIT_TARGET_OPTABS.
* optabs.h: Prototype set_optab_libfunc.
* config.gcc: Remove all references to pa/long_double.h,
ia64/hpux_longdouble.h, and gofast.h.
(mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST
to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file.
* config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c
* config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c
* config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c, config/vax/vax.c:
Provide a definition for TARGET_INIT_LIBFUNCS. Where
necessary, include optabs.h, libfuncs.h, and/or config/gofast.h.
* config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h
* config/avr/avr.h, config/cris/cris.h, config/frv/frv.h
* config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h
* config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h
* config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h
* config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h
* config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h
* config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS,
INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros.
* config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0.
Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here.
* config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE,
HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here.
* config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete.
* config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC.
* config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 0.
* config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 1.
* config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and
SUN_INTEGER_MULTIPLY_64 to 0.
* config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h:
Define US_SOFTWARE_GOFAST.
* config/vax/vax.h: Default TARGET_ELF to 0.
* config/vax/elf.h: Redefine TARGET_ELF to 1.
* config/gofast.h: Don't define any macros here. Provide one
static function, gofast_maybe_init_libfuncs, which does what
INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST
is already defined. Do not clear negation libfuncs. Do
not mess with HFmode, XFmode, or TFmode libfuncs.
* config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME.
From-SVN: r72009
2003-10-02 02:44:29 +02:00
|
|
|
|
targetm.init_libfuncs ();
|
1991-12-30 04:19:53 +01:00
|
|
|
|
}
|
1992-03-02 09:03:23 +01:00
|
|
|
|
|
1998-06-17 18:14:09 +02:00
|
|
|
|
/* Generate insns to trap with code TCODE if OP1 and OP2 satisfy condition
|
|
|
|
|
CODE. Return 0 on failure. */
|
|
|
|
|
|
|
|
|
|
rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
gen_cond_trap (enum rtx_code code ATTRIBUTE_UNUSED, rtx op1,
|
|
|
|
|
rtx op2 ATTRIBUTE_UNUSED, rtx tcode ATTRIBUTE_UNUSED)
|
1998-06-17 18:14:09 +02:00
|
|
|
|
{
|
|
|
|
|
enum machine_mode mode = GET_MODE (op1);
|
2003-06-05 18:31:49 +02:00
|
|
|
|
enum insn_code icode;
|
|
|
|
|
rtx insn;
|
|
|
|
|
|
|
|
|
|
if (!HAVE_conditional_trap)
|
|
|
|
|
return 0;
|
1998-06-17 18:14:09 +02:00
|
|
|
|
|
|
|
|
|
if (mode == VOIDmode)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2003-06-05 18:31:49 +02:00
|
|
|
|
icode = cmp_optab->handlers[(int) mode].insn_code;
|
|
|
|
|
if (icode == CODE_FOR_nothing)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
op1 = prepare_operand (icode, op1, 0, mode, mode, 0);
|
2003-06-11 08:43:43 +02:00
|
|
|
|
op2 = prepare_operand (icode, op2, 1, mode, mode, 0);
|
2003-07-19 02:28:05 +02:00
|
|
|
|
if (!op1 || !op2)
|
|
|
|
|
{
|
|
|
|
|
end_sequence ();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2003-06-05 18:31:49 +02:00
|
|
|
|
emit_insn (GEN_FCN (icode) (op1, op2));
|
|
|
|
|
|
|
|
|
|
PUT_CODE (trap_rtx, code);
|
|
|
|
|
insn = gen_conditional_trap (trap_rtx, tcode);
|
|
|
|
|
if (insn)
|
1998-06-17 18:14:09 +02:00
|
|
|
|
{
|
2003-06-05 18:31:49 +02:00
|
|
|
|
emit_insn (insn);
|
|
|
|
|
insn = get_insns ();
|
1998-06-17 18:14:09 +02:00
|
|
|
|
}
|
2003-06-05 18:31:49 +02:00
|
|
|
|
end_sequence ();
|
1998-06-17 18:14:09 +02:00
|
|
|
|
|
2003-06-05 18:31:49 +02:00
|
|
|
|
return insn;
|
1998-06-17 18:14:09 +02:00
|
|
|
|
}
|
2002-06-04 09:11:05 +02:00
|
|
|
|
|
|
|
|
|
#include "gt-optabs.h"
|